diff options
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | exampleSite/config/_default/params.yaml | 6 | ||||
| -rw-r--r-- | exampleSite/content/dramas/raisin.md | 2 | ||||
| -rw-r--r-- | layouts/partials/templates/opengraph.html | 34 | ||||
| -rw-r--r-- | layouts/partials/templates/twitter_cards.html | 7 |
5 files changed, 38 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 38652aa..de126c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use Google Site Tag tagging/analytics framework on production mode only - Rename `.Params.caption` to `.Params.pageTitle` Front Matter param - Rename `.Params.featured_image` to `.Params.featuredImage` Front Matter param - +- Rename `site.Social.facebook_id` to `site.Params.social.facebookId` +- Rename `site.Social.facebook_admin` to `site.Params.social.facebookAdminIds` +- Rename `site.Social.twitter` to `site.Params.social.twitter` ### Removed diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml index dd6c5a2..bf6c79a 100644 --- a/exampleSite/config/_default/params.yaml +++ b/exampleSite/config/_default/params.yaml @@ -89,11 +89,11 @@ seo: anonymizeIp: true social: - # Facebook Page Admin ID for Domain Insights - facebook_admin: '' + # Array of Facebook Page Admin IDs for Domain Insights + facebookAdminIds: [] # Facebook Page ID - facebook_id: '' + facebookId: '' # Twitter username for the website twitter: john_doe diff --git a/exampleSite/content/dramas/raisin.md b/exampleSite/content/dramas/raisin.md index 5c8d8b2..5cdca9c 100644 --- a/exampleSite/content/dramas/raisin.md +++ b/exampleSite/content/dramas/raisin.md @@ -17,4 +17,4 @@ MAMA: Oh—So now it’s life. Money is life. Once upon a time freedom used to b WALTER: No—it was always money, Mama. We just didn’t know about it. -MAMA: No . . . something has changed. (*She looks at him*) You something new, boy. In my time we was worried about not being lynched and getting to the North if we could and how to stay alive and still have a pinch of dignity too ... Now here come you and Beneatha—talking 'bout things we never even thought about hardly, me and your daddy. You ain’t satisfied or proud of nothing we done. I mean that you had a home; that we kept you out of trouble till you was grown; that you don’t have to ride to work on the back of nobody’s streetcar—You my children—but how different we done become. +MAMA: No ... something has changed. (*She looks at him*) You something new, boy. In my time we was worried about not being lynched and getting to the North if we could and how to stay alive and still have a pinch of dignity too ... Now here come you and Beneatha—talking 'bout things we never even thought about hardly, me and your daddy. You ain’t satisfied or proud of nothing we done. I mean that you had a home; that we kept you out of trouble till you was grown; that you don’t have to ride to work on the back of nobody’s streetcar—You my children—but how different we done become. diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 627605e..f78f8e8 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -17,10 +17,32 @@ <meta property="og:image:height" content="{{ $logo.Height }}"> {{- end -}} -{{- /* Facebook Page Admin ID for Domain Insights */}} -{{- with site.Social.facebook_admin }} - <meta property="fb:admins" content="{{ . }}"> -{{- end }} -{{- with site.Social.facebook_id }} +{{- if .IsPage -}} + {{- if not .PublishDate.IsZero }} + <meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05" }}"> + {{- end -}} + + {{- if not .Lastmod.IsZero }} + <meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05" }}"> + {{- end -}} + + {{- if not .ExpiryDate.IsZero }} + <meta property="article:expiration_time" content="{{ .ExpiryDate.Format "2006-01-02T15:04:05" }}"> + {{- end -}} + + {{- with .Params.categories -}}{{- range $v := . }} + <meta property="article:section" content="{{ $v }}"> + {{- end -}}{{- end -}} + + {{- with .Params.tags -}}{{- range $v := . }} + <meta property="article:tag" content="{{ $v }}"> + {{- end -}}{{- end -}} +{{- end -}} + +{{- /* Facebook Page Admin ID for Domain Insights */ -}} +{{- with site.Params.social.facebookId }} <meta property="fb:app_id" content="{{ . }}"> -{{- end }} +{{- end -}} +{{- with site.Params.social.facebookAdminIds -}}{{- range . }} + <meta property="fb:admins" content="{{ . }}"> +{{- end }}{{- end }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index 40a6c3d..d2ef50a 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -3,17 +3,16 @@ <meta name="twitter:description" content="{{ (partial "description.html" . ) }}"> {{- /* Twitter username for the website used in the card footer */}} - {{- with site.Social.twitter }} + {{- with site.Params.social.twitter }} <meta name="twitter:site" content="@{{ . }}"> {{- end }} - {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) -}} - {{- if and .IsPage .Params.featuredImage }} {{- $image := .Resources.GetMatch .Params.featuredImage }} <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="{{ $image.Permalink }}"> - {{- else }} + {{- else -}} + {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) }} <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="{{ $logo.Permalink }}"> {{- end -}} |
