diff options
author | tdro <tdro@noreply.example.com> | 2023-04-08 14:35:37 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-04-08 14:41:40 -0400 |
commit | f0cbdec755e91fc3f02e96b03e1fc200b135815e (patch) | |
tree | 99e50fdc96d611424e1068818fd05ec6a6a3fd31 /themes/default | |
parent | 14b385a14f3a886cc47200a88e69626c2befe799 (diff) | |
download | canory-f0cbdec755e91fc3f02e96b03e1fc200b135815e.tar.gz canory-f0cbdec755e91fc3f02e96b03e1fc200b135815e.tar.bz2 canory-f0cbdec755e91fc3f02e96b03e1fc200b135815e.zip |
static/js: Add update check
In the case of heavy caching attempt a naive site update check with voluntary
refresh. Not fully idempotent?
Diffstat (limited to 'themes/default')
-rw-r--r-- | themes/default/layouts/partials/base-head.html | 23 | ||||
-rw-r--r-- | themes/default/layouts/partials/navigator-middle.html | 37 |
2 files changed, 36 insertions, 24 deletions
diff --git a/themes/default/layouts/partials/base-head.html b/themes/default/layouts/partials/base-head.html index 9decdac..acedcf0 100644 --- a/themes/default/layouts/partials/base-head.html +++ b/themes/default/layouts/partials/base-head.html @@ -7,20 +7,18 @@ {{- $author := partial "function-authors-data.html" (dict "Data" $authorData) -}} +{{- $noindex := "" -}} +{{- if or .Params.Feed .Params.Unlisted .Params.ExpiryDate -}} + {{- $noindex = "noindex,nofollow" -}} +{{- end }} + <!-- HTML Meta Tags --> <meta charset="utf-8" /> <meta name="author" content="{{ $author.name -}}" /> -{{ if or .Params.Feed .Params.Unlisted .Params.ExpiryDate -}} -<meta name="robots" content="noindex,nofollow" /> -{{- else -}} -<meta name="robots" content="{{ or .Site.Params.site.robots "index,follow" }}" /> -{{- end }} +<meta name="robots" content="{{ or $noindex .Site.Params.site.robots "index,follow" }}" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="keywords" content="{{- partial "base-title.html" . -}}" /> <meta name="generator" content="Hugo {{ hugo.Version }}" /> -{{ with .Site.Params.site.refresh -}} -<meta http-equiv="refresh" content="{{ . }}" /> -{{- end }} <!-- Search Engine Tags --> <meta itemprop="name" content="{{ partial "base-title.html" . -}}" /> @@ -42,12 +40,17 @@ <meta name="twitter:description" content="{{- partial "base-description.html" . -}}" /> <meta name="twitter:image" content="{{ .Site.BaseURL }}/{{ $author.user -}}/media/profile/picture.png" /> -<!-- Search Verification --> -{{- partial "base-search.html" . -}} +<!-- Extra Meta Tags --> +<meta name='base-url' content="{{ "" | absURL }}" /> +<meta name='refresh' content="{{ .Site.Params.site.refresh.milliseconds }}" /> +<meta name='last-modified' content="{{ now.UTC.Format "Mon, 02 Jan 2006 15:04:05 GMT" }}" /> <!-- Link Tags --> <link rel="home" href="{{ .Site.BaseURL }}/{{ $author.user }}/" /> +<!-- Search Verification --> +{{- partial "base-search.html" . -}} + <!-- Feed Discovery --> {{- partial "base-discovery.html" . -}} diff --git a/themes/default/layouts/partials/navigator-middle.html b/themes/default/layouts/partials/navigator-middle.html index 46c4060..688963a 100644 --- a/themes/default/layouts/partials/navigator-middle.html +++ b/themes/default/layouts/partials/navigator-middle.html @@ -1,22 +1,28 @@ -{{ $id := .Id }} -{{ $href := .Href }} +{{- $id := .Id -}} +{{- $href := .Href -}} +{{- $icon := readFile (print (partial "function-paths.html").static "/icons/feather/arrow-up.svg") -}} +{{- $refresh := readFile (print (partial "function-paths.html").static "/icons/feather/refresh-cw.svg") -}} +{{- $label := "Top" -}} + +{{- with .Icon -}} + {{- $icon = readFile (print (partial "function-paths.html").static "/icons/feather/" . ".svg") -}} +{{- end -}} + +{{- with .IconLabel -}} + {{- $label = . -}} +{{- end -}} <nav> <icon-button> <a + data-update="" id="{{ or $id "top" }}" href="{{ or $href "#" }}" > - {{ with .Icon }} - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/" . ".svg")) }} - {{ else }} - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-up.svg")) }} - {{ end }} - {{ with .IconLabel }} - <small>{{ . }}</small> - {{ else }} - <small>Top</small> - {{ end }} + {{ safeHTML $icon }} + {{ safeHTML $refresh }} + <small>{{ $label }}</small> + <small>Refresh</small> </a> </icon-button> @@ -48,7 +54,8 @@ <search-entry id="search-frame"> <form id="search-form" - action="https://lite.duckduckgo.com/lite/"> + action="https://lite.duckduckgo.com/lite/" + > <input required id="search-input" name="q" @@ -68,4 +75,6 @@ </search-entry> </nav> -<navigation-separator><hr hidden></navigation-separator> +<navigation-separator> + <hr hidden /> +</navigation-separator> |