diff --git a/modules/wowchemy/config.yaml b/modules/wowchemy/config.yaml index 52dce712..cefb5622 100644 --- a/modules/wowchemy/config.yaml +++ b/modules/wowchemy/config.yaml @@ -24,8 +24,11 @@ sitemap: changefreq: weekly module: hugoVersion: - min: '0.95.0' + min: '0.101.0' extended: true + imports: + - path: github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core + - path: github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-seo mounts: - source: content target: content diff --git a/modules/wowchemy/go.mod b/modules/wowchemy/go.mod index 9b801c49..4dd20d7f 100644 --- a/modules/wowchemy/go.mod +++ b/modules/wowchemy/go.mod @@ -1,3 +1,9 @@ module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 go 1.15 + +require ( + github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.1.0 + github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-seo v0.1.0 +) + diff --git a/modules/wowchemy/layouts/partials/site_head.html b/modules/wowchemy/layouts/partials/site_head.html index 8d3ac65b..fc0d7faa 100644 --- a/modules/wowchemy/layouts/partials/site_head.html +++ b/modules/wowchemy/layouts/partials/site_head.html @@ -12,10 +12,6 @@ {{/* EXTENSIBILITY HOOK: HEAD-START */}} {{ partial "functions/get_hook" (dict "hook" "head-start" "context" .) }} - {{ if .Params.private }} - - {{- end -}} - {{/* Parse theme and font */}} {{ partial "functions/parse_theme" . }} @@ -40,44 +36,8 @@ {{- end -}} - {{/* Attempt to load superuser. */}} - {{ $superuser_name := "" }} - {{ $superuser_username := "" }} - {{ $superuser_role := "" }} - {{ range first 1 (where (where site.Pages "Section" "authors") "Params.superuser" true) }} - {{ $superuser_name = .Title }} - {{ $superuser_username = path.Base .File.Dir }} - {{ $superuser_role = .Params.role }} - {{ end }} - {{ $scr.Set "superuser_username" $superuser_username }}{{/* Set superuser globally for page_author.html. */}} - - {{ with $superuser_name }}{{ end }} - - {{/* Generate page description. */}} - {{ $desc := "" }} - {{ if .Params.summary }} - {{ $desc = .Params.summary }} - {{ else if .Params.abstract }} - {{ $desc = .Params.abstract }} - {{ else if .IsPage }} - {{ $desc = .Summary }} - {{ else if site.Params.marketing.seo.description }} - {{ $desc = site.Params.marketing.seo.description }} - {{ else }} - {{ $desc = $superuser_role }} - {{ end }} - - - {{ range .Translations }} - - {{ end }} - - {{ $css := site.Data.assets.css }} {{ $js := site.Data.assets.js }} - {{ if ne ($scr.Get "primary") "#fff" }} - - {{ end }} {{/* Config LaTeX math rendering. */}} {{ if or .Params.math site.Params.features.math.enable }} @@ -208,20 +168,8 @@ {{ end }} - {{/* Marketing */}} - {{ with site.Params.marketing.verification.google }} - - {{- end -}} - {{ with site.Params.marketing.verification.baidu }} - - {{- end -}} - {{ with site.Params.marketing.verification.bing }} - - {{- end -}} - {{ partial "marketing/google_analytics" . }} - {{ partial "marketing/google_tag_manager" . }} - {{ partial "marketing/microsoft_clarity" . }} - {{ partial "marketing/baidu_tongji" . }} + {{/* Load SEO module */}} + {{ partial "wowchemy_seo" . }} {{/* Netlify Identity integration. */}} {{ $use_cms := templates.Exists "wowchemycms/single.wowchemycms_config.yml" | default (site.Params.extensions.cms.enable | default false) }} @@ -234,82 +182,9 @@ {{ end }} - {{/* Progressive Web App (PWA) Manifest */}} - {{ with site.Home.OutputFormats.Get "WebAppManifest" }} - - {{ end }} - - {{/* Progressive Web App (PWA) Icon */}} - - - - - - {{/* Get page image for sharing. */}} - {{ $sharing_image := resources.GetMatch (path.Join "media" "sharing.*") }} - {{/* Search for an image "*featured*" in post folder */}} - {{ $featured_image := partial "functions/get_featured_image.html" . }} - {{ $avatar_image := (.Resources.ByType "image").GetMatch "avatar*" }} - {{ $has_logo := fileExists "assets/media/logo.png" | or (fileExists "assets/media/logo.svg") }} - {{ $og_image := "" }} - {{ $twitter_card := "summary_large_image" }} - {{ if (and (eq .Kind "term") $avatar_image) }} - {{/* Match image processing in About widget to prevent generating more images than necessary. */}} - {{ $og_image = ($avatar_image.Fill "270x270 Center").Permalink }} - {{ $twitter_card = "summary" }} - {{ else if $featured_image }} - {{ $og_image = $featured_image.Permalink }} - {{ else if $sharing_image }} - {{ $og_image = $sharing_image.Permalink }} - {{ else if $has_logo }} - {{ $og_image = (partial "functions/get_logo" (dict "constraint" "fit" "size" 300)).Permalink }} - {{ $twitter_card = "summary" }} - {{ else }} - {{ $og_image = (partial "functions/get_icon" 512).Permalink }} - {{ $twitter_card = "summary" }} - {{ end }} - {{ $scr.Set "og_image" $og_image }}{{/* Set `og_image` globally for `rss.xml`. */}} - - {{ $title := "" }} - {{ with .Params.seo.title }} - {{ $title = replace . "{brand}" site.Title }} - {{ else }} - {{ $title = .Title | default site.Title }} - {{ if ne $title site.Title }}{{ $title = printf "%s | %s" $title site.Title }}{{ end }} - {{ end }} - - {{ with site.Params.marketing.seo.twitter }} - - - {{ end }} - - - - - {{- with $og_image -}} - - - {{- end -}} - - {{ if .IsPage }} - {{ if not .PublishDate.IsZero }} - - {{ else if not .Date.IsZero }} - - {{ end }} - {{ if not .Lastmod.IsZero }}{{ end }} - {{ else }} - {{ if not .Date.IsZero }} - - {{ end }} - {{ end }} - - {{ partial "jsonld/main" (dict "page" . "summary" $desc) }} {{ partial "cookie_consent" . }} + {{ $title := partial "functions/get_page_title" . }} {{$title}} {{/* EXTENSIBILITY HOOK: HEAD-END */}}