From e97a23ec6dd7025cc897689a342214cbe9275cd7 Mon Sep 17 00:00:00 2001 From: ylemkimon Date: Mon, 30 Jul 2018 03:04:32 +0900 Subject: [PATCH] Set baseUrl depending on the environment (#1526) --- website/siteConfig.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/siteConfig.js b/website/siteConfig.js index dfcf61f2..803b822c 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -8,6 +8,10 @@ // See https://docusaurus.io/docs/site-config.html for all the possible // site configuration options. +// If BASE_URL environment variable is set, use it as baseUrl. +// If on netlify, use '/'. Otherwise use '/KaTeX/'. +const baseUrl = process.env.BASE_URL || (process.env.CONTEXT ? '/' : '/KaTeX/'); + /* List of projects/orgs using your project for the users page */ const users = [ { @@ -22,7 +26,7 @@ const siteConfig = { title: 'KaTeX', tagline: 'The fastest math typesetting library for the web', url: 'https://khan.github.io', - baseUrl: '/KaTeX/', + baseUrl, // Used for publishing and more projectName: 'KaTeX',