will
September 24, 2023, 12:52am
1
Paige has:
<link href="http://willfaught.com/paige/atom.xml" rel="self" type="application/atom+xml"/>
<link href="http://willfaught.com/paige/index.json" rel="alternate" type="application/json"/>
<link href="http://willfaught.com/paige/rss.xml" rel="alternate" type="application/rss+xml"/>
This is resulting in W3C Feed Validation Service, for Atom and RSS reporting an error:
Self reference doesn’t match document location
ju52
September 24, 2023, 8:51am
3
better to use RelPermalink in the templates
ex:
{{ with site.Home.OutputFormats.Get "FEED"}}<atom:link href="{{.RelPermalink}}" rel="self" type="{{ safeHTML .MediaType.Type }}" />{{end}}
{{ with site.Home.OutputFormats.Get "ATOM"}}<atom:link href="{{.RelPermalink}}" rel="alternate" type="{{ safeHTML .MediaType.Type }}" />{{end}}
{{ with site.Home.OutputFormats.Get "JSON"}}<atom:link href="{{.RelPermalink}}" rel="alternate" type="{{ safeHTML .MediaType.Type }}" />{{end}}
I have it explicit defined in my config
[mediaTypes]
[mediaTypes."application/atom+xml"]
suffixes = ["xml"]
[mediaTypes."application/rss+xml"]
suffixes = ["xml"]
[mediaTypes."application/feed+json"]
suffixes = ["json"]
[outputFormats.JSON]
mediaType = "application/json"
baseName = "feeds/feed"
rel = "alternate"
isPlainText = true
isHTML = false
noUgly = false
[outputFormats.FEED] ##### ==> no collision with buildin RSS!
mediaType = "application/rss+xml"
baseName = "feeds/feed.rss"
rel = "alternate"
isPlainText = false
isHTML = false
noUgly = true
[outputFormats.ATOM]
mediaType = "application/atom+xml"
baseName = "feeds/feed.atom"
rel = "alternate"
isPlainText = false
isHTML = false
noUgly = true
will
September 24, 2023, 9:29pm
4
baseURL?
I think that was it. The site was deployed with GitHub Pages, and “Enforce HTTPS” wasn’t enabled, so I think base_url in hugo --baseURL ${{ steps.pages.outputs.base_url }}
was “http”, not “https”. I now see <atom:link href="https://willfaught.com/paige/atom.xml" rel="self" type="application/rss+xml"/>
(note the “https”) live, so the scheme is now fixed! Thanks.
Edit: I put my other problem into its own post: RSS permalink is Atom permalink somehow
system
Closed
September 26, 2023, 9:29pm
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.