From 962eba579ff675f8d572fd08d9551cb42cb4258a Mon Sep 17 00:00:00 2001 From: George Cushen Date: Wed, 1 Nov 2023 19:33:03 +0000 Subject: [PATCH] modules: port sitemap, webmanifest, robots.txt, markdown block --- .../layouts/_default/_markup/sitemap.xml | 30 +++++++++++++++++++ .../layouts/index.webmanifest | 20 +++++++++++++ .../layouts/partials/blocks/markdown.html | 20 +++++++++++++ modules/wowchemy-tailwind/layouts/robots.txt | 3 ++ 4 files changed, 73 insertions(+) create mode 100644 modules/wowchemy-tailwind/layouts/_default/_markup/sitemap.xml create mode 100644 modules/wowchemy-tailwind/layouts/index.webmanifest create mode 100644 modules/wowchemy-tailwind/layouts/partials/blocks/markdown.html create mode 100644 modules/wowchemy-tailwind/layouts/robots.txt diff --git a/modules/wowchemy-tailwind/layouts/_default/_markup/sitemap.xml b/modules/wowchemy-tailwind/layouts/_default/_markup/sitemap.xml new file mode 100644 index 00000000..9f607424 --- /dev/null +++ b/modules/wowchemy-tailwind/layouts/_default/_markup/sitemap.xml @@ -0,0 +1,30 @@ +{{ printf "" | safeHTML }} + + {{/* Check that page is built (has a URL) and is not private. */}} + {{ range where (where .Data.Pages "Permalink" "!=" "") "Params.private" "ne" true }} + + {{ .Permalink }} + {{- if not .Lastmod.IsZero }}{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }} + {{- with .Sitemap.ChangeFreq }}{{ . }}{{ end }} + {{- if ge .Sitemap.Priority 0.0 }}{{ .Sitemap.Priority }}{{ end }} + {{- if .IsTranslated -}} + + {{- range .Translations -}} + + {{- end -}} + + + + {{- end -}} + + {{- end -}} + diff --git a/modules/wowchemy-tailwind/layouts/index.webmanifest b/modules/wowchemy-tailwind/layouts/index.webmanifest new file mode 100644 index 00000000..8c76b459 --- /dev/null +++ b/modules/wowchemy-tailwind/layouts/index.webmanifest @@ -0,0 +1,20 @@ +{{- $scr := .Scratch -}} +{{- $theme_color := "#fff" -}} +{ + "name": "{{site.Title}}", + "short_name": "{{site.Title}}", + "lang": "{{ site.LanguageCode | default "en-us" }}", + "theme_color": "{{ $theme_color }}", + "background_color": "{{ $theme_color }}", + "icons": [{ + "src": "{{ (partial "functions/get_site_icon" 192).RelPermalink }}", + "sizes": "192x192", + "type": "image/png" + }, { + "src": "{{ (partial "functions/get_site_icon" 512).RelPermalink }}", + "sizes": "512x512", + "type": "image/png" + }], + "display": "standalone", + "start_url": "{{ site.Home.RelPermalink }}?utm_source=web_app_manifest" +} diff --git a/modules/wowchemy-tailwind/layouts/partials/blocks/markdown.html b/modules/wowchemy-tailwind/layouts/partials/blocks/markdown.html new file mode 100644 index 00000000..fee1386e --- /dev/null +++ b/modules/wowchemy-tailwind/layouts/partials/blocks/markdown.html @@ -0,0 +1,20 @@ +{{/* Wowchemy Blocks: Markdown */}} +{{/* Documentation: https://wowchemy.com/blocks/ */}} +{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $text := $block.content.text | emojify | $page.RenderString }} + +
+
+ + {{ with $block.content.title }} +

{{ . }}

+ {{end}} + + {{ $text }} + +
+
diff --git a/modules/wowchemy-tailwind/layouts/robots.txt b/modules/wowchemy-tailwind/layouts/robots.txt new file mode 100644 index 00000000..2baf3f9a --- /dev/null +++ b/modules/wowchemy-tailwind/layouts/robots.txt @@ -0,0 +1,3 @@ +User-agent: * + +Sitemap: {{ "sitemap.xml" | absURL }}