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

Fix links in blog Atom feed #421

Merged
merged 2 commits into from
Feb 1, 2018
Merged

Fix links in blog Atom feed #421

merged 2 commits into from
Feb 1, 2018

Conversation

hramos
Copy link
Contributor

@hramos hramos commented Jan 26, 2018

The root URL was missing the baseURL portion. This is fine when a site is hosted on a custom URL such as docusaurus.io, because the generated URL will be valid (docusaurus.io/blog), but it breaks when the site is hosted on GitHub Pages (the React Native feed was using facebook.github.io/blog as the rootURL).

The current React Native feed looks like this (truncated):

<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://facebook.github.io/blog</id>
<title>React Native Blog</title>
<updated>2018-01-18T06:00:00Z</updated>
<generator>Feed for Node.js</generator>
<link rel="alternate" href="https://facebook.github.io/blog"/>
<subtitle>
The best place to stay up-to-date with the latest React Native news and events.
</subtitle>
<logo>https://facebook.github.ioimg/header_logo.png</logo>
<entry>
<title type="html">
<![CDATA[
Implementing Twitter’s App Loading Animation in React Native
]]>
</title>
<id>
https://facebook.github.io/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native.html
</id>
<link href="https://facebook.github.io/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native.html"></link>
<updated>2018-01-18T06:00:00Z</updated>
<summary type="html">
<![CDATA[
Twitter’s iOS app has a loading animation I quite enjoy. <img src="/react-native/blog/assets/loading-screen-01.gif" style="float: left; padding-right: 80px; padding-bottom: 20px"/> Once the app is ready, the Twitter logo delightfully expands, revea
]]>
</summary>
<author>
<name>Eli White</name>
<uri>https://github.com/TheSavior</uri>
</author>
</entry>

Note that the id at the top is incorrect (https://facebook.github.io/blog), as well as the individual entry links (https://facebook.github.io/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native.html).

After this change, the URLs should result in https://facebook.github.io/react-native/blog and https://facebook.github.io/react-native/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native.html respectively.

Docusaurus's own feed is fine, because it's base URL is a plain / as it is hosted on its own domain.

Test Plan

Generate feed in react-native-website, confirm links have been fixed:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://facebook.github.io/react-native/blog</id>
    <title>React Native Blog</title>
    <updated>2018-01-18T06:00:00Z</updated>
    <generator>Feed for Node.js</generator>
    <link rel="alternate" href="https://facebook.github.io/react-native/blog"/>
    <subtitle>The best place to stay up-to-date with the latest React Native news and events.</subtitle>
    <logo>https://facebook.github.io/img/header_logo.png</logo>
    <entry>
        <title type="html"><![CDATA[Implementing Twitter’s App Loading Animation in React Native]]></title>
        <id>https://facebook.github.io/react-native/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native.html</id>
        <link href="https://facebook.github.io/react-native/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native.html">
        </link>
        <updated>2018-01-18T06:00:00Z</updated>
        <summary type="html"><![CDATA[Twitter’s iOS app has a loading animation I quite enjoy.

<img src="/react-native/blog/assets/loading-screen-01.gif" style="float: left; padding-right: 80px; padding-bottom: 20px"/>

Once the app is ready, the Twitter logo delightfully expands, revea]]></summary>
        <author>
            <name>Eli White</name>
            <uri>https://github.com/TheSavior</uri>
        </author>
    </entry>

The root URL was missing the baseURL portion. This is fine when a site is hosted on a custom URL such as docusaurus.io, because the generated URL will be valid (docusaurus.io/blog), but it breaks when the site is hosted on GitHub Pages (the React Native feed was using facebook.github.io/blog as the rootURL).
@hramos
Copy link
Contributor Author

hramos commented Jan 26, 2018

Noticed that had the same issue. Fixed in previous commit.

Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @hramos!

@JoelMarcey JoelMarcey merged commit c99cdef into facebook:master Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants