From aefe0904492698d2996d59d3f86a0fe9af0f688b Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Wed, 22 Jan 2025 00:00:01 +0100 Subject: page metadata for SEO --- layouts/partials/structured-data.html | 59 +++++++++++++++-------------------- 1 file changed, 26 insertions(+), 33 deletions(-) (limited to 'layouts/partials') diff --git a/layouts/partials/structured-data.html b/layouts/partials/structured-data.html index c55bcdd..eb42277 100644 --- a/layouts/partials/structured-data.html +++ b/layouts/partials/structured-data.html @@ -18,42 +18,41 @@ {{ else }} {{ end }} + +{{ $desc := "" }} +{{/* Generate page description. */}} +{{ if .Params.description }} + {{ $desc = .Params.description }} +{{ else if .Params.subtitle }} + {{ $desc = .Params.subtitle }} +{{ else if .IsPage }} + {{ $desc = .Summary }} +{{ else if .Params.excerpt }} + {{ $desc = .Params.excerpt }} +{{ else }} + {{ $desc = site.Params.description }} +{{ end }} + + + - + - + + {{- if .IsPage }} {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} @@ -73,12 +72,6 @@ {{- end -}} {{- with .Params.audio }}{{ end }} -{{- with .Params.locale }} - -{{ end }} -{{- with .Site.Params.title }} - -{{ end }} {{- with .Params.videos }} {{- range . }} -- cgit v1.2.3