mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-08 01:22:29 +00:00
Switch themes to minimo
This commit is contained in:
1
themes/minimo/layouts/partials/head/analytics.html
Normal file
1
themes/minimo/layouts/partials/head/analytics.html
Normal file
@@ -0,0 +1 @@
|
||||
{{- template "_internal/google_analytics_async.html" . -}}
|
3
themes/minimo/layouts/partials/head/css.html
Normal file
3
themes/minimo/layouts/partials/head/css.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<style>
|
||||
:root{--color-accent: {{- .Site.Params.settings.accentColor | default "#ffcd00" -}};}
|
||||
</style>
|
5
themes/minimo/layouts/partials/head/extra.html
Normal file
5
themes/minimo/layouts/partials/head/extra.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{/*
|
||||
If you need to add content to your page header, override this template in your
|
||||
blog by creating a file named `/layout/partials/head/extra.html`. This way you
|
||||
don't have to edit the theme itself.
|
||||
*/}}
|
11
themes/minimo/layouts/partials/head/head.html
Normal file
11
themes/minimo/layouts/partials/head/head.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<head>
|
||||
{{ partial "head/meta" . }}
|
||||
<title>{{ partial "data/title" . }}</title>
|
||||
<link rel='canonical' href='{{ .Permalink }}'>
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
||||
{{ end }}
|
||||
{{ partial "head/hreflang" . }}
|
||||
{{ partial "head/includes" . }}
|
||||
{{ partial "head/extra" . }}
|
||||
</head>
|
20
themes/minimo/layouts/partials/head/hreflang.html
Normal file
20
themes/minimo/layouts/partials/head/hreflang.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- define "hreflang_x" -}}
|
||||
<link rel='alternate' hreflang='{{ .Lang }}' href='{{ .Permalink }}'>
|
||||
{{- end -}}
|
||||
|
||||
{{- define "hreflang_x_default" -}}
|
||||
{{- if eq .Lang ( index .Site.Languages 0 ).Lang -}}
|
||||
<link rel='alternate' hreflang='x-default' href='{{ .Permalink }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .IsTranslated -}}
|
||||
|
||||
{{- template "hreflang_x" . -}}
|
||||
{{- template "hreflang_x_default" . -}}
|
||||
{{- range .Translations -}}
|
||||
{{- template "hreflang_x" . -}}
|
||||
{{- template "hreflang_x_default" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
14
themes/minimo/layouts/partials/head/includes.html
Normal file
14
themes/minimo/layouts/partials/head/includes.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<link rel='icon' href='{{ ( or .Site.Params.assets.favicon "favicon.ico" ) | relURL }}'>
|
||||
<link rel='stylesheet' href='{{ print "/assets/css/" .Site.Data.assets.main.css | relURL }}'>
|
||||
|
||||
{{- if or ( .Site.Params.settings.rtl ) ( eq .Site.Language.LanguageDirection "rtl" ) -}}
|
||||
<link rel='stylesheet' href='{{ print "/assets/css/" .Site.Data.assets.rtl.css | relURL }}'>
|
||||
{{- end -}}
|
||||
|
||||
{{- range .Site.Params.assets.customCSS -}}
|
||||
<link rel='stylesheet' href='{{ . | relURL }}'>
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "head/css" . -}}
|
||||
|
||||
{{- partial "head/analytics" . -}}
|
8
themes/minimo/layouts/partials/head/meta.html
Normal file
8
themes/minimo/layouts/partials/head/meta.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||
<meta name='description' content='{{ partial "data/description" . }}'>
|
||||
<meta name='theme-color' content='{{- .Site.Params.settings.accentColor | default "#ffcd00" -}}'>
|
||||
|
||||
{{ partial "head/opengraph" . }}
|
||||
|
||||
{{ hugo.Generator }}
|
114
themes/minimo/layouts/partials/head/opengraph.html
Normal file
114
themes/minimo/layouts/partials/head/opengraph.html
Normal file
@@ -0,0 +1,114 @@
|
||||
<meta property='og:title' content='{{ partial "data/title" . }}'>
|
||||
<meta property='og:description' content='{{ partial "data/description" . }}'>
|
||||
<meta property='og:url' content='{{ .Permalink }}'>
|
||||
<meta property='og:site_name' content='{{ .Site.Title }}'>
|
||||
<meta property='og:type' content='
|
||||
{{- if .IsPage -}}
|
||||
article
|
||||
{{- else -}}
|
||||
website
|
||||
{{- end -}}
|
||||
'>
|
||||
|
||||
{{- with .Params.cover -}}
|
||||
{{- $type := ( printf "%T" . ) -}}
|
||||
{{- $isMap := ( not ( eq $type "string" ) ) -}}
|
||||
|
||||
{{- $image := "" -}}
|
||||
{{- if $isMap -}}
|
||||
{{- $image = .image -}}
|
||||
{{- else -}}
|
||||
{{- $image = . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $image = ( replaceRE "^\\./" $.RelPermalink $image ) -}}
|
||||
|
||||
<meta property='og:image' content='{{- $image | absURL -}}'>
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.images -}}
|
||||
{{- range first 5 . -}}
|
||||
<meta property='og:image' content='{{ ( replaceRE "^\\./" $.RelPermalink . ) | absURL }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not ( or .Params.images .Params.cover ) -}}
|
||||
{{- range $authorID := .Params.authors -}}
|
||||
{{- $author := ( index $.Site.Data.authors $authorID ) -}}
|
||||
{{- with $author -}}
|
||||
{{- if or .social.email ( and .email.username .email.host ) -}}
|
||||
<meta property='og:image' content='https://www.gravatar.com/avatar/
|
||||
{{- with .social.email -}}
|
||||
{{- . | md5 -}}
|
||||
{{- else -}}
|
||||
{{- with .email -}}
|
||||
{{- ( print .username "@" .host ) | md5 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
?s=256'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.audios -}}
|
||||
{{- range first 5 . -}}
|
||||
<meta property='og:audio' content='{{ ( replaceRE "^\\./" $.RelPermalink . ) | absURL }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.videos -}}
|
||||
{{- range first 5 . -}}
|
||||
<meta property='og:video' content='{{ ( replaceRE "^\\./" $.RelPermalink . ) | absURL }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .IsPage -}}
|
||||
{{- range $authorID := .Params.authors -}}
|
||||
{{- $author := ( index $.Site.Data.authors $authorID ) -}}
|
||||
{{- with $author.social.facebook -}}
|
||||
<meta property='article:author' content='https://facebook.com/{{ . }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Site.Params.opengraph.facebook.pageid -}}
|
||||
<meta property='article:publisher' content='{{ . }}'>
|
||||
{{- end -}}
|
||||
|
||||
<meta property='article:section' content='{{- .Section -}}'>
|
||||
{{- range .Params.tags -}}
|
||||
<meta property='article:tag' content='{{ . }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $dateFormat := "2006-01-02T15:04:05Z07:00" -}}
|
||||
{{- if .IsPage -}}
|
||||
{{- if not .PublishDate.IsZero -}}
|
||||
<meta property='article:published_time' content='{{ .PublishDate.Format $dateFormat }}'/>
|
||||
{{- else if not .Date.IsZero -}}
|
||||
<meta property='article:published_time' content='{{ .Date.Format $dateFormat }}'/>
|
||||
{{- end -}}
|
||||
|
||||
{{- if not .Lastmod.IsZero -}}
|
||||
<meta property='article:modified_time' content='{{ .Lastmod.Format $dateFormat }}'/>
|
||||
{{- end -}}
|
||||
|
||||
{{- if not .ExpiryDate.IsZero -}}
|
||||
<meta property='article:expiration_time' content='{{ .ExpiryDate.Format $dateFormat }}'/>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not .Site.LastChange.IsZero -}}
|
||||
<meta property='og:updated_time' content='{{ .Site.LastChange.Format $dateFormat }}'/>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Site.Params.opengraph.facebook -}}
|
||||
{{- with .appid -}}
|
||||
<meta property='fb:app_id' content='{{ . }}'>
|
||||
{{- end -}}
|
||||
{{- range .admins -}}
|
||||
<meta property='fb:admins' content='{{ . }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- partial "head/opengraph/twitter" . -}}
|
33
themes/minimo/layouts/partials/head/opengraph/twitter.html
Normal file
33
themes/minimo/layouts/partials/head/opengraph/twitter.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<meta name='twitter:card' content='summary{{- if .Params.cover -}}_large_image{{- end -}}'>
|
||||
|
||||
{{- with .Site.Params.opengraph.twitter.page -}}
|
||||
<meta name='twitter:site' content='@{{- . -}}'>
|
||||
{{- end -}}
|
||||
|
||||
{{- range $authorID := .Params.authors -}}
|
||||
{{- $author := ( index $.Site.Data.authors $authorID ) -}}
|
||||
{{- with $author.social.twitter -}}
|
||||
<meta name='twitter:creator' content='@{{- . -}}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Params.cover -}}
|
||||
{{- $type := ( printf "%T" . ) -}}
|
||||
{{- $isMap := ( not ( eq $type "string" ) ) -}}
|
||||
|
||||
{{- $image := "" -}}
|
||||
{{- if $isMap -}}
|
||||
{{- $image = .image -}}
|
||||
{{- else -}}
|
||||
{{- $image = . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $image = ( replaceRE "^\\./" $.RelPermalink $image ) -}}
|
||||
|
||||
<meta property='twitter:image' content='{{- $image | absURL -}}'>
|
||||
{{- if $isMap -}}
|
||||
{{- with .caption -}}
|
||||
<meta property='twitter:image:alt' content='{{ . | markdownify }}'>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user