nim-lang / website

Code for the official Nim programming language website
https://nim-lang.org
Other
115 stars 78 forks source link

Make RSS links absolute #70

Closed lausek closed 6 years ago

lausek commented 6 years ago

If I try to open an entry in /feed.xml, my browser (Chrome 64.0.3282.186) tries forwarding me to /blog/2018/03/01/version-0180-released.html.

I actually don't know if this is only a problem with my aggregator, but nevertheless I think that links inside RSS feeds should be absolute. At the moment, this is what I get:

<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <!-- ... -->
        <link>/</link>
        <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
        <pubDate>Thu, 01 Mar 2018 22:44:14 +0000</pubDate>
        <lastBuildDate>Thu, 01 Mar 2018 22:44:14 +0000</lastBuildDate>
        <generator>Jekyll v3.4.3</generator>
        <item>
            <title>Version 0.18.0 released</title>
            <description>...</description>
            <pubDate>Thu, 01 Mar 2018 00:00:00 +0000</pubDate>
            <link>/blog/2018/03/01/version-0180-released.html</link>
            <guid isPermaLink="true">/blog/2018/03/01/version-0180-released.html</guid>
        </item>
        <!-- ... -->

site.url seems to be empty, but it works when the site is hosted locally.

https://github.com/nim-lang/website/blob/3cec5fc7f5ccb3eec7442b39b2fa79e0c4b642d4/jekyll/feed.xml#L20

dom96 commented 6 years ago

Make a PR please

lausek commented 6 years ago

@dom96 I haven't changed anything yet. The only thing I found out is that site.url produces nil when printed using debug function. This looks like a deeper problem - my google search didn't hit any relateable results.