diff --git a/config.toml b/config.toml index 51330576..1cb3f24c 100644 --- a/config.toml +++ b/config.toml @@ -80,11 +80,13 @@ disableAliases = true weight = -70 [outputs] - home = ["HTML", "RSS", "ALGOLIA", "MANIFEST", "REDIRECTS", "HEADERS"] + home = ["HTML", "RSS", "ATOM", "ALGOLIA", "MANIFEST", "REDIRECTS", "HEADERS"] section = ["HTML"] page = ["HTML", "AMP"] [mediaTypes] + [mediaTypes."application/atom+xml"] + suffixes = ["atom"] [mediaTypes."text/netlify"] delimiter = "" @@ -92,6 +94,9 @@ disableAliases = true [outputFormats.RSS] mediaType = "application/rss" baseName = "feed" + [outputFormats.ATOM] + mediaType = "application/atom+xml" + baseName = "feed" [outputFormats.AMP] mediaType = "text/html" baseName = "amp" diff --git a/layouts/index.atom b/layouts/index.atom new file mode 100644 index 00000000..cc329665 --- /dev/null +++ b/layouts/index.atom @@ -0,0 +1,36 @@ +{{ printf "" | safeHTML }} + + {{ .Site.Title }} + {{ "/" | absLangURL }} + + {{ .Site.Title }} + {{ .Permalink }} + + Hugo -- gohugo.io + {{- with .Site.Params.defaultImage }} + {{ . | absURL }} + {{- end }} + {{ dateFormat "2006-01-02T15:04:05Z" now.UTC | safeHTML }} + {{- with .OutputFormats.Get "ATOM" }} + {{ printf `` .MediaType.Type .Permalink $.Site.LanguageCode | safeHTML }} + {{- end }} + {{- range .AlternativeOutputFormats }} + {{ printf `` .MediaType.Type .Permalink $.Site.LanguageCode | safeHTML }} + {{- end }} + {{- range (where .Site.RegularPages "Section" "notes") }} + + {{ .Title }} + {{- with .Site.Author.name }} + + {{ . }} + {{ $.Permalink }} + + {{- end }} + {{ .Permalink }} + {{ dateFormat "2006-01-02T15:04:05Z" .Date.UTC | safeHTML }} + +{{ .Content | html }} + + + {{- end }} + diff --git a/layouts/index.headers b/layouts/index.headers index 88d919c3..bb1bdeea 100644 --- a/layouts/index.headers +++ b/layouts/index.headers @@ -9,9 +9,13 @@ /vendor/* Cache-Control: max-age=31536000, public, immutable +# Proper MIME type for Atom feed +/*.atom + Content-Type: application/atom+xml + # Recommended MIME type for PWA manifests # https://github.com/w3c/manifest/issues/689 /manifest.json - Content-Type: application/manifest+json; charset=UTF-8 + Content-Type: application/manifest+json /*.webmanifest - Content-Type: application/manifest+json; charset=UTF-8 + Content-Type: application/manifest+json diff --git a/layouts/partials/head/feeds.html b/layouts/partials/head/feeds.html new file mode 100644 index 00000000..20fd2858 --- /dev/null +++ b/layouts/partials/head/feeds.html @@ -0,0 +1,2 @@ + + diff --git a/layouts/partials/head/head.html b/layouts/partials/head/head.html index 3e3f0232..830a6e92 100644 --- a/layouts/partials/head/head.html +++ b/layouts/partials/head/head.html @@ -7,7 +7,7 @@ {{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") -}} - +{{ partialCached "head/feeds" . -}} {{ partialCached "head/webmention" . -}} {{ if and .IsPage (eq .Type "notes") }} diff --git a/layouts/partials/scripts/twemoji.html b/layouts/partials/scripts/twemoji.html index d9eff205..4fc2206e 100644 --- a/layouts/partials/scripts/twemoji.html +++ b/layouts/partials/scripts/twemoji.html @@ -1,2 +1,2 @@ - +