{{/* This is Schema partial, which generates relavant schema for individual pages. The relavance is curated in the if block, typically it sets the schema type. */}} {{/* Default values */}} {{ $type := "WebPage" }} {{ $name := .Site.Title }} {{ $description := (or .Params.description .Params.summary .Site.Params.description) }} {{ $image := index .Site.Params.Images 0 | absURL }} {{ $currentPage := path.Split (path.Clean .RelPermalink) }} {{/* Determine page type */}} {{ $isHomePage := .IsHome }} {{ $isSingleEditorialPage := and (eq $currentPage.Dir "/editorials/") ($currentPage.File) }} {{ $isSingleHighlightPage := and (eq $currentPage.Dir "/highlights/") ($currentPage.File) }} {{ $isHighlitsPage := and (strings.HasPrefix .RelPermalink "/highlights") (not $isSingleHighlightPage) }} {{ $isDatasetsPage := strings.HasPrefix .RelPermalink "/datasets" }} {{ $isDashboardsPage := strings.HasSuffix .RelPermalink "/dashboards/" }} {{ $isSingleDashboardPage := and (in (slice "/dashboards/" "/sv/dashboards/") $currentPage.Dir) ($currentPage.File) }} {{/* Overwrite page specific values */}} {{ if $isHomePage }} {{ $type = "WebSite" }} {{ else if $isSingleEditorialPage }} {{ $type = "Article" }} {{ else if $isSingleHighlightPage }} {{ $type = "Dataset" }} {{ else if $isHighlitsPage }} {{ $type = "DataCatalog" }} {{ else if $isDatasetsPage }} {{ $type = "DataCatalog" }} {{ else if (or $isDashboardsPage $isSingleDashboardPage) }} {{ $type = cond (not (eq $isSingleDashboardPage false)) "Dataset" "DataCatalog" }} {{ end }}