Skip to content

Commit

Permalink
Fixing some SEO stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-dejongh committed Aug 25, 2024
1 parent 8da115f commit f7fca3b
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
6 changes: 3 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
title: Pragmatic Penguin Patterns
baseURL: "localhost:1313"


module:
# uncomment line below for local development of module
# workspace: hugo.work
imports:
path: github.com/StefMa/hugo-fresh

googleAnalytics: # Put in your tracking code without quotes like this: UA-XXX for universal tracking or G-XXX analytics v4 tracking
assetDir: "assets"
enableRobotsTXT: true

paginate: 5
canonifyURLs: true
Expand Down
2 changes: 2 additions & 0 deletions layouts/_default/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Sitemap: {{ .Site.BaseURL }}{{ if not (hasSuffix .Site.BaseURL "/") }}/{{ end }}sitemap.xml
24 changes: 24 additions & 0 deletions 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 .Permalink -}}
<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.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{- end -}}
{{ end }}
</urlset>
9 changes: 9 additions & 0 deletions layouts/_default/sitemapindex.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{ range . }}
<sitemap>
<loc>{{ .BaseURL }}/{{ .Language.Lang }}/sitemap.xml</loc>
{{ if not .LastChange.IsZero }}<lastmod>{{ safeHTML ( .LastChange.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}
</sitemap>
{{ end }}
</sitemapindex>
2 changes: 1 addition & 1 deletion layouts/concepts/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<link>{{ .Permalink }}</link>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{.Site.BaseURL}}/concepts/{{ .Params.uuid }}</guid>
<guid>{{.Site.BaseURL}}concepts/{{ .Params.uuid }}</guid>
<description>{{ .Summary | html }}</description>
</item>
{{ end }}
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<meta name="keywords" content="{{ if .Params.Tags }}{{ .Params.Tags }}{{ else if .Site.Params.Keywords }}{{ .Site.Params.Keywords }}{{ else }}learning,improvement{{ end }}" />
<meta name="robots" content="nofollow" />
<meta name="google-site-verification" content="oLCEMKvfvKAzhdTDMhNYEX08dQJZtk4VecfaoonsZmI" />

{{ if .Params.Title }}
<meta name="title" content="SD Development: {{ .Params.Title }}">
Expand Down

0 comments on commit f7fca3b

Please sign in to comment.