diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 496a8ce..e1ae19f 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -40,6 +40,7 @@ DefaultContentLanguage = "en" # Theme i18n support [params.opengraph] [params.opengraph.twitter] site = "" + card = "summary_large_image" [params.defaultImage] [params.defaultImage.article] enabled = false diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 98ccd9c..dd51174 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -9,7 +9,7 @@ {{ partial "head/style.html" . }} {{ partial "head/script.html" . }} - {{ partial "head/opengraph.html" . }} + {{ partial "head/opengraph/include.html" . }} {{ range .AlternativeOutputFormats -}} diff --git a/layouts/partials/head/opengraph/include.html b/layouts/partials/head/opengraph/include.html new file mode 100644 index 0000000..3a43f48 --- /dev/null +++ b/layouts/partials/head/opengraph/include.html @@ -0,0 +1,2 @@ +{{ partial "head/opengraph/provider/base" . }} +{{ partial "head/opengraph/provider/twitter" . }} \ No newline at end of file diff --git a/layouts/partials/head/opengraph.html b/layouts/partials/head/opengraph/provider/base.html similarity index 73% rename from layouts/partials/head/opengraph.html rename to layouts/partials/head/opengraph/provider/base.html index 9410693..beac56c 100644 --- a/layouts/partials/head/opengraph.html +++ b/layouts/partials/head/opengraph/provider/base.html @@ -10,12 +10,6 @@ {{- end -}} '> -{{ with .Site.Params.opengraph.twitter.site }} - -{{ end }} - - - {{- with .Params.locale -}} {{- end -}} @@ -42,7 +36,5 @@ {{ $image := partial "helper/image" (dict "Context" . "Type" "opengraph") }} {{- if $image.exists -}} - - - + {{- end -}} \ No newline at end of file diff --git a/layouts/partials/head/opengraph/provider/twitter.html b/layouts/partials/head/opengraph/provider/twitter.html new file mode 100644 index 0000000..0495020 --- /dev/null +++ b/layouts/partials/head/opengraph/provider/twitter.html @@ -0,0 +1,12 @@ +{{- with .Site.Params.opengraph.twitter.site -}} + +{{- end -}} + + + + +{{- $image := partial "helper/image" (dict "Context" . "Type" "opengraph") -}} +{{- if $image.exists -}} + + +{{- end -}} \ No newline at end of file