From f56b2f3de4de63a290d330531e2e837ff4077d09 Mon Sep 17 00:00:00 2001 From: Vezpi Date: Thu, 22 May 2025 22:19:43 +0000 Subject: [PATCH] Improvment for SEO --- hugo.yaml | 6 ++++++ layouts/404.html | 7 +++++++ layouts/_default/sitemap.xml | 34 ++++++++++++++++++++++++++++++++++ static/robots.txt | 3 +++ themes/PaperMod | 2 +- 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 layouts/404.html create mode 100644 layouts/_default/sitemap.xml create mode 100644 static/robots.txt diff --git a/hugo.yaml b/hugo.yaml index 3a69253..425e4af 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -54,6 +54,7 @@ frontmatter: params: mainSections: ["post"] + description: "A blog documenting my homelab journey, covering automation, self-hosted services, and hands-on experiments with open source technologies." favicon: "/favicon-32x32.png" sidebar: @@ -135,6 +136,11 @@ related: - name: categories weight: 20 +sitemap: + ChangeFreq: "weekly" + Priority: 0.6 + + outputs: home: - HTML diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..cf71bbb --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,7 @@ +{{- define "main" -}} +
+

404 - Page Not Found

+

Looks like the page you're looking for doesn't exist.

+

Go back home

+
+{{- end }} \ No newline at end of file diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml new file mode 100644 index 0000000..6e6c2c9 --- /dev/null +++ b/layouts/_default/sitemap.xml @@ -0,0 +1,34 @@ +{{ printf "" | safeHTML }} + + {{ range .Data.Pages }} + {{ if or (.IsPage) (.IsHome) }} + + {{ .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 }} + {{ end }} + diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..62bf119 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Disallow: /tags/ +Disallow: /categories/ \ No newline at end of file diff --git a/themes/PaperMod b/themes/PaperMod index 7cf752f..ee1e0f3 160000 --- a/themes/PaperMod +++ b/themes/PaperMod @@ -1 +1 @@ -Subproject commit 7cf752f8644fea1fc3dc7299352718d492c55182 +Subproject commit ee1e0f3aa3c3575a756c9b17be5823e21de09c30