diff --git a/assets/js/sandpoints.js b/assets/js/sandpoints.js index 9a72c0f..fbbbe2b 100644 --- a/assets/js/sandpoints.js +++ b/assets/js/sandpoints.js @@ -70,6 +70,14 @@ window.addEventListener('DOMContentLoaded', (e) => { window.scrollBy({top: document.querySelector('.header').clientHeight * -1.25, behavior: 'smooth'})}, 50); }) }) + + document.querySelectorAll('.anchors').forEach(i => { + i.addEventListener('click', e => { + setTimeout(() => { + window.scrollBy({ top: document.querySelector('.header').clientHeight * -1.25, behavior: 'smooth' }) + }, 50); + }) + }) }) toggleAllLinks = function () { diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index e886866..ed0b063 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1 +1 @@ -{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}{{- $t -}}{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}{{- $sup -}}⁄{{ .Text | safeHTML }}{{- end -}} \ No newline at end of file +{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}{{- $t -}}{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}{{- $sup -}}⁄{{ .Text | safeHTML }}{{- end -}} \ No newline at end of file