1
Fork 0

Fix meta summary

This commit is contained in:
Jake Howard 2017-05-07 21:32:34 +01:00
parent 1e8e9c3ce8
commit c498eca97f
2 changed files with 10 additions and 10 deletions

View file

@ -6,6 +6,7 @@ params:
author: TheOrangeOne author: TheOrangeOne
author_name: Jake Howard author_name: Jake Howard
summary_length: 100 summary_length: 100
summary_length_long: 200
nav_items: 5 nav_items: 5
index_items: 6 index_items: 6

View file

@ -1,26 +1,25 @@
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="{{ .Site.Data.social.accounts.twitter.username }}" /> <meta name="twitter:site" content="{{ .Site.Data.social.accounts.twitter.username }}" />
<meta name="twitter:title" content="{{ .Title }}" /> <meta name="twitter:title" content="{{ .Title | htmlUnescape }}" />
<meta name="twitter:description" content="{{ .Summary }}" /> <meta name="twitter:description" content="{{ .Summary | plainify | chomp | htmlUnescape | truncate .Site.Params.summary_length_long "..." }}" />
<meta name="twitter:creator" content="{{ .Site.Data.social.accounts.twitter.username }}" /> <meta name="twitter:creator" content="{{ .Site.Data.social.accounts.twitter.username }}" />
{{ if .Params.image }} {{ if .Params.image }}
<meta name="twitter:image" content="{{ absURL .Params.image }}" /> <meta name="twitter:image" content="{{ absURL .Params.image }}" />
<meta name="twitter:image:alt" content="{{ .Summary }}" /> <meta name="twitter:image:alt" content="{{ .Title | htmlUnescape }}" />
{{ end }} {{ end }}
<meta property="og:title" content="{{ .Title | htmlUnescape }}" />
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:type" content="{{ .Kind }}" /> <meta property="og:type" content="{{ .Kind }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
{{ if .Params.image }} {{ if .Params.image }}
<meta property="og:image" content="{{ absURL .Params.image }}" /> <meta property="og:image" content="{{ absURL .Params.image }}" />
{{ end }} {{ end }}
<meta property="og:description" content="{{ .Summary }}" /> <meta property="og:description" content="{{ .Summary | plainify | chomp | htmlUnescape | truncate .Site.Params.summary_length_long "..." }}" />
<meta property="og:site_name" content="{{ title .Site.Title }}" /> <meta property="og:site_name" content="{{ title .Site.Title | htmlUnescape }}" />
<meta property="og:locale" content="{{ .Site.Language.Lang }}" /> <meta property="og:locale" content="{{ .Site.Language.Lang }}" />
<meta itemprop="name" content="{{ .Title }}" /> <meta itemprop="name" content="{{ .Title | htmlUnescape }}" />
<meta itemprop="description" content="{{ .Summary }}" /> <meta itemprop="description" content="{{ .Summary | plainify | chomp | htmlUnescape | truncate .Site.Params.summary_length_long "..." }}" />
{{ if .Params.image }} {{ if .Params.image }}
<meta itemprop="image" content="{{ absURL .Params.image }}" /> <meta itemprop="image" content="{{ absURL .Params.image }}" />
{{ end }} {{ end }}
@ -29,6 +28,6 @@
<meta name="article:modified_time" content="{{ .Lastmod }}" /> <meta name="article:modified_time" content="{{ .Lastmod }}" />
<meta name="article:published_time" content="{{ .Date }}" /> <meta name="article:published_time" content="{{ .Date }}" />
<meta name="article:section" content="{{ .Type }}" /> <meta name="article:section" content="{{ .Type }}" />
<meta name="description" content="{{ .Summary }}" /> <meta name="description" content="{{ .Summary | plainify | chomp | htmlUnescape | truncate .Site.Params.summary_length_long "..." }}" />
<meta name="author" content="{{ title .Site.Params.author }}" /> <meta name="author" content="{{ title .Site.Params.author }}" />
<meta name="canonical" content="{{ .Permalink }}" /> <meta name="canonical" content="{{ .Permalink }}" />