Update header.html and add support for Umami

- Updated header.html with necessary changes.
- Added support for Umami along with relevant configurable options.
- Included a new umami.html file for tracking.
This commit is contained in:
P家单推人 2024-07-29 08:38:28 +08:00 committed by jkfujr
parent 33198a8dd0
commit 095bd354c4
3 changed files with 13 additions and 3 deletions

View file

@ -23,3 +23,7 @@
{{ if hugo.IsProduction }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{ if .Site.Params.umami.enable }}
{{ partial "umami.html" . }}
{{ end }}

View file

@ -12,8 +12,8 @@
{{ with site.Params.menu }}
{{ range . }}
<p class="small {{ if eq .url $currentPage.Path }} bold {{end}}">
<a href="{{.url}}">
/{{.name }}
<a href="{{ .url }}" {{ if and (isset . "newTab") .newTab }}target="_blank" rel="noopener noreferrer"{{ end }}>
/{{ .name }}
</a>
</p>
{{ end }}
@ -22,4 +22,4 @@
{{ end }}
</div>
</div>

View file

@ -0,0 +1,6 @@
<script
async
defer
data-website-id="{{ .Site.Params.umami.websiteId }}"
src="{{ .Site.Params.umami.jsLocation }}"
></script>