fix: do not hardcode siteConfig path (#1150)

* Fix broken build

Do not hardcode path in require to siteConfig

* Just require instead of loadConfig

* Actually use loadConfig

I think the test may be wrong too.

* refactor & nits

* jest mock to fix test

* fix test
This commit is contained in:
Joel Marcey 2018-12-07 10:09:25 -08:00 committed by Endilie Yacop Sucipto
parent 71824a3541
commit c78a8b4262
5 changed files with 19 additions and 11 deletions

View file

@ -111,7 +111,7 @@ function getMarkup(rawContent, mdToHtml, metadata) {
content = mdToHtmlify(content, mdToHtml, metadata);
// replace any relative links to static assets (not in fenced code blocks) to absolute links
content = replaceAssetsLink(content, 'docs');
content = replaceAssetsLink(content, `${siteConfig.baseUrl}docs`);
const DocsLayout = require('../core/DocsLayout.js');
return renderToStaticMarkupWithDoctype(