Add URL fragments in build time
This commit is contained in:
@@ -36,10 +36,4 @@ const toggleToc = () => {
|
|||||||
if (header !== null) {
|
if (header !== null) {
|
||||||
listen('#menu-btn', "click", toggleMobileMenu);
|
listen('#menu-btn', "click", toggleMobileMenu);
|
||||||
listen('#toc-btn', "click", toggleToc);
|
listen('#toc-btn', "click", toggleToc);
|
||||||
|
|
||||||
document.querySelectorAll('.post-year').forEach((ele)=> {
|
|
||||||
ele.addEventListener('click', () => {
|
|
||||||
window.location.hash = '#' + ele.id;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range .Data.Pages.GroupByDate "2006" }}
|
{{- range .Data.Pages.GroupByDate "2006" }}
|
||||||
<div class="posts-group">
|
<div class="posts-group">
|
||||||
<div class="post-year" id="{{ .Key }}">{{ .Key }}</div>
|
<div class="post-year"><a href="#{{ .Key }}">{{ .Key }}</a></div>
|
||||||
<ul class="posts-list">
|
<ul class="posts-list">
|
||||||
{{- range .Pages }}
|
{{- range .Pages }}
|
||||||
<li class="post-item">
|
<li class="post-item">
|
||||||
|
|||||||
Reference in New Issue
Block a user