mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-12-03 03:48:55 -05:00
some cleanup around hugo + webpack manifest
This commit is contained in:
@@ -36,10 +36,10 @@
|
||||
<script>(function(d){var u=d.document,f=u.body.classList,e=localStorage,c="dark_mode_pref",t=e.getItem(c),a="dark",n="light",r="{{ .Site.Params.Theme.defaultTheme | safeJS }}",o=u.querySelector(".dark-mode-toggle"),i=r===a,b=function(d){f.remove(a,n);f.add(d);i=d===a};t===a&&b(a);t===n&&b(n);if(!t){var s=function(d){return"(prefers-color-scheme: "+d+")"};d.matchMedia(s(a)).matches?b(a):d.matchMedia(s(n)).matches?b(n):b(r);d.matchMedia(s(a)).addListener((function(d){d.matches&&b(a)}));d.matchMedia(s(n)).addListener((function(d){d.matches&&b(n)}))}if(o){o.style.display="block";o.addEventListener("click",(function(){if(i){b(n);e.setItem(c,n)}else{b(a);e.setItem(c,a)}}),!0)}})(window)</script>
|
||||
|
||||
{{ with .Site.Data.manifest }}
|
||||
{{ with index . "main.js" }}
|
||||
{{ with index . "main.js" -}}
|
||||
<script async defer src="{{ .src | absURL }}" ></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -50,20 +50,22 @@
|
||||
|
||||
|
||||
{{/* If this is a page/post, link View Source to specific file on GitHub; otherwise, just link to repo homepage */}}
|
||||
{{- with .Site.Params.social.githubRepo }}
|
||||
{{- $githubURL := print "https://github.com/" . }}
|
||||
{{- if not $.IsPage }}
|
||||
{{- $.Scratch.Set "sourceURL" $githubURL }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "sourceURL" (print $githubURL "/blob/main/content/" $.File.Path) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Site.Params.social.githubRepo -}}
|
||||
{{- $githubURL := print "https://github.com/" . -}}
|
||||
{{- if not $.IsPage -}}
|
||||
{{- $.Scratch.Set "sourceURL" $githubURL -}}
|
||||
{{- else -}}
|
||||
{{- $.Scratch.Set "sourceURL" (print $githubURL "/blob/main/content/" $.File.Path) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/* Chooses and initializes various images for use by JSON schema & open graph tags */}}
|
||||
{{/* Author image (default) */}}
|
||||
{{- with index .Site.Data.manifest .Site.Author.image -}}
|
||||
{{- $.Scratch.Set "authorImage" (dict "Permalink" (absURL .src) "Width" 1200 "Height" 1200 "MediaType" "image/jpeg") -}}
|
||||
{{- with .Site.Data.manifest -}}
|
||||
{{- with index . $.Site.Author.image -}}
|
||||
{{- $.Scratch.Set "authorImage" (dict "Permalink" (absURL .src) "Width" 1200 "Height" 1200 "MediaType" "image/jpeg") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{/* Page image (via frontmatter) */}}
|
||||
{{- with .Params.image -}}
|
||||
@@ -77,6 +79,8 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{/* Site logo */}}
|
||||
{{- with index .Site.Data.manifest .Site.Params.image -}}
|
||||
{{- $.Scratch.Set "logoImage" (dict "Permalink" (absURL .src) "Width" 2048 "Height" 2048 "MediaType" "image/png") -}}
|
||||
{{- with .Site.Data.manifest -}}
|
||||
{{- with index . $.Site.Params.image -}}
|
||||
{{- $.Scratch.Set "logoImage" (dict "Permalink" (absURL .src) "Width" 2048 "Height" 2048 "MediaType" "image/png") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{{ partial "head/meta" . -}}
|
||||
{{ partial "head/open-graph" . -}}
|
||||
{{ partialCached "head/mobile" . -}}
|
||||
{{ partial "head/canonical" . -}}
|
||||
{{ partialCached "head/preload" . -}}
|
||||
{{ partial "head/styles" . -}}
|
||||
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32" "manifest" .Site.Data.manifest) -}}
|
||||
{{ partialCached "head/feeds" . -}}
|
||||
{{ partial "head/canonical" . -}}
|
||||
{{ partialCached "head/favicons" . -}}
|
||||
{{ partialCached "head/misc" . -}}
|
||||
{{ partial "head/schema" . -}}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
{{ if .Site.Params.social.webmentionIO }}
|
||||
<link rel="webmention" href="{{ "/api/mention/" | absURL }}">
|
||||
<link rel="pingback" href="{{ "/api/ping/" | absURL }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="canonical" href="{{ print .Site.Params.baseURL .Permalink }}">
|
||||
|
||||
<link rel="author" href="{{ "humans.txt" | absURL }}">
|
||||
<link rel="pgpkey" href="{{ "pubkey.asc" | absURL }}" type="application/pgp-keys">
|
||||
<link rel="alternate" href="{{ "feed.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }} (RSS)">
|
||||
<link rel="alternate" href="{{ "feed.atom" | absURL }}" type="application/atom+xml" title="{{ .Site.Title }} (Atom)">
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{{- $s := slice -}}
|
||||
{{- range (split .icoSizes " ") }}{{ $s = $s | append (printf "%vx%v" . .) }}{{ end -}}
|
||||
{{- $faviconIco := index .manifest "images/favicon.ico" }}
|
||||
<link rel="icon" href="{{ $faviconIco.src | absURL }}"> <!-- sizes="{{ delimit $s " " }}" -->
|
||||
{{ with .Site.Data.manifest }}
|
||||
{{- with index . "images/favicon.ico" }}
|
||||
<link rel="icon" href="{{ .src | absURL }}">
|
||||
{{- end }}
|
||||
|
||||
{{- $faviconSvg := index .manifest "images/favicon.svg" }}
|
||||
<link rel="icon" href="{{ $faviconSvg.src | absURL }}" type="image/svg+xml">
|
||||
{{- with index . "images/favicon.svg" }}
|
||||
<link rel="icon" href="{{ .src | absURL }}" type="image/svg+xml">
|
||||
{{- end -}}
|
||||
|
||||
{{- $appleIcon := index .manifest "images/apple-touch-icon.png" }}
|
||||
<link rel="apple-touch-icon" href="{{ $appleIcon.src | absURL }}" sizes="180x180">
|
||||
{{- with index . "images/apple-touch-icon.png" }}
|
||||
<link rel="apple-touch-icon" href="{{ .src | absURL }}" sizes="180x180">
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<link rel="alternate" href="{{ "feed.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }} (RSS)">
|
||||
<link rel="alternate" href="{{ "feed.atom" | absURL }}" type="application/atom+xml" title="{{ .Site.Title }} (Atom)">
|
||||
7
layouts/partials/head/misc.html
Normal file
7
layouts/partials/head/misc.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ if .Site.Params.social.webmentionIO }}
|
||||
<link rel="webmention" href="{{ "/api/mention/" | absURL }}">
|
||||
<link rel="pingback" href="{{ "/api/ping/" | absURL }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="author" href="{{ "humans.txt" | absURL }}">
|
||||
<link rel="pgpkey" href="{{ "pubkey.asc" | absURL }}" type="application/pgp-keys">
|
||||
@@ -1,8 +1,10 @@
|
||||
<header>
|
||||
<nav>
|
||||
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" rel="me author" aria-label="{{ .Site.Title }}">
|
||||
{{ with index .Site.Data.manifest "images/tiny-selfie.jpg" }}
|
||||
<img id="selfie" src="{{ .src | absURL }}" width="54" height="54" alt="Photo of Jake Jarvis">
|
||||
{{ with .Site.Data.manifest }}
|
||||
{{ with index . "images/tiny-selfie.jpg" }}
|
||||
<img id="selfie" src="{{ .src | absURL }}" width="54" height="54" alt="Photo of Jake Jarvis">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<span id="name">{{ .Site.Title }}</span>
|
||||
|
||||
Reference in New Issue
Block a user