mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 15:25:31 -04:00
output Atom feed
This commit is contained in:
@@ -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"
|
||||
|
36
layouts/index.atom
Normal file
36
layouts/index.atom
Normal file
@@ -0,0 +1,36 @@
|
||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ .Site.LanguageCode }}">
|
||||
<title>{{ .Site.Title }}</title>
|
||||
<id>{{ "/" | absLangURL }}</id>
|
||||
<author>
|
||||
<name>{{ .Site.Title }}</name>
|
||||
<uri>{{ .Permalink }}</uri>
|
||||
</author>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{- with .Site.Params.defaultImage }}
|
||||
<logo>{{ . | absURL }}</logo>
|
||||
{{- end }}
|
||||
<updated>{{ dateFormat "2006-01-02T15:04:05Z" now.UTC | safeHTML }}</updated>
|
||||
{{- with .OutputFormats.Get "ATOM" }}
|
||||
{{ printf `<link rel="self" type="%s" href="%s" />` .MediaType.Type .Permalink $.Site.LanguageCode | safeHTML }}
|
||||
{{- end }}
|
||||
{{- range .AlternativeOutputFormats }}
|
||||
{{ printf `<link rel="alternate" type="%s" href="%s" />` .MediaType.Type .Permalink $.Site.LanguageCode | safeHTML }}
|
||||
{{- end }}
|
||||
{{- range (where .Site.RegularPages "Section" "notes") }}
|
||||
<entry>
|
||||
<title>{{ .Title }}</title>
|
||||
{{- with .Site.Author.name }}
|
||||
<author>
|
||||
<name>{{ . }}</name>
|
||||
<uri>{{ $.Permalink }}</uri>
|
||||
</author>
|
||||
{{- end }}
|
||||
<id>{{ .Permalink }}</id>
|
||||
<published>{{ dateFormat "2006-01-02T15:04:05Z" .Date.UTC | safeHTML }}</published>
|
||||
<content type="html">
|
||||
{{ .Content | html }}
|
||||
</content>
|
||||
</entry>
|
||||
{{- end }}
|
||||
</feed>
|
@@ -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
|
||||
|
2
layouts/partials/head/feeds.html
Normal file
2
layouts/partials/head/feeds.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<link rel="alternate" type="application/rss+xml" href="{{ "feed.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ "feed.atom" | absURL }}" title="{{ .Site.Title }} (Atom)">
|
@@ -7,7 +7,7 @@
|
||||
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") -}}
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<link rel="alternate" type="application/rss+xml" href="{{ "feed.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
|
||||
{{ partialCached "head/feeds" . -}}
|
||||
{{ partialCached "head/webmention" . -}}
|
||||
<link rel="author" href="{{ "humans.txt" | absURL }}">
|
||||
{{ if and .IsPage (eq .Type "notes") }}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
<script src="{{ "/vendor/emoji/emoji.min.js" | absURL }}"></script>
|
||||
<script src="{{ "vendor/emoji/emoji.min.js" | absURL }}"></script>
|
||||
<script>twemoji.parse(document.body,{{ dict "base" ("/" | absURL) "folder" "vendor/emoji/svg" "ext" ".svg" | jsonify | safeJS }})</script>
|
||||
|
Reference in New Issue
Block a user