init
This commit is contained in:
85
themes/godocs-1/assets/js/bootstrap.js
vendored
Normal file
85
themes/godocs-1/assets/js/bootstrap.js
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
// bootstrap js components
|
||||
// import Alert from "js/bootstrap/src/alert";
|
||||
// import Button from "js/bootstrap/src/button";
|
||||
// import Carousel from "js/bootstrap/src/carousel";
|
||||
import Collapse from "js/bootstrap/src/collapse";
|
||||
import Dropdown from "js/bootstrap/src/dropdown";
|
||||
import Modal from "js/bootstrap/src/modal";
|
||||
// import Offcanvas from "js/bootstrap/src/offcanvas";
|
||||
// import Popover from "js/bootstrap/src/popover";
|
||||
// import ScrollSpy from "js/bootstrap/src/scrollspy";
|
||||
import Tab from "js/bootstrap/src/tab";
|
||||
// import Toast from "js/bootstrap/src/toast";
|
||||
// import Tooltip from "js/bootstrap/src/tooltip";
|
||||
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
let searchModalEl = document.getElementById('searchModal');
|
||||
let modalOpen = false;
|
||||
let searchModal = new Modal(searchModalEl, {});
|
||||
|
||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
});
|
||||
if (params.search !== null && params.search !== undefined) {
|
||||
searchModal.show();
|
||||
modalOpen = true;
|
||||
} else {
|
||||
searchModal.hide();
|
||||
modalOpen = false;
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === "Escape") {
|
||||
searchModal.hide();
|
||||
} else if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
|
||||
if (!modalOpen) {
|
||||
e.preventDefault();
|
||||
searchModal.show();
|
||||
modalOpen = true;
|
||||
} else {
|
||||
e.preventDefault();
|
||||
searchModal.hide();
|
||||
modalOpen = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
searchModalEl.addEventListener('hidden.bs.modal', e => {
|
||||
modalOpen = false;
|
||||
});
|
||||
|
||||
// document.addEventListener('keydown', function(e) {
|
||||
// let searchModal = new Modal(document.getElementById('searchModal'), {});
|
||||
// let modalOpen = document.getElementById('searchModal').classList.contains('show');
|
||||
|
||||
// if (e.key === "Escape") {
|
||||
// searchModal.hide();
|
||||
// } else if (e.ctrlKey && e.key === 'k' || e.metaKey && e.key === 'k') {
|
||||
// e.preventDefault();
|
||||
// if (modalOpen) {
|
||||
// searchModal.hide();
|
||||
// } else {
|
||||
// searchModal.show();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// let toastElList = [].slice.call(document.querySelectorAll(".toast"));
|
||||
// let toastList = toastElList.map(function (toastEl) {
|
||||
// return new Toast(toastEl);
|
||||
// });
|
||||
|
||||
// toastList.forEach(function (toast) {
|
||||
// toast.show();
|
||||
// });
|
||||
|
||||
// let popoverTriggerList = [].slice.call(
|
||||
// document.querySelectorAll('[data-bs-toggle="popover"]')
|
||||
// );
|
||||
// popoverTriggerList.map(function (popoverTriggerEl) {
|
||||
// return new Popover(popoverTriggerEl);
|
||||
// });
|
||||
})();
|
||||
56
themes/godocs-1/assets/js/script.js
Normal file
56
themes/godocs-1/assets/js/script.js
Normal file
@@ -0,0 +1,56 @@
|
||||
'use strict';
|
||||
|
||||
// searchToggler keyboard shortcut
|
||||
const searchToggler = document.querySelectorAll('[data-search-toggler]');
|
||||
searchToggler.forEach((item) => {
|
||||
let userAgentData = navigator?.userAgentData?.platform || navigator?.platform || 'unknown';
|
||||
|
||||
if (userAgentData == 'macOS') {
|
||||
item.innerText = `⌘ + K`
|
||||
} else {
|
||||
item.innerText = `Ctrl + K`
|
||||
}
|
||||
});
|
||||
|
||||
// Navbar fixed
|
||||
window.onscroll = function () {
|
||||
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
|
||||
document.querySelector(".navigation").classList.add("nav-bg");
|
||||
} else {
|
||||
document.querySelector(".navigation").classList.remove("nav-bg");
|
||||
}
|
||||
};
|
||||
|
||||
// masonry
|
||||
window.onload = function () {
|
||||
let masonryWrapper = document.querySelector('.masonry-wrapper');
|
||||
// if masonryWrapper is not null, then initialize masonry
|
||||
if (masonryWrapper) {
|
||||
let masonry = new Masonry(masonryWrapper, {
|
||||
columnWidth: 1
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// copy to clipboard
|
||||
let blocks = document.querySelectorAll("pre");
|
||||
blocks.forEach((block) => {
|
||||
if (navigator.clipboard) {
|
||||
let button = document.createElement("span");
|
||||
button.innerText = "copy";
|
||||
button.className = "copy-to-clipboard";
|
||||
block.appendChild(button);
|
||||
button.addEventListener("click", async () => {
|
||||
await copyCode(block, button);
|
||||
});
|
||||
}
|
||||
});
|
||||
async function copyCode(block, button) {
|
||||
let code = block.querySelector("code");
|
||||
let text = code.innerText;
|
||||
await navigator.clipboard.writeText(text);
|
||||
button.innerText = "copied";
|
||||
setTimeout(() => {
|
||||
button.innerText = "copy";
|
||||
}, 700);
|
||||
}
|
||||
9
themes/godocs-1/assets/plugins/masonry/masonry.min.js
vendored
Normal file
9
themes/godocs-1/assets/plugins/masonry/masonry.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
735
themes/godocs-1/assets/plugins/webfont/webfont-loader-2.js
Normal file
735
themes/godocs-1/assets/plugins/webfont/webfont-loader-2.js
Normal file
@@ -0,0 +1,735 @@
|
||||
/* Web Font Loader v1.6.28 - (c) Adobe Systems, Google. License: Apache 2.0 */
|
||||
(function () {
|
||||
function aa(a, b, c) {
|
||||
return a.call.apply(a.bind, arguments)
|
||||
}
|
||||
|
||||
function ba(a, b, c) {
|
||||
if (!a) throw Error();
|
||||
if (2 < arguments.length) {
|
||||
var d = Array.prototype.slice.call(arguments, 2);
|
||||
return function () {
|
||||
var c = Array.prototype.slice.call(arguments);
|
||||
Array.prototype.unshift.apply(c, d);
|
||||
return a.apply(b, c)
|
||||
}
|
||||
}
|
||||
return function () {
|
||||
return a.apply(b, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
function p(a, b, c) {
|
||||
p = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? aa : ba;
|
||||
return p.apply(null, arguments)
|
||||
}
|
||||
var q = Date.now || function () {
|
||||
return +new Date
|
||||
};
|
||||
|
||||
function ca(a, b) {
|
||||
this.a = a;
|
||||
this.s = b || a;
|
||||
this.c = this.s.document
|
||||
}
|
||||
var da = !!window.FontFace;
|
||||
|
||||
function t(a, b, c, d) {
|
||||
b = a.c.createElement(b);
|
||||
if (c)
|
||||
for (var e in c) c.hasOwnProperty(e) && ("style" == e ? b.style.cssText = c[e] : b.setAttribute(e, c[e]));
|
||||
d && b.appendChild(a.c.createTextNode(d));
|
||||
return b
|
||||
}
|
||||
|
||||
function u(a, b, c) {
|
||||
a = a.c.getElementsByTagName(b)[0];
|
||||
a || (a = document.documentElement);
|
||||
a.insertBefore(c, a.lastChild)
|
||||
}
|
||||
|
||||
function v(a) {
|
||||
a.parentNode && a.parentNode.removeChild(a)
|
||||
}
|
||||
|
||||
function w(a, b, c) {
|
||||
b = b || [];
|
||||
c = c || [];
|
||||
for (var d = a.className.split(/\s+/), e = 0; e < b.length; e += 1) {
|
||||
for (var f = !1, g = 0; g < d.length; g += 1)
|
||||
if (b[e] === d[g]) {
|
||||
f = !0;
|
||||
break
|
||||
} f || d.push(b[e])
|
||||
}
|
||||
b = [];
|
||||
for (e = 0; e < d.length; e += 1) {
|
||||
f = !1;
|
||||
for (g = 0; g < c.length; g += 1)
|
||||
if (d[e] === c[g]) {
|
||||
f = !0;
|
||||
break
|
||||
} f || b.push(d[e])
|
||||
}
|
||||
a.className = b.join(" ").replace(/\s+/g, " ").replace(/^\s+|\s+$/, "")
|
||||
}
|
||||
|
||||
function y(a, b) {
|
||||
for (var c = a.className.split(/\s+/), d = 0, e = c.length; d < e; d++)
|
||||
if (c[d] == b) return !0;
|
||||
return !1
|
||||
}
|
||||
|
||||
function ea(a) {
|
||||
return a.s.location.hostname || a.a.location.hostname
|
||||
}
|
||||
|
||||
function z(a, b, c) {
|
||||
function d() {
|
||||
m && e && f && (m(g), m = null)
|
||||
}
|
||||
b = t(a, "link", {
|
||||
rel: "stylesheet",
|
||||
href: b,
|
||||
media: "all"
|
||||
});
|
||||
var e = !1,
|
||||
f = !0,
|
||||
g = null,
|
||||
m = c || null;
|
||||
da ? (b.onload = function () {
|
||||
e = !0;
|
||||
d()
|
||||
}, b.onerror = function () {
|
||||
e = !0;
|
||||
g = Error("Stylesheet failed to load");
|
||||
d()
|
||||
}) : setTimeout(function () {
|
||||
e = !0;
|
||||
d()
|
||||
}, 0);
|
||||
u(a, "head", b)
|
||||
}
|
||||
|
||||
function A(a, b, c, d) {
|
||||
var e = a.c.getElementsByTagName("head")[0];
|
||||
if (e) {
|
||||
var f = t(a, "script", {
|
||||
src: b
|
||||
}),
|
||||
g = !1;
|
||||
f.onload = f.onreadystatechange = function () {
|
||||
g || this.readyState && "loaded" != this.readyState && "complete" != this.readyState || (g = !0, c && c(null), f.onload = f.onreadystatechange = null, "HEAD" == f.parentNode.tagName && e.removeChild(f))
|
||||
};
|
||||
e.appendChild(f);
|
||||
setTimeout(function () {
|
||||
g || (g = !0, c && c(Error("Script load timeout")))
|
||||
}, d || 5E3);
|
||||
return f
|
||||
}
|
||||
return null
|
||||
};
|
||||
|
||||
function B() {
|
||||
this.a = 0;
|
||||
this.c = null
|
||||
}
|
||||
|
||||
function C(a) {
|
||||
a.a++;
|
||||
return function () {
|
||||
a.a--;
|
||||
D(a)
|
||||
}
|
||||
}
|
||||
|
||||
function E(a, b) {
|
||||
a.c = b;
|
||||
D(a)
|
||||
}
|
||||
|
||||
function D(a) {
|
||||
0 == a.a && a.c && (a.c(), a.c = null)
|
||||
};
|
||||
|
||||
function F(a) {
|
||||
this.a = a || "-"
|
||||
}
|
||||
F.prototype.c = function (a) {
|
||||
for (var b = [], c = 0; c < arguments.length; c++) b.push(arguments[c].replace(/[\W_]+/g, "").toLowerCase());
|
||||
return b.join(this.a)
|
||||
};
|
||||
|
||||
function G(a, b) {
|
||||
this.c = a;
|
||||
this.f = 4;
|
||||
this.a = "n";
|
||||
var c = (b || "n4").match(/^([nio])([1-9])$/i);
|
||||
c && (this.a = c[1], this.f = parseInt(c[2], 10))
|
||||
}
|
||||
|
||||
function fa(a) {
|
||||
return H(a) + " " + (a.f + "00") + " 300px " + I(a.c)
|
||||
}
|
||||
|
||||
function I(a) {
|
||||
var b = [];
|
||||
a = a.split(/,\s*/);
|
||||
for (var c = 0; c < a.length; c++) {
|
||||
var d = a[c].replace(/['"]/g, ""); - 1 != d.indexOf(" ") || /^\d/.test(d) ? b.push("'" + d + "'") : b.push(d)
|
||||
}
|
||||
return b.join(",")
|
||||
}
|
||||
|
||||
function J(a) {
|
||||
return a.a + a.f
|
||||
}
|
||||
|
||||
function H(a) {
|
||||
var b = "normal";
|
||||
"o" === a.a ? b = "oblique" : "i" === a.a && (b = "italic");
|
||||
return b
|
||||
}
|
||||
|
||||
function ga(a) {
|
||||
var b = 4,
|
||||
c = "n",
|
||||
d = null;
|
||||
a && ((d = a.match(/(normal|oblique|italic)/i)) && d[1] && (c = d[1].substr(0, 1).toLowerCase()), (d = a.match(/([1-9]00|normal|bold)/i)) && d[1] && (/bold/i.test(d[1]) ? b = 7 : /[1-9]00/.test(d[1]) && (b = parseInt(d[1].substr(0, 1), 10))));
|
||||
return c + b
|
||||
};
|
||||
|
||||
function ha(a, b) {
|
||||
this.c = a;
|
||||
this.f = a.s.document.documentElement;
|
||||
this.h = b;
|
||||
this.a = new F("-");
|
||||
this.j = !1 !== b.events;
|
||||
this.g = !1 !== b.classes
|
||||
}
|
||||
|
||||
function ia(a) {
|
||||
a.g && w(a.f, [a.a.c("wf", "loading")]);
|
||||
K(a, "loading")
|
||||
}
|
||||
|
||||
function L(a) {
|
||||
if (a.g) {
|
||||
var b = y(a.f, a.a.c("wf", "active")),
|
||||
c = [],
|
||||
d = [a.a.c("wf", "loading")];
|
||||
b || c.push(a.a.c("wf", "inactive"));
|
||||
w(a.f, c, d)
|
||||
}
|
||||
K(a, "inactive")
|
||||
}
|
||||
|
||||
function K(a, b, c) {
|
||||
if (a.j && a.h[b])
|
||||
if (c) a.h[b](c.c, J(c));
|
||||
else a.h[b]()
|
||||
};
|
||||
|
||||
function ja() {
|
||||
this.c = {}
|
||||
}
|
||||
|
||||
function ka(a, b, c) {
|
||||
var d = [],
|
||||
e;
|
||||
for (e in b)
|
||||
if (b.hasOwnProperty(e)) {
|
||||
var f = a.c[e];
|
||||
f && d.push(f(b[e], c))
|
||||
} return d
|
||||
};
|
||||
|
||||
function M(a, b) {
|
||||
this.c = a;
|
||||
this.f = b;
|
||||
this.a = t(this.c, "span", {
|
||||
"aria-hidden": "true"
|
||||
}, this.f)
|
||||
}
|
||||
|
||||
function N(a) {
|
||||
u(a.c, "body", a.a)
|
||||
}
|
||||
|
||||
function O(a) {
|
||||
return "display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:" + I(a.c) + ";" + ("font-style:" + H(a) + ";font-weight:" + (a.f + "00") + ";")
|
||||
};
|
||||
|
||||
function P(a, b, c, d, e, f) {
|
||||
this.g = a;
|
||||
this.j = b;
|
||||
this.a = d;
|
||||
this.c = c;
|
||||
this.f = e || 3E3;
|
||||
this.h = f || void 0
|
||||
}
|
||||
P.prototype.start = function () {
|
||||
var a = this.c.s.document,
|
||||
b = this,
|
||||
c = q(),
|
||||
d = new Promise(function (d, e) {
|
||||
function f() {
|
||||
q() - c >= b.f ? e() : a.fonts.load(fa(b.a), b.h).then(function (a) {
|
||||
1 <= a.length ? d() : setTimeout(f, 25)
|
||||
}, function () {
|
||||
e()
|
||||
})
|
||||
}
|
||||
f()
|
||||
}),
|
||||
e = null,
|
||||
f = new Promise(function (a, d) {
|
||||
e = setTimeout(d, b.f)
|
||||
});
|
||||
Promise.race([f, d]).then(function () {
|
||||
e && (clearTimeout(e), e = null);
|
||||
b.g(b.a)
|
||||
}, function () {
|
||||
b.j(b.a)
|
||||
})
|
||||
};
|
||||
|
||||
function Q(a, b, c, d, e, f, g) {
|
||||
this.v = a;
|
||||
this.B = b;
|
||||
this.c = c;
|
||||
this.a = d;
|
||||
this.o = g || "BESbswy";
|
||||
this.f = {};
|
||||
this.w = e || 3E3;
|
||||
this.u = f || null;
|
||||
this.m = this.j = this.h = this.g = null;
|
||||
this.g = new M(this.c, this.o);
|
||||
this.h = new M(this.c, this.o);
|
||||
this.j = new M(this.c, this.o);
|
||||
this.m = new M(this.c, this.o);
|
||||
a = new G(this.a.c + ",serif", J(this.a));
|
||||
a = O(a);
|
||||
this.g.a.style.cssText = a;
|
||||
a = new G(this.a.c + ",sans-serif", J(this.a));
|
||||
a = O(a);
|
||||
this.h.a.style.cssText = a;
|
||||
a = new G("serif", J(this.a));
|
||||
a = O(a);
|
||||
this.j.a.style.cssText = a;
|
||||
a = new G("sans-serif", J(this.a));
|
||||
a =
|
||||
O(a);
|
||||
this.m.a.style.cssText = a;
|
||||
N(this.g);
|
||||
N(this.h);
|
||||
N(this.j);
|
||||
N(this.m)
|
||||
}
|
||||
var R = {
|
||||
D: "serif",
|
||||
C: "sans-serif"
|
||||
},
|
||||
S = null;
|
||||
|
||||
function T() {
|
||||
if (null === S) {
|
||||
var a = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgentData);
|
||||
S = !!a && (536 > parseInt(a[1], 10) || 536 === parseInt(a[1], 10) && 11 >= parseInt(a[2], 10))
|
||||
}
|
||||
return S
|
||||
}
|
||||
Q.prototype.start = function () {
|
||||
this.f.serif = this.j.a.offsetWidth;
|
||||
this.f["sans-serif"] = this.m.a.offsetWidth;
|
||||
this.A = q();
|
||||
U(this)
|
||||
};
|
||||
|
||||
function la(a, b, c) {
|
||||
for (var d in R)
|
||||
if (R.hasOwnProperty(d) && b === a.f[R[d]] && c === a.f[R[d]]) return !0;
|
||||
return !1
|
||||
}
|
||||
|
||||
function U(a) {
|
||||
var b = a.g.a.offsetWidth,
|
||||
c = a.h.a.offsetWidth,
|
||||
d;
|
||||
(d = b === a.f.serif && c === a.f["sans-serif"]) || (d = T() && la(a, b, c));
|
||||
d ? q() - a.A >= a.w ? T() && la(a, b, c) && (null === a.u || a.u.hasOwnProperty(a.a.c)) ? V(a, a.v) : V(a, a.B) : ma(a) : V(a, a.v)
|
||||
}
|
||||
|
||||
function ma(a) {
|
||||
setTimeout(p(function () {
|
||||
U(this)
|
||||
}, a), 50)
|
||||
}
|
||||
|
||||
function V(a, b) {
|
||||
setTimeout(p(function () {
|
||||
v(this.g.a);
|
||||
v(this.h.a);
|
||||
v(this.j.a);
|
||||
v(this.m.a);
|
||||
b(this.a)
|
||||
}, a), 0)
|
||||
};
|
||||
|
||||
function W(a, b, c) {
|
||||
this.c = a;
|
||||
this.a = b;
|
||||
this.f = 0;
|
||||
this.m = this.j = !1;
|
||||
this.o = c
|
||||
}
|
||||
var X = null;
|
||||
W.prototype.g = function (a) {
|
||||
var b = this.a;
|
||||
b.g && w(b.f, [b.a.c("wf", a.c, J(a).toString(), "active")], [b.a.c("wf", a.c, J(a).toString(), "loading"), b.a.c("wf", a.c, J(a).toString(), "inactive")]);
|
||||
K(b, "fontactive", a);
|
||||
this.m = !0;
|
||||
na(this)
|
||||
};
|
||||
W.prototype.h = function (a) {
|
||||
var b = this.a;
|
||||
if (b.g) {
|
||||
var c = y(b.f, b.a.c("wf", a.c, J(a).toString(), "active")),
|
||||
d = [],
|
||||
e = [b.a.c("wf", a.c, J(a).toString(), "loading")];
|
||||
c || d.push(b.a.c("wf", a.c, J(a).toString(), "inactive"));
|
||||
w(b.f, d, e)
|
||||
}
|
||||
K(b, "fontinactive", a);
|
||||
na(this)
|
||||
};
|
||||
|
||||
function na(a) {
|
||||
0 == --a.f && a.j && (a.m ? (a = a.a, a.g && w(a.f, [a.a.c("wf", "active")], [a.a.c("wf", "loading"), a.a.c("wf", "inactive")]), K(a, "active")) : L(a.a))
|
||||
};
|
||||
|
||||
function oa(a) {
|
||||
this.j = a;
|
||||
this.a = new ja;
|
||||
this.h = 0;
|
||||
this.f = this.g = !0
|
||||
}
|
||||
oa.prototype.load = function (a) {
|
||||
this.c = new ca(this.j, a.context || this.j);
|
||||
this.g = !1 !== a.events;
|
||||
this.f = !1 !== a.classes;
|
||||
pa(this, new ha(this.c, a), a)
|
||||
};
|
||||
|
||||
function qa(a, b, c, d, e) {
|
||||
var f = 0 == --a.h;
|
||||
(a.f || a.g) && setTimeout(function () {
|
||||
var a = e || null,
|
||||
m = d || null || {};
|
||||
if (0 === c.length && f) L(b.a);
|
||||
else {
|
||||
b.f += c.length;
|
||||
f && (b.j = f);
|
||||
var h, l = [];
|
||||
for (h = 0; h < c.length; h++) {
|
||||
var k = c[h],
|
||||
n = m[k.c],
|
||||
r = b.a,
|
||||
x = k;
|
||||
r.g && w(r.f, [r.a.c("wf", x.c, J(x).toString(), "loading")]);
|
||||
K(r, "fontloading", x);
|
||||
r = null;
|
||||
if (null === X)
|
||||
if (window.FontFace) {
|
||||
var x = /Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgentData),
|
||||
xa = /OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgentData) && /Apple/.exec(window.navigator.vendor);
|
||||
X = x ? 42 < parseInt(x[1], 10) : xa ? !1 : !0
|
||||
} else X = !1;
|
||||
X ? r = new P(p(b.g, b), p(b.h, b), b.c, k, b.o, n) : r = new Q(p(b.g, b), p(b.h, b), b.c, k, b.o, a, n);
|
||||
l.push(r)
|
||||
}
|
||||
for (h = 0; h < l.length; h++) l[h].start()
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
|
||||
function pa(a, b, c) {
|
||||
var d = [],
|
||||
e = c.timeout;
|
||||
ia(b);
|
||||
var d = ka(a.a, c, a.c),
|
||||
f = new W(a.c, b, e);
|
||||
a.h = d.length;
|
||||
b = 0;
|
||||
for (c = d.length; b < c; b++) d[b].load(function (b, d, c) {
|
||||
qa(a, f, b, d, c)
|
||||
})
|
||||
};
|
||||
|
||||
function ra(a, b) {
|
||||
this.c = a;
|
||||
this.a = b
|
||||
}
|
||||
ra.prototype.load = function (a) {
|
||||
function b() {
|
||||
if (f["__mti_fntLst" + d]) {
|
||||
var c = f["__mti_fntLst" + d](),
|
||||
e = [],
|
||||
h;
|
||||
if (c)
|
||||
for (var l = 0; l < c.length; l++) {
|
||||
var k = c[l].fontfamily;
|
||||
void 0 != c[l].fontStyle && void 0 != c[l].fontWeight ? (h = c[l].fontStyle + c[l].fontWeight, e.push(new G(k, h))) : e.push(new G(k))
|
||||
}
|
||||
a(e)
|
||||
} else setTimeout(function () {
|
||||
b()
|
||||
}, 50)
|
||||
}
|
||||
var c = this,
|
||||
d = c.a.projectId,
|
||||
e = c.a.version;
|
||||
if (d) {
|
||||
var f = c.c.s;
|
||||
A(this.c, (c.a.api || "https://fast.fonts.net/jsapi") + "/" + d + ".js" + (e ? "?v=" + e : ""), function (e) {
|
||||
e ? a([]) : (f["__MonotypeConfiguration__" +
|
||||
d] = function () {
|
||||
return c.a
|
||||
}, b())
|
||||
}).id = "__MonotypeAPIScript__" + d
|
||||
} else a([])
|
||||
};
|
||||
|
||||
function sa(a, b) {
|
||||
this.c = a;
|
||||
this.a = b
|
||||
}
|
||||
sa.prototype.load = function (a) {
|
||||
var b, c, d = this.a.urls || [],
|
||||
e = this.a.families || [],
|
||||
f = this.a.testStrings || {},
|
||||
g = new B;
|
||||
b = 0;
|
||||
for (c = d.length; b < c; b++) z(this.c, d[b], C(g));
|
||||
var m = [];
|
||||
b = 0;
|
||||
for (c = e.length; b < c; b++)
|
||||
if (d = e[b].split(":"), d[1])
|
||||
for (var h = d[1].split(","), l = 0; l < h.length; l += 1) m.push(new G(d[0], h[l]));
|
||||
else m.push(new G(d[0]));
|
||||
E(g, function () {
|
||||
a(m, f)
|
||||
})
|
||||
};
|
||||
|
||||
function ta(a, b, c, d, e) {
|
||||
this.o = 2 === e ? 2 : 1;
|
||||
e = ua[this.o - 1];
|
||||
a ? this.c = a : this.c = e[0];
|
||||
this.m = e[1];
|
||||
this.a = [];
|
||||
this.f = [];
|
||||
this.j = b || "";
|
||||
this.g = c || "";
|
||||
this.h = d || ""
|
||||
}
|
||||
var ua = [
|
||||
["https://fonts.googleapis.com/css", "%7C"],
|
||||
["https://fonts.googleapis.com/css2", "&family="]
|
||||
];
|
||||
|
||||
function va(a, b) {
|
||||
for (var c = b.length, d = 0; d < c; d++) {
|
||||
var e = b[d].split(":");
|
||||
3 == e.length && a.f.push(e.pop());
|
||||
var f = "";
|
||||
2 == e.length && "" != e[1] && (f = ":");
|
||||
a.a.push(e.join(f))
|
||||
}
|
||||
}
|
||||
|
||||
function wa(a) {
|
||||
if (0 == a.a.length) throw Error("No fonts to load!");
|
||||
if (-1 != a.c.indexOf("kit=")) return a.c;
|
||||
for (var b = a.a.length, c = [], d = 0; d < b; d++) c.push(a.a[d].replace(/ /g, "+"));
|
||||
b = a.c + "?family=" + c.join(a.m);
|
||||
0 < a.f.length && (b += "&subset=" + a.f.join(","));
|
||||
0 < a.j.length && (b += "&text=" + encodeURIComponent(a.j));
|
||||
0 < a.g.length && (b += "&display=" + encodeURIComponent(a.g));
|
||||
0 < a.h.length && (b += "&effect=" + encodeURIComponent(a.h));
|
||||
return b
|
||||
};
|
||||
|
||||
function ya(a) {
|
||||
this.f = a;
|
||||
this.a = [];
|
||||
this.c = {}
|
||||
}
|
||||
var za = {
|
||||
latin: "BESbswy",
|
||||
"latin-ext": "\u00e7\u00f6\u00fc\u011f\u015f",
|
||||
cyrillic: "\u0439\u044f\u0416",
|
||||
greek: "\u03b1\u03b2\u03a3",
|
||||
khmer: "\u1780\u1781\u1782",
|
||||
Hanuman: "\u1780\u1781\u1782"
|
||||
},
|
||||
Aa = {
|
||||
thin: "1",
|
||||
extralight: "2",
|
||||
"extra-light": "2",
|
||||
ultralight: "2",
|
||||
"ultra-light": "2",
|
||||
light: "3",
|
||||
regular: "4",
|
||||
book: "4",
|
||||
medium: "5",
|
||||
"semi-bold": "6",
|
||||
semibold: "6",
|
||||
"demi-bold": "6",
|
||||
demibold: "6",
|
||||
bold: "7",
|
||||
"extra-bold": "8",
|
||||
extrabold: "8",
|
||||
"ultra-bold": "8",
|
||||
ultrabold: "8",
|
||||
black: "9",
|
||||
heavy: "9",
|
||||
l: "3",
|
||||
r: "4",
|
||||
b: "7"
|
||||
},
|
||||
Ba = {
|
||||
i: "i",
|
||||
italic: "i",
|
||||
n: "n",
|
||||
normal: "n"
|
||||
},
|
||||
Ca = /^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
|
||||
|
||||
function Da(a) {
|
||||
for (var b = a.f.length, c = 0; c < b; c++) {
|
||||
var d = a.f[c].split(":"),
|
||||
e = d[0].replace(/\+/g, " "),
|
||||
f = ["n4"];
|
||||
if (2 <= d.length) {
|
||||
var g;
|
||||
var m = d[1];
|
||||
g = [];
|
||||
if (m)
|
||||
for (var m = m.split(","), h = m.length, l = 0; l < h; l++) {
|
||||
var k;
|
||||
k = m[l];
|
||||
if (k.match(/^[\w-]+$/)) {
|
||||
var n = Ca.exec(k.toLowerCase());
|
||||
if (null == n) k = "";
|
||||
else {
|
||||
k = n[2];
|
||||
k = null == k || "" == k ? "n" : Ba[k];
|
||||
n = n[1];
|
||||
if (null == n || "" == n) n = "4";
|
||||
else var r = Aa[n],
|
||||
n = r ? r : isNaN(n) ? "4" : n.substr(0, 1);
|
||||
k = [k, n].join("")
|
||||
}
|
||||
} else k = "";
|
||||
k && g.push(k)
|
||||
}
|
||||
0 < g.length && (f = g);
|
||||
3 == d.length && (d = d[2], g = [], d = d ? d.split(",") :
|
||||
g, 0 < d.length && (d = za[d[0]]) && (a.c[e] = d))
|
||||
}
|
||||
a.c[e] || (d = za[e]) && (a.c[e] = d);
|
||||
for (d = 0; d < f.length; d += 1) a.a.push(new G(e, f[d]))
|
||||
}
|
||||
};
|
||||
|
||||
function Ea(a, b) {
|
||||
this.c = a;
|
||||
this.a = b
|
||||
}
|
||||
var Fa = {
|
||||
Arimo: !0,
|
||||
Cousine: !0,
|
||||
Tinos: !0
|
||||
};
|
||||
Ea.prototype.load = function (a) {
|
||||
var b = new B,
|
||||
c = this.c,
|
||||
d = new ta(this.a.api, this.a.text, this.a.display, this.a.effect, this.a.version),
|
||||
e = this.a.families;
|
||||
va(d, e);
|
||||
var f = new ya(e);
|
||||
Da(f);
|
||||
z(c, wa(d), C(b));
|
||||
E(b, function () {
|
||||
a(f.a, f.c, Fa)
|
||||
})
|
||||
};
|
||||
|
||||
function Ga(a, b) {
|
||||
this.c = a;
|
||||
this.a = b
|
||||
}
|
||||
Ga.prototype.load = function (a) {
|
||||
var b = this.a.id,
|
||||
c = this.c.s;
|
||||
b ? A(this.c, (this.a.api || "https://use.typekit.net") + "/" + b + ".js", function (b) {
|
||||
if (b) a([]);
|
||||
else if (c.Typekit && c.Typekit.config && c.Typekit.config.fn) {
|
||||
b = c.Typekit.config.fn;
|
||||
for (var e = [], f = 0; f < b.length; f += 2)
|
||||
for (var g = b[f], m = b[f + 1], h = 0; h < m.length; h++) e.push(new G(g, m[h]));
|
||||
try {
|
||||
c.Typekit.load({
|
||||
events: !1,
|
||||
classes: !1,
|
||||
async: !0
|
||||
})
|
||||
} catch (l) {}
|
||||
a(e)
|
||||
}
|
||||
}, 2E3) : a([])
|
||||
};
|
||||
|
||||
function Ha(a, b) {
|
||||
this.c = a;
|
||||
this.f = b;
|
||||
this.a = []
|
||||
}
|
||||
Ha.prototype.load = function (a) {
|
||||
var b = this.f.id,
|
||||
c = this.c.s,
|
||||
d = this;
|
||||
b ? (c.__webfontfontdeckmodule__ || (c.__webfontfontdeckmodule__ = {}), c.__webfontfontdeckmodule__[b] = function (b, c) {
|
||||
for (var g = 0, m = c.fonts.length; g < m; ++g) {
|
||||
var h = c.fonts[g];
|
||||
d.a.push(new G(h.name, ga("font-weight:" + h.weight + ";font-style:" + h.style)))
|
||||
}
|
||||
a(d.a)
|
||||
}, A(this.c, (this.f.api || "https://f.fontdeck.com/s/css/js/") + ea(this.c) + "/" + b + ".js", function (b) {
|
||||
b && a([])
|
||||
})) : a([])
|
||||
};
|
||||
var Y = new oa(window);
|
||||
Y.a.c.custom = function (a, b) {
|
||||
return new sa(b, a)
|
||||
};
|
||||
Y.a.c.fontdeck = function (a, b) {
|
||||
return new Ha(b, a)
|
||||
};
|
||||
Y.a.c.monotype = function (a, b) {
|
||||
return new ra(b, a)
|
||||
};
|
||||
Y.a.c.typekit = function (a, b) {
|
||||
return new Ga(b, a)
|
||||
};
|
||||
Y.a.c.google = function (a, b) {
|
||||
return new Ea(b, a)
|
||||
};
|
||||
var Z = {
|
||||
load: p(Y.load, Y)
|
||||
};
|
||||
"function" === typeof define && define.amd ? define(function () {
|
||||
return Z
|
||||
}) : "undefined" !== typeof module && module.exports ? module.exports = Z : (window.WebFont = Z, window.WebFontConfig && Y.load(window.WebFontConfig));
|
||||
}());
|
||||
71
themes/godocs-1/assets/scss/_buttons.scss
Normal file
71
themes/godocs-1/assets/scss/_buttons.scss
Normal file
@@ -0,0 +1,71 @@
|
||||
/* Button style */
|
||||
.btn {
|
||||
font-size: 16px;
|
||||
font-family: $font-secondary;
|
||||
padding: 13px 30px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
transition: .2s ease;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover,
|
||||
&:active,
|
||||
&:focus {
|
||||
outline: 0;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
&-sm{
|
||||
font-size: 14px;
|
||||
padding: 10px 25px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: $color-primary;
|
||||
color: $white;
|
||||
border-color: $color-primary;
|
||||
|
||||
&:active,
|
||||
&:hover,
|
||||
&:focus,
|
||||
&.focus,
|
||||
&.active {
|
||||
background: darken($color: $color-primary, $amount: 10) !important;
|
||||
border-color: darken($color: $color-primary, $amount: 10) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-white {
|
||||
margin-top:16px;
|
||||
background: $white;
|
||||
color: $color-primary;
|
||||
border-color: $white;
|
||||
|
||||
&:active,
|
||||
&:hover,
|
||||
&:focus,
|
||||
&.focus,
|
||||
&.active {
|
||||
background: #fafafa;
|
||||
border-color: $color-primary;
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-outline-primary {
|
||||
background: transparent;
|
||||
color: $color-primary;
|
||||
border-color: $color-primary;
|
||||
|
||||
&:active,
|
||||
&:hover,
|
||||
&:focus,
|
||||
&.focus,
|
||||
&.active {
|
||||
background: $color-primary !important;
|
||||
border-color: $color-primary !important;
|
||||
color: $white;
|
||||
}
|
||||
}
|
||||
411
themes/godocs-1/assets/scss/_common.scss
Normal file
411
themes/godocs-1/assets/scss/_common.scss
Normal file
@@ -0,0 +1,411 @@
|
||||
body {
|
||||
background-color: $body-bg;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: lighten($color: $color-primary, $amount: 10);
|
||||
color: $white;
|
||||
}
|
||||
|
||||
/* preloader */
|
||||
|
||||
.preloader {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #fff;
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a,
|
||||
a:hover,
|
||||
a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a,
|
||||
button,
|
||||
select {
|
||||
cursor: pointer;
|
||||
transition: .2s ease;
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: $color-primary;
|
||||
}
|
||||
|
||||
.slick-slide {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.section {
|
||||
padding-top: 80px;
|
||||
padding-bottom: 80px;
|
||||
|
||||
&-sm {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
&-title {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-cover {
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.border-default {
|
||||
border-color: $border-color !important;
|
||||
}
|
||||
|
||||
/* overlay */
|
||||
|
||||
.overlay {
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: $black;
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
|
||||
.outline-0 {
|
||||
outline: 0 !important;
|
||||
}
|
||||
|
||||
.rounded {
|
||||
border-radius: 12px !important;
|
||||
}
|
||||
|
||||
.shadow {
|
||||
box-shadow: 0px 15px 60px rgba(62, 62, 62, 0.102) !important;
|
||||
}
|
||||
|
||||
.d-unset {
|
||||
display: unset !important;
|
||||
}
|
||||
|
||||
.bg-primary {
|
||||
background: $color-primary !important;
|
||||
}
|
||||
|
||||
.text-primary {
|
||||
color: $color-primary !important;
|
||||
}
|
||||
|
||||
.text-light {
|
||||
color: $text-light !important;
|
||||
}
|
||||
|
||||
.fw-medium {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// Arrow Icon
|
||||
.nav-next,
|
||||
.nav-prev {
|
||||
span {
|
||||
font-size: 18px;
|
||||
|
||||
@include desktop {
|
||||
font-size:16px;
|
||||
}
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
line-height: 28px !important;
|
||||
transition: transform 0.4s;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-prev {
|
||||
&:hover i {
|
||||
transform: translateX(-3px);
|
||||
}
|
||||
|
||||
i {
|
||||
margin-left: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-next {
|
||||
&:hover i {
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
i {
|
||||
margin-right: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.glightbox:hover {
|
||||
cursor: pointer;
|
||||
opacity: .9;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.glightbox-clean .gslide-title {
|
||||
text-align: center;
|
||||
margin-bottom: 0 !important;
|
||||
font-style: italic;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.glightbox-clean .gdesc-inner {
|
||||
padding: 14px 20px !important;
|
||||
}
|
||||
|
||||
// Tooltip
|
||||
.tooltip-word {
|
||||
position: relative;
|
||||
cursor: help;
|
||||
border-bottom: 1px dotted currentColor;
|
||||
}
|
||||
|
||||
.tooltip-word::after {
|
||||
content: attr(data-tooltip);
|
||||
position: absolute;
|
||||
z-index: 50;
|
||||
|
||||
bottom: calc(100% + 0.4rem);
|
||||
left: 50%;
|
||||
transform: translate(-50%, 4px);
|
||||
|
||||
display: inline-block;
|
||||
padding: 0.45rem 0.6rem;
|
||||
background: #207495;
|
||||
color: #fff;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
line-height: 1.4;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
|
||||
|
||||
width: max-content;
|
||||
max-width: 260px;
|
||||
white-space: normal !important;
|
||||
word-break: normal !important;
|
||||
overflow-wrap: break-word;
|
||||
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.18s ease, transform 0.18s ease;
|
||||
}
|
||||
|
||||
.tooltip-word:hover::after,
|
||||
.tooltip-word:focus::after {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
@media (max-width: 575px) {
|
||||
.tooltip-word::after {
|
||||
position: fixed;
|
||||
bottom: 1.5rem;
|
||||
top: auto;
|
||||
padding:20px;
|
||||
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0 .75rem;
|
||||
|
||||
width: auto;
|
||||
max-width: none;
|
||||
transform: none;
|
||||
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
white-space: normal;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.tooltip-word:hover::after,
|
||||
.tooltip-word:focus::after {
|
||||
transform: none; // animatie alleen in Y is nu niet meer nodig
|
||||
}
|
||||
}
|
||||
|
||||
$note-color: #293df2;
|
||||
$abstract-color: #0ca68c;
|
||||
$info-color: #759E4C;
|
||||
$todo-color: #8d05a8;
|
||||
$tip-color: #19cfb0;
|
||||
$success-color: #04d904;
|
||||
$question-color: #e38902;
|
||||
$warning-color: #e38902;
|
||||
$danger-color: #e31a00;
|
||||
$failure-color: #e31a00;
|
||||
$bug-color: #e31a00;
|
||||
$example-color: #b83acf;
|
||||
$quote-color: #918e91;
|
||||
|
||||
.notice {
|
||||
margin-bottom: 1.5rem;
|
||||
border: 2px solid;
|
||||
padding: 1.5rem;
|
||||
border-color: currentColor;
|
||||
border-radius: 12px;;
|
||||
}
|
||||
|
||||
.notice-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.notice-head svg {
|
||||
margin-right: 0.75rem;
|
||||
}
|
||||
|
||||
.notice-head p {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.notice-body {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.notice-body p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.notice.note {
|
||||
color: $note-color;
|
||||
background-color: rgba($note-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.abstract {
|
||||
color: $abstract-color;
|
||||
background-color: rgba($abstract-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.info {
|
||||
color: $color-primary;
|
||||
background-color: rgba($info-color, 0.05);
|
||||
}
|
||||
|
||||
.notice.todo {
|
||||
color: $todo-color;
|
||||
background-color: rgba($todo-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.tip {
|
||||
color: $tip-color;
|
||||
background-color: rgba($tip-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.success {
|
||||
color: $success-color;
|
||||
background-color: rgba($success-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.question {
|
||||
color: $question-color;
|
||||
background-color: rgba($question-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.warning {
|
||||
color: $warning-color;
|
||||
background-color: rgba($warning-color, 0.05);
|
||||
}
|
||||
|
||||
.notice.failure {
|
||||
color: $failure-color;
|
||||
background-color: rgba($failure-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.danger {
|
||||
color: $danger-color;
|
||||
background-color: rgba($danger-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.bug {
|
||||
color: $bug-color;
|
||||
background-color: rgba($bug-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.example {
|
||||
color: $example-color;
|
||||
background-color: rgba($example-color, 0.15);
|
||||
}
|
||||
|
||||
.notice.quote {
|
||||
color: $quote-color;
|
||||
background-color: rgba($quote-color, 0.15);
|
||||
}
|
||||
// darkmode
|
||||
.dark .notice-head p {
|
||||
color: #d1d5db;
|
||||
}
|
||||
|
||||
.color-positive {
|
||||
color:#759E4C;
|
||||
}
|
||||
|
||||
.color-warning {
|
||||
color: $warning-color;
|
||||
}
|
||||
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.img-flag {
|
||||
max-height: 48px;
|
||||
vertical-align: top;
|
||||
display: inline-flex;
|
||||
border-radius: 4px;
|
||||
border: 1px solid $white;
|
||||
box-shadow: 2px 2px 12px rgba(62,62,62,.3) !important;
|
||||
}
|
||||
29
themes/godocs-1/assets/scss/_mixins.scss
Normal file
29
themes/godocs-1/assets/scss/_mixins.scss
Normal file
@@ -0,0 +1,29 @@
|
||||
@mixin mobile-xs{
|
||||
@media(max-width:400px){
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin mobile{
|
||||
@media(max-width:575px){
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin tablet{
|
||||
@media(max-width:767px){
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin desktop{
|
||||
@media(max-width:991px){
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@mixin desktop-lg{
|
||||
@media(max-width:1200px){
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin size($size){
|
||||
width: $size; height: $size;
|
||||
}
|
||||
89
themes/godocs-1/assets/scss/_typography.scss
Normal file
89
themes/godocs-1/assets/scss/_typography.scss
Normal file
@@ -0,0 +1,89 @@
|
||||
/* typography */
|
||||
body {
|
||||
font-family: $font-primary;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-size: $font-size;
|
||||
line-height: 1.6;
|
||||
color: $text-color;
|
||||
}
|
||||
|
||||
p,
|
||||
.paragraph {
|
||||
font-weight: 400;
|
||||
color: $text-color;
|
||||
line-height: 26px;
|
||||
font-family: $font-primary;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
color: $text-dark;
|
||||
font-family: $font-secondary;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.content h1,
|
||||
.content h2,
|
||||
.content h3,
|
||||
.content h4,
|
||||
.content h5,
|
||||
.content h6 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
h1,
|
||||
.h1 {
|
||||
font-size: 40px;
|
||||
|
||||
@include mobile {
|
||||
font-size: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
h2,
|
||||
.h2 {
|
||||
font-size: 32px;
|
||||
|
||||
@include mobile {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
h3,
|
||||
.h3 {
|
||||
font-size: 28px;
|
||||
|
||||
@include mobile {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
h4,
|
||||
.h4 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
h5,
|
||||
.h5 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h6,
|
||||
.h6 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.fa-xs {
|
||||
font-size: 0.8em !important;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
.font-small {
|
||||
font-size: 0.8em;
|
||||
font-style: italic;
|
||||
color: lighten($color: $text-color, $amount: 30);
|
||||
}
|
||||
31
themes/godocs-1/assets/scss/style.scss
Normal file
31
themes/godocs-1/assets/scss/style.scss
Normal file
@@ -0,0 +1,31 @@
|
||||
{{ with site.Params.variables }}
|
||||
// Color variables
|
||||
$color-primary: {{.color_primary}};
|
||||
$text-color: {{.text_color}};
|
||||
$text-dark: {{.text_dark}};
|
||||
$text-light: {{.text_light}};
|
||||
$body-bg: {{.body_color}};
|
||||
$border-color: {{.border_color}};
|
||||
$black: {{.black}};
|
||||
$white: {{.white}};
|
||||
$light: {{.light}};
|
||||
|
||||
// Font Variables
|
||||
$font-size: {{.font_size}};
|
||||
$font-primary: '{{ replaceRE ":wght@[0-9;]+" "" .font_primary }}', {{.font_primary_type}};
|
||||
$font-secondary: '{{ replaceRE ":wght@[0-9;]+" "" .font_secondary }}', {{.font_secondary_type}};
|
||||
$icon-font: '{{.font_icon}}';
|
||||
{{ end }}
|
||||
|
||||
@import 'templates/bootstrap';
|
||||
@import 'mixins';
|
||||
@import 'typography';
|
||||
@import 'buttons';
|
||||
@import 'common';
|
||||
@import 'templates/navigation.scss';
|
||||
@import 'templates/main.scss';
|
||||
@import 'templates/search-modal';
|
||||
@import 'gallery';
|
||||
@import 'tabs';
|
||||
//@import 'notice';
|
||||
@import 'collapse';
|
||||
53
themes/godocs-1/assets/scss/templates/_bootstrap.scss
Normal file
53
themes/godocs-1/assets/scss/templates/_bootstrap.scss
Normal file
@@ -0,0 +1,53 @@
|
||||
// Bootstrap 5.3.0
|
||||
|
||||
@import "../bootstrap/mixins/banner";
|
||||
@include bsBanner("");
|
||||
|
||||
// scss-docs-start import-stack
|
||||
// Configuration
|
||||
@import "../bootstrap/functions";
|
||||
@import "../bootstrap/variables";
|
||||
@import "../bootstrap/variables-dark";
|
||||
@import "../bootstrap/maps";
|
||||
@import "../bootstrap/mixins";
|
||||
@import "../bootstrap/utilities";
|
||||
|
||||
// Layout & components
|
||||
@import "../bootstrap/root";
|
||||
@import "../bootstrap/reboot";
|
||||
@import "../bootstrap/type";
|
||||
@import "../bootstrap/images";
|
||||
@import "../bootstrap/containers";
|
||||
@import "../bootstrap/grid";
|
||||
@import "../bootstrap/tables";
|
||||
@import "../bootstrap/forms";
|
||||
@import "../bootstrap/buttons";
|
||||
@import "../bootstrap/transitions";
|
||||
@import "../bootstrap/dropdown";
|
||||
// @import "../bootstrap/button-group";
|
||||
@import "../bootstrap/nav";
|
||||
@import "../bootstrap/navbar";
|
||||
@import "../bootstrap/card";
|
||||
@import "../bootstrap/accordion";
|
||||
@import "../bootstrap/breadcrumb";
|
||||
@import "../bootstrap/pagination";
|
||||
@import "../bootstrap/badge";
|
||||
// @import "../bootstrap/alert";
|
||||
// @import "../bootstrap/progress";
|
||||
@import "../bootstrap/list-group";
|
||||
// @import "../bootstrap/close";
|
||||
// @import "../bootstrap/toasts";
|
||||
@import "../bootstrap/modal";
|
||||
// @import "../bootstrap/tooltip";
|
||||
// @import "../bootstrap/popover";
|
||||
// @import "../bootstrap/carousel";
|
||||
// @import "../bootstrap/spinners";
|
||||
// @import "../bootstrap/offcanvas";
|
||||
// @import "../bootstrap/placeholders";
|
||||
|
||||
// Helpers
|
||||
@import "../bootstrap/helpers";
|
||||
|
||||
// Utilities
|
||||
@import "../bootstrap/utilities/api";
|
||||
// scss-docs-end import-stack
|
||||
569
themes/godocs-1/assets/scss/templates/_main.scss
Normal file
569
themes/godocs-1/assets/scss/templates/_main.scss
Normal file
@@ -0,0 +1,569 @@
|
||||
.search-wrapper {
|
||||
position: relative;
|
||||
cursor: text;
|
||||
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
left: 15px;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
height: 54px;
|
||||
border: 1px solid $border-color;
|
||||
padding-left: 40px !important;
|
||||
border-radius: 5px;
|
||||
width: 320px;
|
||||
@extend .shadow;
|
||||
|
||||
@include mobile {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
&-sm {
|
||||
height: 45px;
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: $text-light;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-button {
|
||||
border: 1px solid $border-color;
|
||||
color: $text-light;
|
||||
background-color: transparent;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-radius: 4px;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.card {
|
||||
@extend .shadow;
|
||||
@extend .rounded;
|
||||
transition: .2s ease;
|
||||
border: 0;
|
||||
|
||||
&-lg {
|
||||
.card-body {
|
||||
padding: 35px;
|
||||
}
|
||||
}
|
||||
|
||||
i {
|
||||
color: $color-primary;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 22px;
|
||||
@extend .rounded;
|
||||
}
|
||||
|
||||
&-text {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&-body {
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0px 15px 60px rgba(62, 62, 62, 0.2) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.social-icons {
|
||||
margin-bottom: 0;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
height: 42px;
|
||||
width: 42px;
|
||||
line-height: 42px;
|
||||
text-align: center;
|
||||
color: $white;
|
||||
background: $color-primary;
|
||||
border-radius: 6px;
|
||||
|
||||
&:hover {
|
||||
background: darken($color: $color-primary, $amount: 10) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer-menu {
|
||||
margin-bottom: 0;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
padding: 10px;
|
||||
color: $text-color;
|
||||
transition: .2s ease;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* sidenav */
|
||||
.sidenav {
|
||||
border-right: 1px solid $border-color;
|
||||
padding-right: 20px;
|
||||
|
||||
@include mobile {
|
||||
border: none;
|
||||
border-top: 1px solid $border-color;
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
&>li {
|
||||
a {
|
||||
padding: 20px 0;
|
||||
color: $text-dark;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1px solid $border-color;
|
||||
}
|
||||
}
|
||||
|
||||
.sidelist {
|
||||
ul {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.parent {
|
||||
&>a {
|
||||
color: $color-primary !important;
|
||||
position: relative;
|
||||
margin-left: 10px;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -10px;
|
||||
top: 25%;
|
||||
height: 50%;
|
||||
width: 1px;
|
||||
background: $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
|
||||
a {
|
||||
padding: 5px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: $text-dark;
|
||||
}
|
||||
|
||||
li.active>a {
|
||||
margin-left: 10px;
|
||||
|
||||
&::before {
|
||||
height: 5px;
|
||||
width: 5px;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
top: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* /sidenav */
|
||||
|
||||
|
||||
.page-list {
|
||||
list-style-type: none;
|
||||
|
||||
a {
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
padding: 7px 0;
|
||||
font-size: 20px;
|
||||
color: $text-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top: 50px;
|
||||
justify-content: space-between;
|
||||
|
||||
a {
|
||||
color: $color-primary;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
i {
|
||||
line-height: 1.7;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
// copy to clipboard
|
||||
.highlight {
|
||||
position: relative;
|
||||
|
||||
.copy-to-clipboard {
|
||||
background: $color-primary;
|
||||
color: $white;
|
||||
cursor: pointer;
|
||||
padding: 4px 5px;
|
||||
line-height: 1;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
:not(pre)>code+span.copy-to-clipboard {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// autocomplete
|
||||
.autocomplete-suggestions {
|
||||
border: 0;
|
||||
border-radius: 0 0 6px 6px;
|
||||
box-shadow: 0px 50px 60px rgba(62, 62, 62, 0.102) !important;
|
||||
background: $white;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
|
||||
&-track {
|
||||
background: $light;
|
||||
}
|
||||
|
||||
&-thumb {
|
||||
background: $border-color;
|
||||
}
|
||||
}
|
||||
|
||||
.autocomplete-suggestion {
|
||||
transition: .2s ease;
|
||||
padding: 10px;
|
||||
font-weight: 500;
|
||||
|
||||
&.selected {
|
||||
background: $color-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-item {
|
||||
a {
|
||||
color: $text-dark;
|
||||
display: block;
|
||||
|
||||
&:hover {
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1px solid $border-color;
|
||||
}
|
||||
}
|
||||
|
||||
.form-group {
|
||||
label {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid $border-color;
|
||||
border-radius: 0;
|
||||
padding: 10px 0;
|
||||
color: $text-dark;
|
||||
|
||||
&::placeholder {
|
||||
font-size: 16px;
|
||||
color: $text-light;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
border-color: $color-primary;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.form-select {
|
||||
font-size: 16px;
|
||||
color: rgba($text-dark, .8);
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba(34,34,34,.5)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
|
||||
background-position: right center;
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
border-color: $color-primary;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
option:checked {
|
||||
font-size: 36px !important;
|
||||
}
|
||||
}
|
||||
|
||||
textarea.form-control {
|
||||
height: 100px;
|
||||
resize: none;
|
||||
}
|
||||
}
|
||||
|
||||
.badge {
|
||||
margin-bottom: 20px;
|
||||
font-weight: 500;
|
||||
font-size: 15px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
width: fit-content;
|
||||
|
||||
&.added {
|
||||
background: #3778FF;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.fixed {
|
||||
background: #F54773;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.changed {
|
||||
background: #3AAA55;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.depricated {
|
||||
background: #343434;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.removed {
|
||||
background: #3bbfe4;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.security {
|
||||
background: #F53535;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
&.unreleased {
|
||||
background: #A037FF;
|
||||
color: $white;
|
||||
}
|
||||
}
|
||||
|
||||
:not(.highlight) pre {
|
||||
background: $light;
|
||||
}
|
||||
|
||||
// content style
|
||||
.content {
|
||||
span[style="color:#585b70;font-style:italic"] {
|
||||
color: #7f818c !important;
|
||||
}
|
||||
|
||||
&>img {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
* {
|
||||
word-break: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: underline;
|
||||
color: $color-primary;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
padding-left: 20px;
|
||||
margin-left:20px;
|
||||
|
||||
li {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 0;
|
||||
margin-bottom: 20px;
|
||||
|
||||
li {
|
||||
padding-left: 20px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
border-radius: 50%;
|
||||
background: lighten($color: $text-color, $amount: 20);
|
||||
left: 3px;
|
||||
top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #EEEEEE;
|
||||
border-radius: 5px;
|
||||
border-spacing: 0;
|
||||
border-collapse: separate;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
table td,
|
||||
table th {
|
||||
padding: .75rem;
|
||||
vertical-align: top;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
tr:not(:last-child) {
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
}
|
||||
|
||||
th {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
thead {
|
||||
background: $light;
|
||||
margin-bottom: 0;
|
||||
|
||||
tr {
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
}
|
||||
}
|
||||
|
||||
tbody {
|
||||
background: #fff;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-size: 20px !important;
|
||||
color: $text-dark;
|
||||
padding: 20px 30px;
|
||||
border-left: 2px solid $color-primary;
|
||||
margin: 40px 0;
|
||||
font-weight: bold;
|
||||
background: $light;
|
||||
|
||||
p {
|
||||
color: rgba($text-dark, 0.8);
|
||||
font-size: 18px !important;
|
||||
margin-bottom: 0 !important;
|
||||
line-height: 1.7;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
display: block;
|
||||
padding: 15px 20px !important;
|
||||
margin: 10px 0 30px 0 !important;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
code {
|
||||
margin-bottom: 0 !important;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
iframe {
|
||||
display: block;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.accordion-body {
|
||||
color: $black;
|
||||
|
||||
*:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-nav-button {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.content .tab-nav-button {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[data-tab-item] {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
blockquote,
|
||||
.notices {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
code {
|
||||
color:$color-primary;
|
||||
font-weight: 500;
|
||||
}
|
||||
115
themes/godocs-1/assets/scss/templates/_navigation.scss
Normal file
115
themes/godocs-1/assets/scss/templates/_navigation.scss
Normal file
@@ -0,0 +1,115 @@
|
||||
.navigation {
|
||||
transition: .2s ease;
|
||||
|
||||
&.nav-bg {
|
||||
background: $white;
|
||||
@extend .shadow;
|
||||
|
||||
@include desktop {
|
||||
top: -50px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-inline button {
|
||||
transition: 0s;
|
||||
}
|
||||
|
||||
@include desktop {
|
||||
.form-inline {
|
||||
cursor: pointer;
|
||||
margin: 0 10px 0 auto !important;
|
||||
|
||||
button {
|
||||
padding: 10px;
|
||||
position: static;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
width: 30px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
i {
|
||||
color: $text-dark;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.fa-xmark {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fa-bars {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&[aria-expanded="true"] {
|
||||
i {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fa-xmark {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
margin: 0;
|
||||
|
||||
.nav-link {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-light .navbar-nav .nav-link {
|
||||
color: $text-dark;
|
||||
|
||||
&:hover {
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-expand-lg .navbar-nav .nav-link {
|
||||
padding: 20px;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
|
||||
@include desktop {
|
||||
padding: 10px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
#select-language {
|
||||
border: 1px solid $border-color;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.nav-tabs,
|
||||
.nav-tabs > li {
|
||||
list-style: none !important;
|
||||
}
|
||||
|
||||
.nav.nav-tabs .nav-item::before,
|
||||
.nav.nav-pills .nav-item::before {
|
||||
content: none !important;
|
||||
}
|
||||
|
||||
.nav-link,
|
||||
.nav-link:hover {
|
||||
color:#484848;
|
||||
}
|
||||
|
||||
.nav-pills-custom {
|
||||
--bs-nav-tabs-link-active-color: #ffffff;
|
||||
--bs-nav-tabs-link-active-bg: #759E4C;
|
||||
}
|
||||
106
themes/godocs-1/assets/scss/templates/search-modal.scss
Normal file
106
themes/godocs-1/assets/scss/templates/search-modal.scss
Normal file
@@ -0,0 +1,106 @@
|
||||
// search-modal
|
||||
.search-modal-dialog {
|
||||
margin-top: 150px;
|
||||
max-width: 600px;
|
||||
@include desktop {
|
||||
margin-top: 80px;
|
||||
}
|
||||
}
|
||||
.search-modal {
|
||||
.input-group-text,
|
||||
.search-form-control {
|
||||
border: 2px solid rgba($color-primary, 0.5);
|
||||
}
|
||||
.search-form-control {
|
||||
padding-right: 15px;
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.modal-body {
|
||||
max-height: calc(100vh - 350px);
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
background-color: #f5f6f7;
|
||||
box-shadow: inset 0px 2px 18px #ddd;
|
||||
border-bottom-left-radius: calc(0.3rem - 1px);
|
||||
border-bottom-right-radius: calc(0.3rem - 1px);
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
&-track {
|
||||
background: $white;
|
||||
}
|
||||
&-thumb {
|
||||
background: #c7c7c7;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.search-result-item {
|
||||
&:first-child {
|
||||
.section:not(:empty) {
|
||||
margin-top: -15px;
|
||||
}
|
||||
}
|
||||
&:not(:last-child) a {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
> .section {
|
||||
padding: 0 0.75rem;
|
||||
display: inline-block;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 25px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.block {
|
||||
display: block;
|
||||
padding: 0.65rem 1rem;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
transition: 0.1s;
|
||||
p {
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
font-weight: 500;
|
||||
mark:not(:first-child) {
|
||||
background-color: transparent;
|
||||
}
|
||||
mark {
|
||||
color: $color-primary;
|
||||
background-color: rgba($color-primary, 0.05);
|
||||
}
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&:focus,
|
||||
&:hover {
|
||||
background-color: rgba($color-primary, 0.8);
|
||||
* {
|
||||
color: white !important;
|
||||
}
|
||||
mark {
|
||||
color: $color-primary !important;
|
||||
background-color: $white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#search-result-body {
|
||||
&:empty {
|
||||
&::after {
|
||||
content: "No result to show!";
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin: 1.5rem 0;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
0
themes/godocs-1/layouts/404.html
Normal file
0
themes/godocs-1/layouts/404.html
Normal file
17
themes/godocs-1/layouts/_default/baseof.html
Normal file
17
themes/godocs-1/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ with site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
|
||||
<head>
|
||||
{{ partial "page-transition.html" . }}
|
||||
{{- partial "head.html" . -}}
|
||||
{{- partialCached "style.html" . -}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{- partialCached "preloader.html" . -}}
|
||||
{{- partial "header.html" . -}}
|
||||
{{- block "main" . }}{{- end }}
|
||||
{{- partialCached "footer.html" . -}}
|
||||
{{- partialCached "script.html" . -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
17
themes/godocs-1/layouts/_default/changelog.html
Normal file
17
themes/godocs-1/layouts/_default/changelog.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<div class="py-5 px-4 px-lg-5 shadow rounded content">
|
||||
<h1 class="mb-4 fw-bold">{{ .Title }}</h1>
|
||||
<p>{{.Params.Description | markdownify}}</p>
|
||||
<div class="mt-5">{{ .Content | markdownify }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
47
themes/godocs-1/layouts/_default/contact.html
Normal file
47
themes/godocs-1/layouts/_default/contact.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="p-4 p-sm-5 shadow rounded content">
|
||||
<h2 class="section-title">{{ .Title }}</h2>
|
||||
<form method="POST" action="{{ site.Params.contact_form_action }}">
|
||||
<div class="row gy-4">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="fname">{{ i18n "first_name" }}</label>
|
||||
<input type="text" class="form-control text-dark" id="fname" name="fname" placeholder="Your First Name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="lname">{{ i18n "last_name" }}</label>
|
||||
<input type="text" class="form-control text-dark" id="lname" name="lname" placeholder="Your Last Name">
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">{{ i18n "email" }}</label>
|
||||
<input type="email" class="form-control text-dark" id="email" name="email" placeholder="Your Email Address" required>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="reason">{{ i18n "contact_reason" }}</label>
|
||||
<select class="form-select rounded-0 px-0" id="inputGroupSelect01">
|
||||
<option selected disabled>Choose Your Reason</option>
|
||||
<option value="business">Business</option>
|
||||
<option value="ticket">Ticket</option>
|
||||
<option value="project">Project</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="message">{{ i18n "write_message" }}</label>
|
||||
<textarea name="message" id="message" class="form-control text-dark" placeholder="Your Text here ..."></textarea>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary">{{ i18n "send" }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
26
themes/godocs-1/layouts/_default/index.json
Normal file
26
themes/godocs-1/layouts/_default/index.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{{- /* Verzamel alle pagina's die je wilt doorzoeken */ -}}
|
||||
{{- $pages := where .Site.Pages "Type" "!=" "json" -}}
|
||||
{{- $pages = where $pages "Params.ignoreSearch" "!=" true -}}
|
||||
|
||||
{{- /* Bouw een slice met objecten voor de search-JSON */ -}}
|
||||
{{- $items := slice -}}
|
||||
|
||||
{{- range $e := $pages -}}
|
||||
{{- $section := "" -}}
|
||||
{{- with $e.Section }}{{ $section = . | humanize }}{{ end -}}
|
||||
|
||||
{{- $title := cond (isset $e.Params "bannertext") $e.Params.bannertext $e.Title -}}
|
||||
|
||||
{{- $obj := dict
|
||||
"section" $section
|
||||
"url" $e.Permalink
|
||||
"title" $title
|
||||
"description" $e.Description
|
||||
"searchKeyword" $e.Params.searchKeyword
|
||||
"content" $e.Plain
|
||||
-}}
|
||||
{{- $items = $items | append $obj -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Laat Hugo alles in één keer omzetten naar geldige JSON */ -}}
|
||||
{{- $items | jsonify -}}
|
||||
5
themes/godocs-1/layouts/_default/list.html
Normal file
5
themes/godocs-1/layouts/_default/list.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ partial "default.html" . }}
|
||||
|
||||
{{ end }}
|
||||
29
themes/godocs-1/layouts/_default/search.html
Normal file
29
themes/godocs-1/layouts/_default/search.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<h2 class="mb-5 fw-medium">Search result for
|
||||
<span class="text-primary">
|
||||
<script>
|
||||
var str = (window.location.search).substr(3);
|
||||
var result = str.replaceAll("+", " ");
|
||||
document.write(decodeURI(result));
|
||||
</script>
|
||||
</span>
|
||||
</h2>
|
||||
<div class="p-5 shadow rounded">
|
||||
<div id="search-results"></div>
|
||||
<script id="search-result-template" type="text/x-js-template">
|
||||
<div class="py-4 search-item" id="summary-${key}">
|
||||
<a class="h4 mb-0" href="${link}">${title}</a>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
5
themes/godocs-1/layouts/_default/single.html
Normal file
5
themes/godocs-1/layouts/_default/single.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ partial "default.html" . }}
|
||||
|
||||
{{ end }}
|
||||
91
themes/godocs-1/layouts/index.html
Normal file
91
themes/godocs-1/layouts/index.html
Normal file
@@ -0,0 +1,91 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section pb-0">
|
||||
<div class="container">
|
||||
<div class="row justify-content-between align-items-center">
|
||||
<div class="col-lg-5 text-center text-lg-start">
|
||||
{{ with .Params.banner }}
|
||||
<h1 class="mb-4">{{ .title | markdownify }}</h1>
|
||||
<p class="mb-4">{{ .subtitle | markdownify }}</p>
|
||||
{{ end }}
|
||||
<div class="d-flex flex-wrap justify-content-center justify-content-lg-start">
|
||||
|
||||
{{ with .Params.banner_button }}
|
||||
<a class="btn btn-primary ms-2 me-2 me-lg-4 mt-2" href="{{.link | safeURL}}">{{.label}}</a>
|
||||
{{ end }}
|
||||
|
||||
<form class="search-wrapper mt-2 mx-2 mx-lg-0" name="search-form" data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<i class="search-icon fas fa-search"></i>
|
||||
<input class="form-control px-4 text-dark" placeholder="{{ i18n `search_placeholder`}}" readonly>
|
||||
<button type="button" class="search-button" data-search-toggler>{{ i18n "search" }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 d-lg-block d-none">
|
||||
{{ partial "image.html" (dict "Src" .Params.banner.image "Alt" "illustration") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- topics -->
|
||||
<section class="section pb-0">
|
||||
<div class="container">
|
||||
<h2 class="section-title">{{ i18n "topics" }}</h2>
|
||||
<div class="row">
|
||||
{{ range (where site.Pages "Type" "docs") }}
|
||||
<div class="col-lg-4 col-sm-6 mb-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-body py-5">
|
||||
|
||||
<h4 class="card-title h4"><i class="{{ .Params.Icon }}"></i> {{ .Title }}</h4>
|
||||
<p class="card-text">{{ .Params.Description | markdownify }}</p>
|
||||
<a href="{{ .Permalink }}" class="stretched-link"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /topics -->
|
||||
|
||||
<!-- faq -->
|
||||
{{ with site.GetPage "/faq" }}
|
||||
<section class="section pb-0">
|
||||
<div class="container">
|
||||
<h2 class="section-title">{{ .Title }}</h2>
|
||||
<div class="row masonry-wrapper">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
<!-- /faq -->
|
||||
|
||||
<!-- call to action -->
|
||||
{{ with .Params.call_to_action }}
|
||||
{{ if .enable }}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-4 text-center d-lg-block d-none">
|
||||
{{ partial "image.html" (dict "Src" .image "Alt" "call-to-action") }}
|
||||
</div>
|
||||
<div class="col-lg-8 text-lg-start text-center">
|
||||
<h2 class="mb-3 fw-bold">{{ .title | markdownify }}</h2>
|
||||
<p>{{ .content | markdownify }}</p>
|
||||
{{ if .button.enable }}
|
||||
{{ with .button }}
|
||||
<a href="{{ .link | absLangURL }}" class="btn btn-primary">{{ .label }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- /call to action -->
|
||||
|
||||
{{ end }}
|
||||
143
themes/godocs-1/layouts/partials/default.html
Normal file
143
themes/godocs-1/layouts/partials/default.html
Normal file
@@ -0,0 +1,143 @@
|
||||
{{ "<!-- details page -->" | safeHTML }}
|
||||
<section class="pt-5">
|
||||
<div class="container shadow section-sm rounded">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 d-md-block order-2 order-md-1">
|
||||
<ul class="sidenav">
|
||||
{{ $currentNode := . }}
|
||||
{{range site.Home.Sections.ByWeight}}
|
||||
<!-- not render any single page, like contact page. -->
|
||||
{{ $numberOfMainPages := len .Pages }}
|
||||
{{ if eq $numberOfMainPages 0 }}
|
||||
{{ else }}
|
||||
<!-- /not render any single page, like contact page. -->
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-8 order-1 order-md-2">
|
||||
<div class="px-lg-5 px-sm-4">
|
||||
<div class="header-row">
|
||||
<h1 class="mb-4 fw-bold">{{ .Title }}</h1>
|
||||
{{ with .Params.town_options.flag }}
|
||||
{{ partial "image.html" (dict "Src" . "Class" "img-flag shadow" "Alt" (printf "Vlag van %s" $.Title)) }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ $town := .Params.town_options }}
|
||||
|
||||
{{ if $town }}
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<h2 class="h5 mb-3">Bouw- en woonmogelijkheden</h2>
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.mantelzorgwoning_status "icon" "fa-house" "title" "Mantelzorgwoning") }}
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.premantelzorgwoning_status "icon" "fa-people-roof" "title" "Premantelzorgwoning") }}
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.generatiewoning_status "icon" "fa-people-group" "title" "Generatiewoning") }}
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.vrijebouw_status "icon" "fa-up-right-from-square" "title" "Vrije bouw") }}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="h5 mb-3">Ruimtelijke aandachtspunten</h2>
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.natura_status "icon" "fa-leaf" "title" "Natura / natuurgebieden") }}
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.monumenten_status "icon" "fa-landmark" "title" "Monumenten") }}
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.soil_status "icon" "fa-mountain" "title" "Bodem / fundering") }}
|
||||
{{ partial "town-status-icon.html" (dict "status" $town.plan_status "icon" "fa-map" "title" "Omgevingsplan / bestemming") }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Content }}
|
||||
<div class="content">
|
||||
{{ partial "autotooltips.html" . }}
|
||||
</div>
|
||||
{{ else }}
|
||||
|
||||
<div class="page-list">
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<nav class="pagination">
|
||||
<!-- Next prev page -->
|
||||
{{- $currentNode := . -}}
|
||||
{{- template "menu-nextprev" dict "menu" site.Home "currentnode" $currentNode -}}
|
||||
{{- define "menu-nextprev" -}}
|
||||
{{- $currentNode := .currentnode -}}
|
||||
{{- if ne .menu.Params.hidden true -}}
|
||||
{{- if hasPrefix $currentNode.Permalink .menu.Permalink -}}
|
||||
{{- $currentNode.Scratch.Set "NextPageOK" "OK" -}}
|
||||
{{- $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") -}}
|
||||
{{- else -}}
|
||||
{{- if eq ($currentNode.Scratch.Get "NextPageOK") "OK" -}}
|
||||
{{- $currentNode.Scratch.Set "NextPageOK" nil -}}
|
||||
{{- $currentNode.Scratch.Set "nextPage" .menu -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $currentNode.Scratch.Set "prevPageTmp" .menu -}}
|
||||
{{- $currentNode.Scratch.Set "pages" .menu.Pages -}}
|
||||
{{- if .menu.IsHome -}}
|
||||
{{- $currentNode.Scratch.Set "pages" .menu.Sections -}}
|
||||
{{- else if .menu.Sections -}}
|
||||
{{- $currentNode.Scratch.Set "pages" (.menu.Pages | union .menu.Sections) -}}
|
||||
{{- end -}}
|
||||
{{- $pages := ($currentNode.Scratch.Get "pages") -}}
|
||||
|
||||
{{- range $pages.ByWeight -}}
|
||||
{{- template "menu-nextprev" dict "menu" . "currentnode" $currentNode -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with ($.Scratch.Get "prevPage") -}}
|
||||
{{- if .Title -}}
|
||||
<a class="nav nav-prev" href="{{.RelPermalink }}"><i class="fas fa-chevron-left me-2"></i>
|
||||
<span class="d-none d-sm-block">{{.Title}}</span> <span class="d-block d-sm-none">{{ i18n "previous" }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with ($.Scratch.Get "nextPage") -}}
|
||||
{{- if .Title -}}
|
||||
<a class="nav nav-next" href="{{.RelPermalink }}">
|
||||
<span class="d-none d-sm-block">{{.Title}}</span> <span class="d-block d-sm-none">{{ i18n "next" }}</span><i class="fas fa-chevron-right ms-2"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ "<!-- /details page -->" | safeHTML }}
|
||||
|
||||
<!-- templates -->
|
||||
{{ define "section-tree-nav" }}
|
||||
{{ $showvisitedlinks := .showvisitedlinks }}
|
||||
{{ $currentNode := .currentnode }}
|
||||
{{with .sect}}
|
||||
{{safeHTML .Params.head}}
|
||||
{{ $fileUniqueID := "" }}
|
||||
{{ with .File }}{{ $fileUniqueID = .UniqueID }}{{ end }}
|
||||
{{ $currentNodeFileUniqueID := "" }}
|
||||
{{ with $currentNode.File }}{{ $currentNodeFileUniqueID = .UniqueID }}{{ end }}
|
||||
<li data-nav-id="{{.Permalink}}" title="{{.Title}}"
|
||||
class="sidelist {{if .IsAncestor $currentNode }}parent{{end}} {{if eq $fileUniqueID $currentNodeFileUniqueID}}active parent{{end}}">
|
||||
<a href="{{.Permalink}}">{{.Title }}</a>
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ if ne $numberOfPages 0 }}
|
||||
<ul>
|
||||
{{ $currentNode.Scratch.Set "pages" .Pages }}
|
||||
{{ if .Sections}}
|
||||
{{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
|
||||
{{end}}
|
||||
{{ $pages := ($currentNode.Scratch.Get "pages") }}
|
||||
|
||||
{{ range $pages.ByWeight }}
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
36
themes/godocs-1/layouts/partials/footer.html
Normal file
36
themes/godocs-1/layouts/partials/footer.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row align-items-center border-bottom py-5">
|
||||
<div class="col-lg-4">
|
||||
<ul class="list-inline footer-menu text-center text-lg-start">
|
||||
{{ range site.Menus.footer }}
|
||||
<li class="list-inline-item"><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-4 text-center mb-4 mb-lg-0">
|
||||
<!-- <a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
|
||||
{{ partial "logo" }}
|
||||
</a>
|
||||
</div> -->
|
||||
<div class="py-4 text-center">
|
||||
<small class="text-light">
|
||||
{{ site.Params.copyright | markdownify }}
|
||||
{{ if site.Params.theme_copyright }}
|
||||
| Made with <i class="fa-solid fa-heart"></i> by
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://start-it.nl">StartIT</a>
|
||||
{{ end }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<ul class="list-inline social-icons text-lg-end text-center">
|
||||
{{ range site.Params.social }}
|
||||
<li class="list-inline-item"><a href="{{ .link | safeURL }}"><i class="{{ .icon }}"></i></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
55
themes/godocs-1/layouts/partials/head.html
Normal file
55
themes/godocs-1/layouts/partials/head.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ .Title | default site.Title }}</title>
|
||||
|
||||
<!-- responsive meta -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
|
||||
|
||||
<!-- theme meta -->
|
||||
<meta name="theme-name" content="godocs-hugo" />
|
||||
|
||||
<!-- favicon -->
|
||||
{{ partialCached "favicon" . }}
|
||||
|
||||
|
||||
<!-- manifest -->
|
||||
{{ partialCached "manifest" . }}
|
||||
|
||||
|
||||
<!-- site verifications -->
|
||||
{{ partialCached "site-verifications.html" . }}
|
||||
|
||||
|
||||
<!-- opengraph and twitter card -->
|
||||
{{ partial "basic-seo.html" . }}
|
||||
|
||||
|
||||
<!-- custom script -->
|
||||
{{ partialCached "custom-script.html" . }}
|
||||
|
||||
|
||||
<!-- google analytics -->
|
||||
<!-- {{ template "_internal/google_analytics.html" . }} -->
|
||||
|
||||
|
||||
<!-- google tag manager -->
|
||||
<!-- {{ partialCached "gtm.html" . }} -->
|
||||
|
||||
|
||||
<!-- matomo analytics -->
|
||||
{{ partialCached "matomo-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Baidu analytics -->
|
||||
{{ partialCached "baidu-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Plausible Analytics -->
|
||||
<!-- {{ partialCached "plausible-analytics.html" . }} -->
|
||||
<script defer data-domain="kennisbank.start-it.nl" src="https://stats.start-it.nl/js/script.file-downloads.outbound-links.js"></script>
|
||||
|
||||
<!-- Counter Analytics -->
|
||||
{{ partialCached "counter-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Crisp Chat -->
|
||||
{{ partialCached "crisp-chat.html" . }}
|
||||
98
themes/godocs-1/layouts/partials/header.html
Normal file
98
themes/godocs-1/layouts/partials/header.html
Normal file
@@ -0,0 +1,98 @@
|
||||
{{ "<!-- navigation -->" | safeHTML }}
|
||||
<header class="sticky-top navigation {{if .IsHome}}top-0{{end}}">
|
||||
<div class="container">
|
||||
<!-- navbar -->
|
||||
<nav class="navbar px-0 navbar-expand-lg navbar-light bg-transparent">
|
||||
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
|
||||
{{ partial "logo" }}
|
||||
</a>
|
||||
|
||||
{{if not .IsHome }}
|
||||
<form class="form-inline search-wrapper my-3 d-block d-lg-none" name="search-form" class="search-wrapper" data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<input id="search-by" name="s" type="search" class="form-control text-dark d-none d-lg-block" placeholder="{{ i18n `search_placeholder`}}" readonly>
|
||||
<button class="border-0 bg-white pe-none" type="submit"><i class="fas fa-search"></i></button>
|
||||
</form>
|
||||
{{ end }}
|
||||
|
||||
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navigation">
|
||||
<i class="fa-solid fa-bars"></i>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse text-center" id="navigation">
|
||||
<ul class="navbar-nav mx-auto align-items-center">
|
||||
{{ range site.Menus.main }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
{{ range .Children }}
|
||||
<a class="dropdown-item" href="{{ .URL | absURL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" {{ if findRE `^http` .URL }} target="_blank" rel="noopener" {{ end }} href="{{ if findRE `^#` .URL }}{{ if not $.IsHome }}{{ site.BaseURL | relLangURL }}{{ end }}{{ .URL }}{{ else }}{{ .URL | relLangURL }}{{ end }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<li class="nav-link">
|
||||
<!-- Language List -->
|
||||
{{ if .IsTranslated }}
|
||||
<select class="nav-item" id="select-language" onchange="location = this.value;">
|
||||
{{ $siteLanguages := site.Languages}}
|
||||
{{ $pageLang := .Page.Lang}}
|
||||
{{ range .Page.AllTranslations }}
|
||||
{{ $translation := .}}
|
||||
{{ range $siteLanguages }}
|
||||
{{ if eq $translation.Lang .Lang }}
|
||||
{{ $selected := false }}
|
||||
{{ if eq $pageLang .Lang}}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
|
||||
</option>
|
||||
{{ else }}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</select>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- for mobile -->
|
||||
<div class="d-lg-none d-block">
|
||||
{{ range site.Params.nav_button }}
|
||||
<a href="{{ .link | absLangURL }}"
|
||||
class="btn btn-sm {{if eq .style `outline`}}btn-outline-primary{{else}}btn-primary{{end}} ms-lg-4">{{ i18n .label }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- /for mobile -->
|
||||
</div>
|
||||
|
||||
{{if not .IsHome }}
|
||||
<form class="form-inline search-wrapper my-3 d-none d-lg-block" class="search-wrapper" data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<i class="search-icon fas fa-search"></i>
|
||||
<input class="form-control form-control-sm" placeholder="{{ i18n `search`}}" readonly>
|
||||
<button type="button" class="search-button" style="font-size:12px" data-search-toggler>{{ i18n "search" }}</button>
|
||||
</form>
|
||||
{{ end }}
|
||||
|
||||
<!-- for desktop -->
|
||||
<div class="d-lg-flex d-none">
|
||||
{{ range site.Params.nav_button }}
|
||||
<a href="{{ .link | absLangURL }}"
|
||||
class="btn btn-sm {{if eq .style `outline`}}btn-outline-primary{{else}}btn-primary{{end}} ms-lg-4">{{ i18n .label }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- /for desktop -->
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{{ "<!-- /navigation -->" | safeHTML }}
|
||||
|
||||
{{ partial "search-modal" . }}
|
||||
9
themes/godocs-1/layouts/partials/preloader.html
Normal file
9
themes/godocs-1/layouts/partials/preloader.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ if site.Params.preloader.enable }}
|
||||
{{ "<!-- preloader start -->" | safeHTML }}
|
||||
<div class="preloader">
|
||||
{{ with site.Params.preloader.preloader }}
|
||||
<img src="{{ . | absURL }}" alt="preloader">
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ "<!-- preloader end -->" | safeHTML }}
|
||||
{{ end }}
|
||||
56
themes/godocs-1/layouts/partials/script.html
Normal file
56
themes/godocs-1/layouts/partials/script.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!-- Bootstrap scripts -->
|
||||
{{ $bootstrap := resources.Get "js/bootstrap.js" }}
|
||||
{{ $params := dict }}
|
||||
{{ $sourceMap := cond hugo.IsProduction "" "inline" }}
|
||||
{{ $opts := dict "sourceMap" $sourceMap "target" "es2018" "params" $params }}
|
||||
{{ $bootstrap = $bootstrap | js.Build $opts }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $bootstrap = $bootstrap | fingerprint "sha512" }}
|
||||
{{ end }}
|
||||
<script crossorigin="anonymous" defer {{ if hugo.IsProduction }}integrity="{{ $bootstrap.Data.Integrity }}"{{end}} type="application/javascript">{{$bootstrap.Content | safeJS}}</script>
|
||||
|
||||
<!-- JS Plugins + Main script -->
|
||||
{{ $scripts := slice }}
|
||||
{{ range site.Params.plugins.js }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script
|
||||
src="{{ .link | relURL }}"
|
||||
type="application/javascript"
|
||||
{{ .attributes | safeHTMLAttr }}></script>
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- main script -->
|
||||
{{ $scripts = $scripts | append (resources.Get "js/script.js") }}
|
||||
{{ $scripts = $scripts | resources.Concat "js/scripts.js" }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $scripts = $scripts | fingerprint "sha512" }}
|
||||
{{ end }}
|
||||
<script crossorigin="anonymous" defer {{ if hugo.IsProduction }}integrity="{{ $scripts.Data.Integrity }}"{{end}} type="application/javascript">{{$scripts.Content | safeJS}}</script>
|
||||
|
||||
<!-- font family -->
|
||||
{{ $pf:= site.Params.variables.font_primary }}
|
||||
{{ $sf:= site.Params.variables.font_secondary }}
|
||||
<script type="application/javascript">
|
||||
WebFont.load({
|
||||
google: {
|
||||
api: 'https://fonts.googleapis.com/css2',
|
||||
families: ['{{$pf | default `Lato:wght@400`}}{{if not $sf}}&display=swap{{end}}'{{with $sf}},'{{. | default `Lato:wght@400`}}&display=swap'{{end}}],
|
||||
version: 2
|
||||
},
|
||||
active: () => {sessionStorage.fontsLoaded = true}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- progressive web app -->
|
||||
{{ partialCached "pwa.html" . }}
|
||||
|
||||
|
||||
<!-- cookie consent -->
|
||||
{{ partialCached "cookie-consent.html" . }}
|
||||
|
||||
|
||||
<!-- google adsense -->
|
||||
{{ partialCached "adsense-script.html" . }}
|
||||
93
themes/godocs-1/layouts/partials/search-modal.html
Normal file
93
themes/godocs-1/layouts/partials/search-modal.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<div class="modal search-modal" id="searchModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog search-modal-dialog">
|
||||
<div class="modal-content border-0"><div class="modal-header border-0" style="padding:1rem"><div class="input-group border-0">
|
||||
<span class="input-group-text bg-transparent text-dark border-end-0" id="Search">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>
|
||||
</span>
|
||||
<input type="text" id="searchInput" class="form-control search-form-control shadow-none text-dark border-start-0 ps-0 ms-0 border-end-0" placeholder="{{i18n `search_placeholder`}}" aria-label="Search" aria-describedby="Search">
|
||||
<span class="input-group-text bg-transparent text-muted border-start-0" style="font-size:14px;">
|
||||
<span class="border border-muted rounded-1 px-1" data-bs-dismiss="modal" aria-label="Close">ESC</span>
|
||||
</span>
|
||||
</div></div>
|
||||
<div class="modal-body">
|
||||
<div id="search-result-body"></div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const searchModal = document.getElementById('searchModal');
|
||||
const searchInput = document.getElementById('searchInput');
|
||||
const searchResult = document.getElementById("search-result-body");
|
||||
searchModal.addEventListener('shown.bs.modal', () => {searchInput.focus()});
|
||||
let jsonData = [];
|
||||
let indexJSON = {{"index.json" | relURL}};
|
||||
|
||||
const loadJsonData = async () => {
|
||||
try {
|
||||
const res = await fetch(indexJSON);
|
||||
jsonData = await res.json();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
|
||||
searchInput.addEventListener("keyup", (e) => {
|
||||
const searchString = e.target.value.toLowerCase();
|
||||
|
||||
let filteredJSON = jsonData.reduce((prev, item) => [...new Set([...prev, item.section])], []).map((item) => {
|
||||
let filteredItems = jsonData.filter((i) => i.section === item);
|
||||
return {
|
||||
section: item,
|
||||
data: filteredItems,
|
||||
};
|
||||
});
|
||||
|
||||
let searchItem = filteredJSON.filter((item) => {
|
||||
if (searchString === "" ) {
|
||||
return "";
|
||||
}
|
||||
else if (item.data.find((el) => (el.title?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
else if (item.data.find((el) => (el.description?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
else if (item.data.find((el) => (el.searchKeyword?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
else if (item.data.find((el) => (el.content?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
});
|
||||
|
||||
displayResult(searchItem, searchString);
|
||||
});
|
||||
|
||||
const displayResult = (searchItems, searchString) => {
|
||||
const htmlString = searchItems.map((item) => {
|
||||
const contentValue = item.data.filter((d) => d.content?.toLowerCase().includes(searchString)).map((innerItem) => {
|
||||
const position = innerItem.content?.toLowerCase().indexOf(searchString.toLowerCase());
|
||||
let matches = innerItem.content?.substring(position, searchString.length + position);
|
||||
let matchesAfter = innerItem.content?.substring(searchString.length + position, searchString.length + position + 100);
|
||||
const highlighted = innerItem.content?.replace(innerItem.content, '<mark>' + matches + '</mark>' + matchesAfter);
|
||||
return highlighted;
|
||||
});
|
||||
|
||||
return`
|
||||
<div class="search-result-item">
|
||||
<p class="section">${item.section}</p>
|
||||
${item.data.filter((d) =>
|
||||
d.title?.toLowerCase().includes(searchString) ||
|
||||
d.description?.toLowerCase().includes(searchString) ||
|
||||
d.searchKeyword?.toLowerCase().includes(searchString) ||
|
||||
d.content?.toLowerCase().includes(searchString)).map((innerItem) =>
|
||||
`<a class="block" href="${innerItem.url}"><p class="text-dark mb-0 lh-base">${innerItem.title}</p><span></span><p class="small text-muted mt-1 mb-0 lh-base">${contentValue}</p></a>`
|
||||
).join("")}
|
||||
</div>`
|
||||
}).join("");
|
||||
searchResult.innerHTML = htmlString;
|
||||
};
|
||||
loadJsonData();
|
||||
|
||||
</script>
|
||||
31
themes/godocs-1/layouts/partials/style.html
Normal file
31
themes/godocs-1/layouts/partials/style.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!-- DNS preconnect -->
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on" />
|
||||
<link rel="preconnect" href="//ajax.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
|
||||
<link rel="preconnect" href="https://use.fontawesome.com" crossorigin />
|
||||
<link rel="preconnect" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="preconnect" href="//www.googletagmanager.com" />
|
||||
<link rel="preconnect" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="https://fonts.gstatic.com" />
|
||||
<link rel="dns-prefetch" href="https://use.fontawesome.com" />
|
||||
<link rel="dns-prefetch" href="//ajax.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="dns-prefetch" href="//www.googletagmanager.com" />
|
||||
<link rel="dns-prefetch" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//connect.facebook.net" />
|
||||
<link rel="dns-prefetch" href="//platform.linkedin.com" />
|
||||
<link rel="dns-prefetch" href="//platform.twitter.com" />
|
||||
|
||||
<!-- plugins + stylesheet -->
|
||||
{{ $styles := slice }}
|
||||
{{ range site.Params.plugins.css }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<link crossorigin="anonymous" media="all" rel="stylesheet" href="{{ .link | absURL }}" {{.attributes | safeHTMLAttr}} >
|
||||
{{ else }}
|
||||
{{ $styles = $styles | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $styles := $styles | append (resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "style.scss" . | toCSS) }}
|
||||
{{ $styles := $styles | resources.Concat "/css/style.css" | minify | fingerprint "sha512"}}
|
||||
<style crossorigin="anonymous" media="all" type="text/css" integrity="{{ $styles.Data.Integrity }}">{{$styles.Content | safeCSS}}</style>
|
||||
6
themes/godocs-1/layouts/shortcodes/changelog.html
Normal file
6
themes/godocs-1/layouts/shortcodes/changelog.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="badge {{ .Get 0 | lower}}">{{ .Get 0 | title }}</div>
|
||||
{{ .Inner | markdownify }}
|
||||
</div>
|
||||
10
themes/godocs-1/layouts/shortcodes/faq.html
Normal file
10
themes/godocs-1/layouts/shortcodes/faq.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card card-lg">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title h5 mb-3">{{ .Get 0 | markdownify }}</h3>
|
||||
<p class="card-text content">{{ .Inner | markdownify }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
14
themes/godocs-1/scripts/clearModules.js
Normal file
14
themes/godocs-1/scripts/clearModules.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const clearModules = (filePath) => {
|
||||
if (fs.existsSync(filePath)) {
|
||||
let fileContent = fs.readFileSync(filePath, "utf8");
|
||||
fileContent = fileContent.replace(/require\s*\([\s\S]*?\)/, "");
|
||||
fs.writeFileSync(filePath, fileContent, "utf8");
|
||||
} else {
|
||||
console.log("File does not exist.");
|
||||
}
|
||||
};
|
||||
|
||||
clearModules("go.mod");
|
||||
clearModules("exampleSite/go.mod");
|
||||
77
themes/godocs-1/scripts/projectSetup.js
Normal file
77
themes/godocs-1/scripts/projectSetup.js
Normal file
@@ -0,0 +1,77 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const getFolderName = (rootfolder) => {
|
||||
const configPath = path.join(
|
||||
rootfolder,
|
||||
"exampleSite/config/_default/hugo.toml"
|
||||
);
|
||||
const getConfig = fs.readFileSync(configPath, "utf8");
|
||||
const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/);
|
||||
let selectedTheme = null;
|
||||
if (match && match[1]) {
|
||||
selectedTheme = match[1];
|
||||
}
|
||||
return selectedTheme;
|
||||
};
|
||||
|
||||
const deleteFolder = (folderPath) => {
|
||||
if (fs.existsSync(folderPath)) {
|
||||
fs.rmSync(folderPath, { recursive: true, force: true });
|
||||
}
|
||||
};
|
||||
|
||||
const createNewfolder = (rootfolder, folderName) => {
|
||||
const newFolder = path.join(rootfolder, folderName);
|
||||
fs.mkdirSync(newFolder, { recursive: true });
|
||||
return newFolder;
|
||||
};
|
||||
|
||||
const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => {
|
||||
const directory = path.join(rootFolder);
|
||||
const items = fs.readdirSync(directory, { withFileTypes: true });
|
||||
items.forEach((item) => {
|
||||
if (item.isDirectory()) {
|
||||
createNewfolder(destinationRoot, item.name);
|
||||
iterateFilesAndFolders(path.join(directory, item.name), {
|
||||
currentFolder: item.name,
|
||||
destinationRoot: path.join(destinationRoot, item.name),
|
||||
});
|
||||
} else {
|
||||
const sourceFile = path.join(directory, item.name);
|
||||
const destinationFile = path.join(destinationRoot, item.name);
|
||||
fs.renameSync(sourceFile, destinationFile);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const setupProject = () => {
|
||||
const rootfolder = path.join(__dirname, "../");
|
||||
if (!fs.existsSync(path.join(rootfolder, "themes"))) {
|
||||
const folderList = ["layouts", "assets", "static"];
|
||||
const folderName = getFolderName(rootfolder);
|
||||
const newfolderName = createNewfolder(
|
||||
path.join(rootfolder, "themes"),
|
||||
folderName
|
||||
);
|
||||
|
||||
folderList.forEach((folder) => {
|
||||
const source = path.join(rootfolder, folder);
|
||||
const destination = path.join(newfolderName, folder);
|
||||
if (fs.existsSync(source)) {
|
||||
fs.mkdirSync(destination, { recursive: true });
|
||||
iterateFilesAndFolders(source, {
|
||||
currentFolder: folder,
|
||||
destinationRoot: destination,
|
||||
});
|
||||
deleteFolder(source);
|
||||
}
|
||||
});
|
||||
|
||||
const exampleSite = path.join(rootfolder, "exampleSite");
|
||||
iterateFilesAndFolders(exampleSite, { destinationRoot: rootfolder });
|
||||
deleteFolder(exampleSite);
|
||||
}
|
||||
};
|
||||
|
||||
setupProject();
|
||||
93
themes/godocs-1/scripts/themeSetup.js
Normal file
93
themes/godocs-1/scripts/themeSetup.js
Normal file
@@ -0,0 +1,93 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const createNewfolder = (rootfolder, folderName) => {
|
||||
const newFolder = path.join(rootfolder, folderName);
|
||||
fs.mkdirSync(newFolder, { recursive: true });
|
||||
return newFolder;
|
||||
};
|
||||
|
||||
const deleteFolder = (folderPath) => {
|
||||
if (fs.existsSync(folderPath)) {
|
||||
fs.rmSync(folderPath, { recursive: true, force: true });
|
||||
}
|
||||
};
|
||||
|
||||
const getFolderName = (rootfolder) => {
|
||||
const configPath = path.join(
|
||||
rootfolder,
|
||||
"exampleSite/config/_default/hugo.toml"
|
||||
);
|
||||
const getConfig = fs.readFileSync(configPath, "utf8");
|
||||
const match = getConfig.match(/theme\s*=\s*\[?"([^"\]]+)"\]?/);
|
||||
let selectedTheme = null;
|
||||
if (match && match[1]) {
|
||||
selectedTheme = match[1];
|
||||
}
|
||||
return selectedTheme;
|
||||
};
|
||||
|
||||
const iterateFilesAndFolders = (rootFolder, { destinationRoot }) => {
|
||||
const directory = path.join(rootFolder);
|
||||
const items = fs.readdirSync(directory, { withFileTypes: true });
|
||||
items.forEach((item) => {
|
||||
if (item.isDirectory()) {
|
||||
createNewfolder(destinationRoot, item.name);
|
||||
iterateFilesAndFolders(path.join(directory, item.name), {
|
||||
currentFolder: item.name,
|
||||
destinationRoot: path.join(destinationRoot, item.name),
|
||||
});
|
||||
} else {
|
||||
const sourceFile = path.join(directory, item.name);
|
||||
const destinationFile = path.join(destinationRoot, item.name);
|
||||
fs.renameSync(sourceFile, destinationFile);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const setupTheme = () => {
|
||||
const rootFolder = path.join(__dirname, "../");
|
||||
|
||||
if (!fs.existsSync(path.join(rootFolder, "exampleSite"))) {
|
||||
const includesFiles = [
|
||||
"tailwind.config.js",
|
||||
"postcss.config.js",
|
||||
"go.mod",
|
||||
"hugo.toml",
|
||||
"assets",
|
||||
"config",
|
||||
"data",
|
||||
"content",
|
||||
"i18n",
|
||||
"static",
|
||||
];
|
||||
|
||||
const folder = createNewfolder(rootFolder, "exampleSite");
|
||||
|
||||
fs.readdirSync(rootFolder, { withFileTypes: true }).forEach((file) => {
|
||||
if (includesFiles.includes(file.name)) {
|
||||
if (file.isDirectory()) {
|
||||
const destination = path.join(rootFolder, "exampleSite", file.name);
|
||||
fs.mkdirSync(destination, { recursive: true });
|
||||
iterateFilesAndFolders(path.join(rootFolder, file.name), {
|
||||
destinationRoot: destination,
|
||||
});
|
||||
deleteFolder(path.join(rootFolder, file.name));
|
||||
} else {
|
||||
fs.renameSync(
|
||||
path.join(rootFolder, file.name),
|
||||
path.join(folder, file.name)
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const themes = path.join(rootFolder, "themes");
|
||||
iterateFilesAndFolders(path.join(themes, getFolderName(rootFolder)), {
|
||||
destinationRoot: rootFolder,
|
||||
});
|
||||
deleteFolder(themes);
|
||||
}
|
||||
};
|
||||
|
||||
setupTheme();
|
||||
Reference in New Issue
Block a user