reindent footer html
This commit is contained in:
parent
5e7c8b51ac
commit
24749f16d0
|
@ -1,39 +1,39 @@
|
||||||
{{- if not (.Param "hideFooter") }}
|
{{- if not (.Param "hideFooter") }}
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
{{- if site.Copyright }}
|
{{- if site.Copyright }}
|
||||||
<span>{{ site.Copyright | markdownify }}</span>
|
<span>{{ site.Copyright | markdownify }}</span>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<span>© {{ now.Year }} <a href="{{ "" | absURL }}">{{ site.Title }}</a></span>
|
<span>© {{ now.Year }} <a href="{{ "" | absURL }}">{{ site.Title }}</a></span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<span style="display: inline-block; margin-left: 1em;">
|
<span style="display: inline-block; margin-left: 1em;">
|
||||||
<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>
|
<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>
|
||||||
</span>
|
</span>
|
||||||
<span style="display: inline-block; margin-left: 1em;">
|
<span style="display: inline-block; margin-left: 1em;">
|
||||||
Powered by
|
Powered by
|
||||||
<a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> &
|
<a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> &
|
||||||
<a href="https://github.com/reorx/hugo-PaperModX" rel="noopener" target="_blank">PaperModX</a>
|
<a href="https://github.com/reorx/hugo-PaperModX" rel="noopener" target="_blank">PaperModX</a>
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if (not site.Params.disableScrollToTop) }}
|
{{- if (not site.Params.disableScrollToTop) }}
|
||||||
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
|
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
|
||||||
<path d="M12 6H0l6-6z" />
|
<path d="M12 6H0l6-6z" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- partial "extend_footer.html" . }}
|
{{- partial "extend_footer.html" . }}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(function() {
|
(function () {
|
||||||
let menu = document.getElementById('menu')
|
let menu = document.getElementById('menu')
|
||||||
if (menu) {
|
if (menu) {
|
||||||
menu.scrollLeft = localStorage.getItem("menu-scroll-position");
|
menu.scrollLeft = localStorage.getItem("menu-scroll-position");
|
||||||
menu.onscroll = function () {
|
menu.onscroll = function () {
|
||||||
localStorage.setItem("menu-scroll-position", menu.scrollLeft);
|
localStorage.setItem("menu-scroll-position", menu.scrollLeft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const disableSmoothScroll = '{{- if (.Param "DisableSmoothScroll") -}}1{{- end -}}' == '1';
|
const disableSmoothScroll = '{{- if (.Param "DisableSmoothScroll") -}}1{{- end -}}' == '1';
|
||||||
|
@ -44,50 +44,48 @@
|
||||||
}
|
}
|
||||||
// only run this code if smooth scroll should be enabled
|
// only run this code if smooth scroll should be enabled
|
||||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||||
anchor.addEventListener("click", function (e) {
|
anchor.addEventListener("click", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var id = this.getAttribute("href").substr(1);
|
var id = this.getAttribute("href").substr(1);
|
||||||
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
|
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
|
||||||
behavior: "smooth"
|
behavior: "smooth"
|
||||||
});
|
|
||||||
if (id === "top") {
|
|
||||||
history.replaceState(null, null, " ");
|
|
||||||
} else {
|
|
||||||
history.pushState(null, null, `#${id}`);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
if (id === "top") {
|
||||||
|
history.replaceState(null, null, " ");
|
||||||
|
} else {
|
||||||
|
history.pushState(null, null, `#${id}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{- if (not site.Params.disableScrollToTop) }}
|
{{- if (not site.Params.disableScrollToTop) }}
|
||||||
<script>
|
<script>
|
||||||
var mybutton = document.getElementById("top-link");
|
var mybutton = document.getElementById("top-link");
|
||||||
window.onscroll = function () {
|
window.onscroll = function () {
|
||||||
if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
|
if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
|
||||||
mybutton.style.visibility = "visible";
|
mybutton.style.visibility = "visible";
|
||||||
mybutton.style.opacity = "1";
|
mybutton.style.opacity = "1";
|
||||||
} else {
|
} else {
|
||||||
mybutton.style.visibility = "hidden";
|
mybutton.style.visibility = "hidden";
|
||||||
mybutton.style.opacity = "0";
|
mybutton.style.opacity = "0";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if (not site.Params.disableThemeToggle) }}
|
{{- if (not site.Params.disableThemeToggle) }}
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("theme-toggle").addEventListener("click", () => {
|
document.getElementById("theme-toggle").addEventListener("click", () => {
|
||||||
if (document.body.className.includes("dark")) {
|
if (document.body.className.includes("dark")) {
|
||||||
document.body.classList.remove('dark');
|
document.body.classList.remove('dark');
|
||||||
localStorage.setItem("pref-theme", 'light');
|
localStorage.setItem("pref-theme", 'light');
|
||||||
} else {
|
} else {
|
||||||
document.body.classList.add('dark');
|
document.body.classList.add('dark');
|
||||||
localStorage.setItem("pref-theme", 'dark');
|
localStorage.setItem("pref-theme", 'dark');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
@ -122,7 +120,6 @@
|
||||||
|
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
{{- partial "page_footer.html" . }}
|
{{- partial "page_footer.html" . }}
|
||||||
{{- else }}
|
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
|
||||||
{{- /* Search */}}
|
{{- /* Search */}}
|
||||||
|
@ -144,7 +141,7 @@
|
||||||
{{- if (.Param "EnableInstantClick") }}
|
{{- if (.Param "EnableInstantClick") }}
|
||||||
{{- $instantclick := resources.Get "js/instantclick.js" }}
|
{{- $instantclick := resources.Get "js/instantclick.js" }}
|
||||||
<script src="{{ $instantclick.RelPermalink }}" data-no-instant
|
<script src="{{ $instantclick.RelPermalink }}" data-no-instant
|
||||||
{{- if site.Params.assets.disableFingerprinting }}integrity="{{ $instantclick.Data.Integrity }}"{{- end }}
|
{{- if site.Params.assets.disableFingerprinting }}integrity="{{ $instantclick.Data.Integrity }}"{{- end }}
|
||||||
></script>
|
></script>
|
||||||
<script data-no-instant>
|
<script data-no-instant>
|
||||||
// http://instantclick.io/scripts
|
// http://instantclick.io/scripts
|
||||||
|
|
|
@ -1,51 +1,51 @@
|
||||||
|
|
||||||
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }}
|
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }}
|
||||||
<script>
|
<script>
|
||||||
document.querySelectorAll('pre > code').forEach((codeblock) => {
|
document.querySelectorAll('pre > code').forEach((codeblock) => {
|
||||||
const container = codeblock.parentNode.parentNode;
|
const container = codeblock.parentNode.parentNode;
|
||||||
|
|
||||||
const copybutton = document.createElement('button');
|
const copybutton = document.createElement('button');
|
||||||
copybutton.classList.add('copy-code');
|
copybutton.classList.add('copy-code');
|
||||||
|
copybutton.innerText = '{{- i18n "code_copy" | default "copy" }}';
|
||||||
|
|
||||||
|
function copyingDone() {
|
||||||
|
copybutton.innerText = '{{- i18n "code_copied" | default "copied!" }}';
|
||||||
|
setTimeout(() => {
|
||||||
copybutton.innerText = '{{- i18n "code_copy" | default "copy" }}';
|
copybutton.innerText = '{{- i18n "code_copy" | default "copy" }}';
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
function copyingDone() {
|
copybutton.addEventListener('click', (cb) => {
|
||||||
copybutton.innerText = '{{- i18n "code_copied" | default "copied!" }}';
|
if ('clipboard' in navigator) {
|
||||||
setTimeout(() => {
|
navigator.clipboard.writeText(codeblock.textContent);
|
||||||
copybutton.innerText = '{{- i18n "code_copy" | default "copy" }}';
|
copyingDone();
|
||||||
}, 2000);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
copybutton.addEventListener('click', (cb) => {
|
const range = document.createRange();
|
||||||
if ('clipboard' in navigator) {
|
range.selectNodeContents(codeblock);
|
||||||
navigator.clipboard.writeText(codeblock.textContent);
|
const selection = window.getSelection();
|
||||||
copyingDone();
|
selection.removeAllRanges();
|
||||||
return;
|
selection.addRange(range);
|
||||||
}
|
try {
|
||||||
|
document.execCommand('copy');
|
||||||
const range = document.createRange();
|
copyingDone();
|
||||||
range.selectNodeContents(codeblock);
|
} catch (e) { };
|
||||||
const selection = window.getSelection();
|
selection.removeRange(range);
|
||||||
selection.removeAllRanges();
|
|
||||||
selection.addRange(range);
|
|
||||||
try {
|
|
||||||
document.execCommand('copy');
|
|
||||||
copyingDone();
|
|
||||||
} catch (e) { };
|
|
||||||
selection.removeRange(range);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (container.classList.contains("highlight")) {
|
|
||||||
container.appendChild(copybutton);
|
|
||||||
} else if (container.parentNode.firstChild == container) {
|
|
||||||
// td containing LineNos
|
|
||||||
} else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") {
|
|
||||||
// table containing LineNos and code
|
|
||||||
codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton);
|
|
||||||
} else {
|
|
||||||
// code blocks not having highlight as parent class
|
|
||||||
codeblock.parentNode.appendChild(copybutton);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (container.classList.contains("highlight")) {
|
||||||
|
container.appendChild(copybutton);
|
||||||
|
} else if (container.parentNode.firstChild == container) {
|
||||||
|
// td containing LineNos
|
||||||
|
} else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") {
|
||||||
|
// table containing LineNos and code
|
||||||
|
codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton);
|
||||||
|
} else {
|
||||||
|
// code blocks not having highlight as parent class
|
||||||
|
codeblock.parentNode.appendChild(copybutton);
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
@ -123,5 +123,5 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if not (.Param "noComments") }}
|
{{- if not (.Param "noComments") }}
|
||||||
{{ partial "comments_js.html" . }}
|
{{- partial "comments_js.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue