From 57253d85613ceb01a37b65fcb77b73435833f5e1 Mon Sep 17 00:00:00 2001 From: Kay Date: Tue, 12 Oct 2021 16:13:51 +0800 Subject: [PATCH] Adding Article structured data --- exampleSite/config.yaml | 7 +- layouts/_default/baseof.html | 1 + layouts/partials/head/siteSchema.html | 102 ++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/head/siteSchema.html diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index dcf6c63..7c2266c 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -41,9 +41,12 @@ params: emoji: 🍥 subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit. avatar: + name: Example Name enabled: true local: true src: img/avatar.png + width: 300 + height: 300 article: math: false @@ -150,7 +153,9 @@ params: opengraph: enabled: false local: false - src: + src: cover.jpg + width: 1280 + height: 720 colorScheme: # Display toggle diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8a5ff95..2d475db 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,6 +2,7 @@ {{- partial "head/head.html" . -}} + {{- partial "head/siteSchema.html" . -}} {{- block "head" . -}}{{ end }} diff --git a/layouts/partials/head/siteSchema.html b/layouts/partials/head/siteSchema.html new file mode 100644 index 0000000..c0bbeca --- /dev/null +++ b/layouts/partials/head/siteSchema.html @@ -0,0 +1,102 @@ +{{ if .IsHome -}} + +{{/* + "potentialAction": { + "@type": "SearchAction", + "target": "http://example.com/search?&q={query}", + "query-input": "required" + } */}} +{{- else if .IsPage -}} + +{{- end }} \ No newline at end of file