Skip to content

Commit

Permalink
site: SEO optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
AnInternetTroll committed Dec 17, 2024
1 parent cb56af6 commit 90c4092
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
HUGO_ENVIRONMENT: production
run: |
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
--minify --printMemoryUsage --printPathWarnings --printUnusedTemplates \
--baseURL "${{ steps.pages.outputs.base_path }}"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
baseURL = 'https://mcbe.wtf/'
languageCode = 'en-us'
title = 'Minecraft Bedrock Speedrunning'
theme = "minecraft"
copyright = 'Copyright @2024 Minecraft Speedrunning.'
enableGitInfo = true
enableRobotsTXT = true

[taxonomies]
tag = 'tags'
Expand Down
24 changes: 24 additions & 0 deletions themes/minecraft/layouts/_default/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ 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">
{{ range where .Pages "Sitemap.Disable" "ne" true }}
{{- if and .Permalink (not (hasPrefix .Path "/tags/")) -}}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ else }}{{ with .GitInfo }}<lastmod>{{ safeHTML ( .AuthorDate.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ 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.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{- end -}}
{{ end }}
</urlset>
3 changes: 3 additions & 0 deletions themes/minecraft/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
<meta name="description" content="{{ trim . "\n\r\t " }}">
{{- end }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
{{ template "_internal/opengraph.html" . }}
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
{{ partialCached "head/css.html" . }}
Expand Down
1 change: 0 additions & 1 deletion themes/minecraft/layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

@context {page} page The current page.
@context {string} menuID The menu ID.
@context {string} baseUrl The menu ID.

@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
*/}}
Expand Down
2 changes: 2 additions & 0 deletions themes/minecraft/layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-Agent: *
Disallow: /tags/

0 comments on commit 90c4092

Please sign in to comment.