mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2025-07-20 01:42:36 +02:00
updated by original repo
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
<!--
|
||||
to add comments read => https://gohugo.io/content-management/comments/
|
||||
-->
|
||||
{{- template "_internal/disqus.html" . -}}
|
||||
<!-- Comments area end -->
|
@@ -9,7 +9,7 @@
|
||||
<span>·</span>
|
||||
<span>Theme <a href="https://git.io/hugopapermod" rel="noopener" target="_blank">PaperMod</a></span>
|
||||
</footer>
|
||||
<a href="#top" aria-label="go to top" title="Go to Top" accesskey="g">
|
||||
<a aria-label="go to top" title="Go to Top" accesskey="g">
|
||||
<button class="top-link" id="top-link" type="button">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6">
|
||||
<path d="M12 6H0l6-6z" /></svg>
|
||||
@@ -32,15 +32,6 @@
|
||||
document.getElementById('menu').scrollLeft = localStorage.getItem("menu-scroll-position");
|
||||
}
|
||||
}
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
var id = this.getAttribute("href").substr(1);
|
||||
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
|
||||
behavior: "smooth"
|
||||
});
|
||||
});
|
||||
});
|
||||
var mybutton = document.getElementById("top-link");
|
||||
window.onscroll = function () {
|
||||
if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
|
||||
@@ -51,6 +42,11 @@
|
||||
mybutton.style.opacity = "0";
|
||||
}
|
||||
};
|
||||
mybutton.onclick = function () {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
window.location.hash = ''
|
||||
}
|
||||
|
||||
function menu_on_scroll() {
|
||||
localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft);
|
||||
|
@@ -29,6 +29,22 @@
|
||||
{{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify -}}
|
||||
<link href="{{ $stylesheet.Permalink }}" rel="preload stylesheet" as="style">
|
||||
{{- end}}
|
||||
<!-- Search -->
|
||||
{{- if (eq .Layout `search`) -}}
|
||||
<link rel="preload" as="fetch" href="../index.json" crossOrigin="anonymous">
|
||||
{{- $fastsearch := resources.Get "js/fastsearch.js" }}
|
||||
{{- $fusejs := resources.Get "js/fuse.js" }}
|
||||
{{- if not .Site.Params.assets.disableFingerprinting }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }}
|
||||
<script defer src="{{ $search.Permalink }}" rel="preload" as="script" onload="loadSearch();"
|
||||
integrity="{{ $search.Data.Integrity }}">
|
||||
</script>
|
||||
{{- else}}
|
||||
{{ $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
|
||||
<script defer src="{{ $search.Permalink }}" rel="preload" as="script" onload="loadSearch();"></script>
|
||||
{{- end}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Favicons -->
|
||||
<link rel="icon" href="{{- .Site.Params.assets.favicon | default "favicon.ico" | absURL -}}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="
|
||||
|
Reference in New Issue
Block a user