Skip to content

Commit

Permalink
fix: improve add tags example
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-au committed Sep 24, 2022
1 parent 34c1dee commit ff26fab
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .examples/add-tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{ $s := newScratch }}
{{ $s.Set "jsonld" slice }}
{{ $s.Set "meta" slice }}
{{/* keep text above this line
*****************************/}}

{{/* import jsonld objects here */}}
{{ $s.Add "jsonld" (partial "hugo-seo/jsonld/local-business" . ) }}
{{ $s.Add "jsonld" (partial "hugo-seo/jsonld/offer-catalog" . ) }}

{{/* conditional import examples */}}
{{ if eq .page.Section "event" }}
{{ $s.Add "jsonld" (partial "hugo-seo/jsonld/event" . ) }}
{{ end }}

{{ if site.IsHome }}
{{ $s.Add "jsonld" (partial "hugo-seo/jsonld/faq" . ) }}
{{ end }}

{{/* keep text below this line */}}
{{ $tags := (dict
"jsonld" ($s.Get "jsonld")
"meta" ($s.Get "meta")
) }}
{{ return $tags }}

0 comments on commit ff26fab

Please sign in to comment.