From 29fcd231e3da9b33c237886f3c1bb30a557ad641 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 19 Mar 2022 16:54:23 +0530 Subject: Initial Commit --- .../layouts/partials/templates/opengraph.html | 52 +++++++++ .../layouts/partials/templates/schema_json.html | 119 +++++++++++++++++++++ .../layouts/partials/templates/twitter_cards.html | 33 ++++++ 3 files changed, 204 insertions(+) create mode 100644 themes/PaperMod/layouts/partials/templates/opengraph.html create mode 100644 themes/PaperMod/layouts/partials/templates/schema_json.html create mode 100644 themes/PaperMod/layouts/partials/templates/twitter_cards.html (limited to 'themes/PaperMod/layouts/partials/templates') diff --git a/themes/PaperMod/layouts/partials/templates/opengraph.html b/themes/PaperMod/layouts/partials/templates/opengraph.html new file mode 100644 index 0000000..9bbd90b --- /dev/null +++ b/themes/PaperMod/layouts/partials/templates/opengraph.html @@ -0,0 +1,52 @@ + + + + +{{- if .Params.cover.image -}} +{{- if (ne .Params.cover.relative true) }} + +{{- else}} + +{{- end}} +{{- else }} + +{{- with $.Params.images -}} +{{- range first 6 . }}{{ end -}} +{{- else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} + +{{- else -}} +{{- with $.Site.Params.images }}{{ end -}} +{{- end -}} +{{- end -}} +{{- end }} + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} + +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with .Site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} + +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- $permalink := .Permalink }} +{{- $siteSeries := .Site.Taxonomies.series }} +{{ with .Params.series }}{{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.Permalink $permalink }}{{ end }} + {{- end }} +{{ end }}{{ end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{- with .Site.Social.facebook_admin }}{{ end }} diff --git a/themes/PaperMod/layouts/partials/templates/schema_json.html b/themes/PaperMod/layouts/partials/templates/schema_json.html new file mode 100644 index 0000000..5cf3857 --- /dev/null +++ b/themes/PaperMod/layouts/partials/templates/schema_json.html @@ -0,0 +1,119 @@ +{{ if .IsHome }} + +{{- else if (or .IsPage .IsSection) }} +{{/* BreadcrumbList */}} +{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }} +{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} +{{- $bc_list := (split $lang_url "/")}} + +{{- $scratch := newScratch }} + +{{- if .IsPage }} + +{{- end }}{{/* .IsPage end */}} + +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/templates/twitter_cards.html b/themes/PaperMod/layouts/partials/templates/twitter_cards.html new file mode 100644 index 0000000..02270de --- /dev/null +++ b/themes/PaperMod/layouts/partials/templates/twitter_cards.html @@ -0,0 +1,33 @@ +{{- if .Params.cover.image -}} + +{{- if (ne $.Params.cover.relative true) }} + +{{- else }} + +{{- end}} +{{- else }} +{{- with $.Params.images -}} + + +{{ else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} + + +{{- else -}} +{{- with $.Site.Params.images -}} + + +{{ else -}} + +{{- end -}} +{{- end -}} +{{- end }} +{{- end }} + + +{{ with .Site.Social.twitter -}} + +{{ end -}} -- cgit v1.2.3