From c99cdefd3a314e53cc23ff65eeaa6837cb49d034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= <165856+hramos@users.noreply.github.com> Date: Wed, 31 Jan 2018 20:04:35 -0800 Subject: [PATCH] Fix links in blog Atom feed (#421) 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 --- lib/server/feed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/server/feed.js b/lib/server/feed.js index 8b2674729dc5..3fb41a5fb65b 100644 --- a/lib/server/feed.js +++ b/lib/server/feed.js @@ -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; /****************************************************************************/ @@ -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), });