This commit is contained in:
Robert Kaussow 2020-07-25 13:53:27 +02:00
parent 07f124360d
commit fd7c3a72c1
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
4 changed files with 24 additions and 16 deletions

View File

@ -119,7 +119,7 @@ enableGitInfo = true
# (Optional, default true) Copy anchor url to clipboard on click.
geekblogAnchorCopy = true
# (Optional, default none) Sites main author, used for the site author filed in Atom feeds.
# (Optional, default none) Sites main author.
geekblogAuthor = "john-doe"
# (Optional, default none) Adds a "Hosted on <provider>" line to the footer.
@ -230,7 +230,7 @@ params:
# (Optional, default true) Copy anchor url to clipboard on click.
geekblogAnchorCopy: true
# (Optional, default none) Sites main author, used for the site author filed in Atom feeds.
# (Optional, default none) Sites main author.
geekblogAuthor: john-doe
# (Optional, default none) Adds a "Hosted on <provider>" line to the footer.

View File

@ -1,13 +1,15 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
{{ $keywords := default .Site.Params.Keywords .Keywords }}
{{ $author := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
{{ with $description }}
<meta name="description" content="{{ . }}">
<meta name="description" content="{{ . }}">
{{ end }}
{{ with $keywords }}
<meta name="keywords" content="{{ delimit . "," }}">
<meta name="keywords" content="{{ delimit . "," }}">
{{ end }}
{{ with $author }}
{{ $authors := slice }}

View File

@ -5,6 +5,4 @@
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end }}
{{ "<!--" | safeHTML }}
Made with Geekblog theme https://github.com/xoxys/hugo-geekblog
{{- "-->" | safeHTML }}
{{ printf "<!-- %s -->" "Made with Geekblog theme https://github.com/xoxys/hugo-geekblog" | safeHTML }}

View File

@ -8,13 +8,19 @@
{{- end }}
"name": "{{ .Site.Title }}",
"url": "{{ .Site.BaseURL }}",
"description": "{{ .Site.Params.description }}",
"thumbnailUrl": "{{ (default "brand.svg" .Site.Params.logo) | absURL }}"{{ with .Site.Params.GeekblogContentLicense }},
"license": "{{ .name }}"{{ end }}
{{- with .Site.Params.description }}
"description": "{{ . }}",
{{- end }}
"thumbnailUrl": "{{ (default "brand.svg" .Site.Params.logo) | absURL }}"
{{- with .Site.Params.GeekblogContentLicense }},
"license": "{{ .name }}"
{{- end }}
}
</script>
{{ else if .IsPage }}
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
{{ $images := default (slice (default "brand.svg" .Site.Params.logo)) .Params.images }}
{{ $description := default .Site.Params.description (default .Description .Summary) }}
{{ $ac := 0 }}
{{ $ac_max := default 0 (len $authors) }}
<script type="application/ld+json">
@ -25,15 +31,17 @@
"name": "{{ .Title | safeJS }}",
"headline": "{{ .Title | safeJS }}",
"alternativeHeadline": "{{ .Params.lead }}",
"description": "{{ if .Description }}{{ .Description | safeJS }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}",
{{- with $description }}
"description": "{{ . }}",
{{- end }}
"inLanguage": {{ .Site.Language.Lang }},
"isFamilyFriendly": "true",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- with $authors }}
"author" : [
{{- with $authors -}}
{{- range sort . }}
{{- $ac = (add $ac 1) }}
{{- $author := index $.Site.Data.authors . }}
@ -41,9 +49,9 @@
"@type": "Person",
"name": "{{ $author.name }}"
}{{ if lt $ac $ac_max }},{{ end }}
{{- end -}}
{{- end }}
{{- end }}
],
{{- end }}
"copyrightHolder" : "{{ .Site.Title }}",
"copyrightYear" : "{{ .Date.Format "2006" }}",
"dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
@ -60,10 +68,10 @@
"height":"32"
}
},
"image": {{ if .Params.images }}[{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ $e | absURL }}{{ end }}]{{ else}}{{.Site.Params.logo | absURL }}{{ end }},
"image": [{{ range $i, $image := $images }}{{ if $i }}, {{ end }}{{ $image | absURL }}{{ end }}],
"url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}",
"genre" : [ {{ range $index, $tag := .Params.tags }}{{ if $index }}, {{ end }}"{{ $tag }}" {{ end }}]
"genre" : [ {{ range $i, $tag := .Params.tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}]
}
</script>
{{ end }}