Skip to content

Commit

Permalink
Fix links in blog Atom feed (#421)
Browse files Browse the repository at this point in the history
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).

* Fix link to header image
  • Loading branch information
hramos authored and JoelMarcey committed Feb 1, 2018
1 parent c6a9848 commit c99cdef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/server/feed.js
Expand Up @@ -16,8 +16,9 @@ const CWD = process.cwd();
const siteConfig = require(CWD + '/siteConfig.js');

const blogFolder = path.resolve('../blog/');
const blogRootURL = siteConfig.url + '/blog';
const jestImage = siteConfig.url + '/' + siteConfig.headerIcon;
const blogRootURL = siteConfig.url + siteConfig.baseUrl + 'blog';
const siteImageURL =
siteConfig.url + siteConfig.baseUrl + siteConfig.headerIcon;

/****************************************************************************/

Expand Down Expand Up @@ -46,7 +47,7 @@ module.exports = function(type) {
' news and events.',
id: blogRootURL,
link: blogRootURL,
image: jestImage,
image: siteImageURL,
copyright: siteConfig.copyright,
updated: new Date(MetadataBlog[0].date),
});
Expand Down

0 comments on commit c99cdef

Please sign in to comment.