feat: add microformats (#214)
This commit is contained in:
parent
4bfc17ac9d
commit
1932053d5a
7 changed files with 79 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Code Blocks
|
||||
---
|
||||
|
||||
There are multiple ways to add code blocks. Most of them works out of the box only the Hugo shortcode `<highlight>` need some configuration to work properly.
|
||||
|
||||
{{< toc >}}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
title: Menus
|
||||
---
|
||||
|
||||
The theme supports two different kinds of menus. File-tree menu is the default one and does not require further configuration to work. If you want full control about your menu the bundle menu is a powerful option to accomplish it.
|
||||
|
||||
{{< toc >}}
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
<title>{{ if not (eq .Kind "home") }}{{ partial "title" . }} | {{ end }}{{ .Site.Title }}</title>
|
||||
|
||||
{{ partial "head/favicons" . }}
|
||||
{{ partial "head/rel-me" . }}
|
||||
{{ partial "head/microformats" . }}
|
||||
{{ partial "head/others" . }}
|
||||
{{ partial "head/schema" . }}
|
||||
{{ partial "head/custom" . }}
|
||||
</head>
|
||||
|
||||
|
|
2
layouts/partials/head/microformats.html
Normal file
2
layouts/partials/head/microformats.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
1
layouts/partials/head/rel-me.html
Normal file
1
layouts/partials/head/rel-me.html
Normal file
|
@ -0,0 +1 @@
|
|||
<!-- place to set your rel-me links https://microformats.org/wiki/rel-me -->
|
65
layouts/partials/head/schema.html
Normal file
65
layouts/partials/head/schema.html
Normal file
|
@ -0,0 +1,65 @@
|
|||
{{ if .IsHome -}}
|
||||
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index (default slice .Site.Params.images) 0) | absURL }}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": "{{ .Site.Title }}",
|
||||
"url": "{{ .Site.BaseURL }}",
|
||||
{{- with .Site.Params.description }}
|
||||
"description": "{{ . }}",
|
||||
{{- end }}
|
||||
"thumbnailUrl": "{{ $thumbnail }}"
|
||||
{{- with .Site.Params.GeekblogContentLicense }},
|
||||
"license": "{{ .name }}"
|
||||
{{- end }}
|
||||
}
|
||||
</script>
|
||||
{{ else if .IsPage }}
|
||||
{{ $description := default .Site.Params.description (default .Description .Summary) }}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "TechArticle",
|
||||
"articleSection": "{{ .Section }}",
|
||||
"name": "{{ .Title | safeJS }}",
|
||||
"headline": "{{ .Title | safeJS }}",
|
||||
"alternativeHeadline": "{{ .Params.lead }}",
|
||||
{{- with $description }}
|
||||
"description": "{{ . }}",
|
||||
{{- end }}
|
||||
"inLanguage": {{ .Site.Language.Lang }},
|
||||
"isFamilyFriendly": "true",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
},
|
||||
"copyrightHolder" : "{{ .Site.Title }}",
|
||||
"copyrightYear" : "{{ .Date.Format "2006" }}",
|
||||
"dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
|
||||
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
|
||||
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeJS }}",
|
||||
"publisher":{
|
||||
"@type":"Organization",
|
||||
"name": {{ .Site.Title }},
|
||||
"url": {{ .Site.BaseURL }},
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ (default "brand.svg" .Site.Params.logo) | absURL }}",
|
||||
"width":"32",
|
||||
"height":"32"
|
||||
}
|
||||
},
|
||||
{{- with $images := $.Resources.ByType "image" }}
|
||||
"image": [ {{ range $i, $image := $images }}{{ if $i }}, {{ end }}"{{ $image.Permalink | absURL }}" {{ end }}],
|
||||
{{- else }}
|
||||
{{- with $images := .Params.images }}
|
||||
"image": [ {{ range $i, $image := $images }}{{ if $i }}, {{ end }}"{{ $image | absURL }}" {{ end }}],
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
"url" : "{{ .Permalink }}",
|
||||
"wordCount" : "{{ .WordCount }}",
|
||||
"genre" : [ {{ range $i, $tag := .Params.tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}]
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
Loading…
Reference in a new issue