Page.OutputFormats.*.Permalink has http scheme, not https

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

baseURL?

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

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! :tada: Thanks.

Edit: I put my other problem into its own post: RSS permalink is Atom permalink somehow

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.