modules: port sitemap, webmanifest, robots.txt, markdown block

This commit is contained in:
George Cushen committed 2023-11-01 19:33:03 +00:00
1 parent cc1b1a8aee
commit 962eba579f
4 files changed
+73

No files matched your search

@@ -0,0 +1,30 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{/* Check that page is built (has a URL) and is not private. */}}
{{ range where (where .Data.Pages "Permalink" "!=" "") "Params.private" "ne" true }}
<url>
<loc>{{ .Permalink }}</loc>
{{- if not .Lastmod.IsZero }}<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}
{{- with .Sitemap.ChangeFreq }}<changefreq>{{ . }}</changefreq>{{ end }}
{{- if ge .Sitemap.Priority 0.0 }}<priority>{{ .Sitemap.Priority }}</priority>{{ end }}
{{- if .IsTranslated -}}
{{- range .Translations -}}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.Lang }}"
href="{{ .Permalink }}"
/>
{{- end -}}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.Lang }}"
href="{{ .Permalink }}"
/>
{{- end -}}
</url>
{{- end -}}
</urlset>
@@ -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"
}
@@ -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 }}
<div class="flex flex-col justify-center">
<article class="container mx-auto prose prose-slate lg:prose-xl dark:prose-invert">
{{ with $block.content.title }}
<h2>{{ . }}</h2>
{{end}}
{{ $text }}
</article>
</div>
@@ -0,0 +1,3 @@
User-agent: *
Sitemap: {{ "sitemap.xml" | absURL }}