Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Hugo branding in RSS XML feed #53

Closed
sharifsalah opened this issue Mar 13, 2019 · 3 comments · Fixed by #93
Closed

Update Hugo branding in RSS XML feed #53

sharifsalah opened this issue Mar 13, 2019 · 3 comments · Fixed by #93

Comments

@sharifsalah
Copy link
Contributor

The term 'Hugo' appears in the generated RSS when it shouldn't:

<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>OpenCue – New Releases</title>
<link>/blog/releases/</link>
<description>Recent Hugo news from gohugo.io</description>
<generator>Hugo -- gohugo.io</generator>
<lastBuildDate>Fri, 15 Feb 2019 19:06:19 -0500</lastBuildDate>
<image>
<url>img/hugo.png</url>
<title>GoHugo.io</title>
<link>/blog/releases/</link>
</image>

I believe this is caused by the contents of the RSS XML template.

Specifically this section:

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>{{ .Site.Title }} – {{ .Title }}</title>
    <link>{{ .Permalink }}</link>
    <description>Recent Hugo news from gohugo.io</description>
    <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
    <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
    <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
    <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
    <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
    <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
    <image>
      <url>{{ "img/hugo.png" | absURL }}</url>
      <title>GoHugo.io</title>
      <link>{{ .Permalink }}</link>
    </image>

Ideally, the template needs to be updated to populate the , <title>, <image from variables so that the tenant Docsy sites don't need to overrider this template locally.

@sharifsalah
Copy link
Contributor Author

Also, related to this, there are a bunch of issues related to the validity of the RSS feed:

https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Ftestydocsy.netlify.com%2Fblog%2Findex.xml

In particular, the XML should generally be using full URLs as opposed to relative paths. I expect this is going to require some way of configuring Docsy with the root domain for the site.

@LisaFC
Copy link
Collaborator

LisaFC commented Jun 24, 2019

Configuring the root URL is easy, you just set rootUrl in your config.toml or in your netlify.toml if you just want it for your Netlify deployment versus your local copy. I'll mention in the docs you should do that if you want a valid RSS feed. Will take a look at the actual feed template now...

@LisaFC LisaFC mentioned this issue Jun 24, 2019
@sharifsalah
Copy link
Contributor Author

Ah thanks, I don't think I had got round to configuring the root URL yet, which explains why I saw this behavior. I have since configured the root URL for robots.txt and it's working as expected. So it is just the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants