diff options
author | Matt Stratton <matt.stratton@gmail.com> | 2016-10-06 18:52:12 +0300 |
---|---|---|
committer | Matt Stratton <matt.stratton@gmail.com> | 2016-10-06 18:52:12 +0300 |
commit | e748d99ad955d36dc61e7b0c1fd00e64c7e3d74b (patch) | |
tree | b71c29ee4b5f0d02424cd2d158e644b3b71be59c | |
parent | b127571c5ddf0f45fca9723ad2fa81988473fe2b (diff) |
Set proper publish date on episodes
Fixes #31
-rw-r--r-- | archetypes/episode.md | 1 | ||||
-rw-r--r-- | layouts/partials/head/seo/open_graph.html | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/archetypes/episode.md b/archetypes/episode.md index 8fadb22..f146a69 100644 --- a/archetypes/episode.md +++ b/archetypes/episode.md @@ -1,5 +1,6 @@ +++ Description = "" +PublishDate = "" # this is the datetime for the when the epsiode was published. This will default to Date if it is not set. Example is "2016-04-25T04:09:45-05:00" podcast_file = "###.mp3" # the name of the podcast file, after the media prefix. podcast_duration = "" podcast_length = "" # the length of the episode in bytes diff --git a/layouts/partials/head/seo/open_graph.html b/layouts/partials/head/seo/open_graph.html index 39d0b5a..a63eeac 100644 --- a/layouts/partials/head/seo/open_graph.html +++ b/layouts/partials/head/seo/open_graph.html @@ -37,7 +37,15 @@ {{ end }} <meta property="article:publisher" content="https://www.facebook.com/{{ .Site.Params.social.facebook }}" /> {{if .IsPage}} -<meta property="article:published_time" content="{{ .PublishDate }}" /> + {{ if isset .Params "PublishDate" }} + {{ if ne .PublishDate "" }} + <meta property="article:published_time" content="{{ .PublishDate }}" /> + {{ else }} + <meta property="article:published_time" content="{{ .Date }}" /> + {{ end }} + {{ else }} + <meta property="article:published_time" content="{{ .Date }}" /> + {{ end }} {{ end }} <meta property="article:modified_time" content="{{ .Date }}" /> <meta property="article:section" content="{{ .Section }}" /> |