change to hugo-blog-awesome theme
This commit is contained in:
parent
113e3650f1
commit
15b6142a8e
131 changed files with 5895 additions and 124 deletions
2
themes/hugo-blog-awesome/layouts/partials/meta/main.html
Normal file
2
themes/hugo-blog-awesome/layouts/partials/meta/main.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
{{ partial "meta/standard.html" . }}
|
||||
{{ partial "meta/post.html" . }}
|
62
themes/hugo-blog-awesome/layouts/partials/meta/post.html
Normal file
62
themes/hugo-blog-awesome/layouts/partials/meta/post.html
Normal file
|
@ -0,0 +1,62 @@
|
|||
{{/* These meta tags are rendered only in the posts section (i.e. in single/list page) */}}
|
||||
{{ if eq .Section "posts" }}
|
||||
{{ $ISO_date := dateFormat "2006-01-02T15:04:05Z0700" .Date | safeHTML }}
|
||||
<!-- Pagination meta tags for list pages only -->
|
||||
{{ if ne .Page.Kind "page" }}
|
||||
{{ $paginator := .Paginate (where .Pages "Section" "blog") }}
|
||||
{{ if $paginator }}
|
||||
<link rel="first" href="{{ $paginator.First.URL }}" />
|
||||
<link rel="last" href="{{ $paginator.Last.URL }}" />
|
||||
{{ if $paginator.HasPrev }}
|
||||
<link rel="prev" href="{{ $paginator.Prev.URL }}" />
|
||||
{{end }}
|
||||
{{ if $paginator.HasNext }}
|
||||
<link rel="next" href="{{ $paginator.Next.URL }}" />
|
||||
{{end }}
|
||||
{{end }}
|
||||
{{end }}
|
||||
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:article:published_time" content={{ $ISO_date | safeHTML }} />
|
||||
<meta property="article:published_time" content={{ $ISO_date | safeHTML }} />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
|
||||
{{ with.Site.Params.author }}
|
||||
<meta property="og:article:author" content="{{ .name }}" />
|
||||
<meta property="article:author" content="{{ .name }}" />
|
||||
<meta name="author" content="{{ .name }}" />
|
||||
{{ with.fediverseAccount }}
|
||||
<meta name="fediverse:creator" content="{{ . }}" />{{/* ref https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/ */}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with.Params.category }}
|
||||
<meta name="news_keywords" content="{{ index . 0 }}" />
|
||||
<meta property="article:section" content="{{ index . 0 }}" />
|
||||
{{ end }}
|
||||
|
||||
<script defer type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "Article",
|
||||
"headline": {{ .Title }},
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Params.github }}"
|
||||
},
|
||||
"datePublished": "{{ dateFormat "2006-01-02" .Date }}",
|
||||
"description": {{ .Description }},
|
||||
"wordCount": {{ .WordCount }},
|
||||
"mainEntityOfPage": "True",
|
||||
"dateModified": "{{ dateFormat "2006-01-02" .Lastmod }}",
|
||||
"image": {
|
||||
"@type": "imageObject",
|
||||
"url": "{{ with .Params.image }}{{ . | absURL }}{{ end }}"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "{{ .Site.Title }}"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
50
themes/hugo-blog-awesome/layouts/partials/meta/standard.html
Normal file
50
themes/hugo-blog-awesome/layouts/partials/meta/standard.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<meta charset="utf-8">
|
||||
<meta http-equiv="content-type" content="text/html">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title itemprop="name">{{ .Title }} | {{ .Site.Title }}</title>
|
||||
<meta property="og:title" content="{{ .Title }} | {{ .Site.Title }}" />
|
||||
<meta name="twitter:title" content="{{ .Title }} | {{ .Site.Title }}" />
|
||||
<meta itemprop="name" content="{{ .Title }} | {{ .Site.Title }}" />
|
||||
<meta name="application-name" content="{{ .Title }} | {{ .Site.Title }}" />
|
||||
<meta property="og:site_name" content="{{ .Site.Params.sitename }}" />
|
||||
|
||||
{{/* Define empty variable description */}}
|
||||
{{- $description := "" -}}
|
||||
|
||||
{{/* If description is defined in front matter, use it */}}
|
||||
{{- if .Params.description -}}
|
||||
{{- $description = trim .Params.description "\n" -}}
|
||||
{{/* If description is not defined in front matter, use site description */}}
|
||||
{{- else if .Site.Params.description -}}
|
||||
{{- $description = trim .Site.Params.description "\n" -}}
|
||||
{{- end -}}
|
||||
|
||||
<meta name="description" content="{{ $description }}">
|
||||
<meta itemprop="description" content="{{ $description }}" />
|
||||
<meta property="og:description" content="{{ $description }}" />
|
||||
<meta name="twitter:description" content="{{ $description }}" />
|
||||
|
||||
<meta property="og:locale" content="{{ .Site.LanguageCode }}" />
|
||||
<meta name="language" content="{{ .Site.LanguageCode }}" />
|
||||
{{ range .AllTranslations }}
|
||||
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}" />
|
||||
{{ end }}
|
||||
|
||||
{{/* Define empty variable image */}}
|
||||
{{- $image := "" -}}
|
||||
|
||||
{{/* If image is defined in front matter, use it */}}
|
||||
{{- if .Params.image -}}
|
||||
{{- $image = .Params.image -}}
|
||||
{{/* If image is not defined in front matter, use site ogimage */}}
|
||||
{{- else if .Site.Params.ogimage -}}
|
||||
{{- $image = .Site.Params.ogimage -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $image -}}
|
||||
<meta itemprop="image" content="{{ $image | absURL }}" />
|
||||
<meta property="og:image" content="{{ $image | absURL }}" />
|
||||
<meta name="twitter:image" content="{{ $image | absURL }}" />
|
||||
<meta name="twitter:image:src" content="{{ $image | absURL }}" />
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue