diff options
author | Humberto Rocha <humrochagf@gmail.com> | 2019-07-31 22:18:09 +0300 |
---|---|---|
committer | Humberto Rocha <humrochagf@gmail.com> | 2019-07-31 22:18:09 +0300 |
commit | 62b39f7c4d6438fd6fe996560571ca4c5578ff94 (patch) | |
tree | bbaf97616ccad7a398e41b1e6280220f39ae60c7 | |
parent | 02a9c1a51d9c5cc377b77b3f7138ba45f8f5113e (diff) |
Improve meta info
-rw-r--r-- | layouts/_default/baseof.html | 2 | ||||
-rw-r--r-- | layouts/_default/taxonomy.html | 8 | ||||
-rw-r--r-- | layouts/_default/terms.html | 2 | ||||
-rw-r--r-- | layouts/partials/blog-jsonld.html | 3 | ||||
-rw-r--r-- | layouts/partials/blog-post-jsonld.html | 19 | ||||
-rw-r--r-- | layouts/partials/meta.html | 6 |
6 files changed, 23 insertions, 17 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index aeaa160..29f7fb1 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,7 +7,7 @@ {{ end }} <!-- Page title --> - <title>{{ .Title }} - {{ .Site.Title }}</title> + <title>{{ .Title | humanize | title }} - {{ .Site.Title }}</title> <!-- styles --> {{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "style.main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 60fc498..efc87a8 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -1,5 +1,11 @@ +{{ define "jsonLD" }} + <script type="application/ld+json"> + {{ partial "blog-jsonld" . | safeJS }} + </script> +{{ end }} + {{ define "main" }} - <h1 class="text-center">Tag: {{ .Title }}</h1> + <h1 class="text-center">Tag: {{ .Title | humanize | title }}</h1> {{ range .Pages }} <article> diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 790fda1..4cb7af1 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -3,7 +3,7 @@ <div class="tag-group"> {{ range $index, $item := .Pages }} - <a href="{{ $item.Permalink }}">{{ $item.Title }}</a> + <a href="{{ $item.Permalink }}">{{ $item.Title | humanize | title }}</a> {{ end }} </div> {{ end }} diff --git a/layouts/partials/blog-jsonld.html b/layouts/partials/blog-jsonld.html index 92cd5b6..7f5695f 100644 --- a/layouts/partials/blog-jsonld.html +++ b/layouts/partials/blog-jsonld.html @@ -1,6 +1,9 @@ { "@context": "http://schema.org", "@type": "Blog", + "url": "{{ .Permalink }}", + "headline": "{{ .Title | humanize | title }} - {{ .Site.Title }}", + "description": "{{ .Site.Params.description }}", "author": { "@type": "Person", "name": "{{ .Site.Params.author.name }}", diff --git a/layouts/partials/blog-post-jsonld.html b/layouts/partials/blog-post-jsonld.html index 5127ffc..30a79bd 100644 --- a/layouts/partials/blog-post-jsonld.html +++ b/layouts/partials/blog-post-jsonld.html @@ -1,21 +1,18 @@ { "@context": "http://schema.org", "@type": "BlogPosting", - "headline": "{{ .Title }}", "url": "{{ .Permalink }}", - "datePublished": "{{ .PublishDate.Format "2006-01-02" }}", + "headline": "{{ .Title }}", "description": "{{ .Description }}", + "datePublished": "{{ .PublishDate.Format "2006-01-02" }}", {{ if .Params.Tags }} - "keywords": "{{ delimit .Params.Tags " " }}", + "keywords": "{{ delimit .Params.Tags "," }}", + {{ end }} + {{ if .Params.shareImage }} + "image": "{{ .Params.shareImage | absURL }}", + {{ else }} + "image": "{{ .Site.Params.siteLogo | absURL }}", {{ end }} - "image": { - "@type": "ImageObject", - {{ if .Params.shareImage }} - "url": "{{ .Params.shareImage | absURL }}" - {{ else }} - "url": "{{ .Site.Params.siteLogo | absURL }}" - {{ end }} - }, "author": { "@type": "Person", "name": "{{ .Site.Params.author.name }}", diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 04dd986..2936587 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -34,7 +34,7 @@ <meta name="theme-color" content="#ffffff" /> <!-- Google+ --> -<meta itemprop="name" content="{{ .Title }}" /> +<meta itemprop="name" content="{{ .Title | humanize | title }}" /> <meta itemprop="description" content="{{ index .Params "description" | default .Site.Params.description }}" /> {{ if .Params.shareImage }} <meta itemprop="image" content="{{ .Params.shareImage | absURL }}" /> @@ -44,7 +44,7 @@ <!-- Facebook --> <meta property="og:site_name" content="{{ .Site.Title }}" /> -<meta property="og:title" content="{{ .Title }}" /> +<meta property="og:title" content="{{ .Title | humanize | title }}" /> <meta property="og:description" content="{{ index .Params "description" | default .Site.Params.description }}" /> <meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:type" content="article" /> @@ -58,7 +58,7 @@ <meta name="twitter:url" content="{{ .Permalink }}" /> <meta name="twitter:site" content="@{{ .Site.Params.twitter }}" /> <meta name="twitter:creator" content="@{{ .Site.Params.author.twitter }}" /> -<meta name="twitter:title" content="{{ .Title }}" /> +<meta name="twitter:title" content="{{ .Title | humanize | title }}" /> <meta name="twitter:description" content="{{ index .Params "description" | default .Site.Params.description }}" /> {{ if .Params.shareImage }} <meta name="twitter:card" content="summary_large_image" /> |