diff options
| author | Alexandre Vicenzi <vicenzi.alexandre@gmail.com> | 2020-02-10 21:30:40 +0100 |
|---|---|---|
| committer | Alexandre Vicenzi <vicenzi.alexandre@gmail.com> | 2020-02-10 21:30:40 +0100 |
| commit | b8c709e73559476677dfcd1c5ab4d33856d7c751 (patch) | |
| tree | 9fd8d05b9205991a130a3da7cfa371f7b37e2dca /layouts/partials/seo.html | |
| parent | a48ee22a03a2df246f4cac8d20919c3f5ab6f97c (diff) | |
SEO
Diffstat (limited to 'layouts/partials/seo.html')
| -rw-r--r-- | layouts/partials/seo.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/layouts/partials/seo.html b/layouts/partials/seo.html new file mode 100644 index 0000000..46b0c29 --- /dev/null +++ b/layouts/partials/seo.html @@ -0,0 +1,81 @@ + + <meta property="og:locale" content="{{ .Site.LanguageCode }}"/> + + {{ with .Site.Params.gravatar }} + <meta property="og:image" content="https://www.gravatar.com/avatar/{{md5 .}}?s=400&d=mp"> + {{- else -}} + {{ with .Site.Params.profilePicture }} + <meta property="og:image" content="{{ $.Site.BaseURL }}{{ . }}"> + {{- end -}} + {{ end }} + + {{ if eq .Type "post" }} + <meta property="og:site_name" content="{{ .Site.Title }}"/> + <meta property="og:title" content="{{ .Title }}"/> + <meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}"/> + <meta property="og:url" content="{{ .Permalink }}"/> + <meta property="og:type" content="article"/> + <meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}"/> + <meta property="article:modified_time" content="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}"/> + <meta property="article:author" content="{{ .Site.Params.author }}"> + <!-- <meta property="article:section" content="category"/> --> + <!-- <meta property="article:tag" content="tag"/> --> + {{ else }} + <meta property="og:type" content="blog"/> + <meta property="og:site_name" content="{{ .Site.Title }}"/> + + {{- if .IsHome }} + <meta property="og:title" content="{{ .Site.Title }}"/> + <meta property="og:url" content="{{ .Site.BaseURL }}"/> + <meta property="og:description" content="{{ .Site.Params.description }}"/> + {{- else -}} + <meta property="og:title" content="{{ .Title }}"/> + <meta property="og:url" content="{{ .Permalink }}"/> + <meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}"/> + {{- end -}} + + {{ end }} + + <script type="application/ld+json"> + { + "@context" : "http://schema.org", + "@type" : "Blog", + "name": {{ .Site.Title }}, + "url" : {{ .Site.BaseURL }}, + {{- with .Site.Params.gravatar }} + "image": "https://www.gravatar.com/avatar/{{md5 .}}?s=400&d=mp", + {{- else -}} + {{ with .Site.Params.profilePicture }} + "image": {{ . | printf "%s%s" $.Site.BaseURL }}, + {{- end -}} + {{- end }} + "description": "{{ .Site.Params.description }}" + } + </script> + + {{ if eq .Type "post" }} + <script type="application/ld+json"> + { + "@context": "http://schema.org", + "@type": "BlogPosting", + "name": "{{ .Title }}", + "headline": "{{ .Title }}", + "datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z0700" }}", + "dateModified": "{{ .Date.Format "2006-01-02T15:04:05Z0700" }}", + "author": { + "@type": "Person", + "name": "{{ .Site.Params.author }}", + "url": {{ .Site.BaseURL }} + }, + {{- with .Site.Params.gravatar }} + "image": "https://www.gravatar.com/avatar/{{md5 .}}?s=400&d=mp", + {{- else -}} + {{ with .Site.Params.profilePicture }} + "image": {{ . | printf "%s%s" $.Site.BaseURL }}, + {{- end -}} + {{- end }} + "url": {{ .Permalink }}, + "description": "{{ if .Description }}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}" + } + </script> + {{ end }} |
