Skip to content

Commit b243676

Browse files
authored
fix: Change base url for subdirectory (#309)
* Change base url * Change url * Fix config * Change base url again * Another try * Add file to see if that fixes deploy * Add env var for prod v. deploy
1 parent 363e8e0 commit b243676

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docusaurus.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
const { themes } = require('prism-react-renderer');
22
const lightCodeTheme = themes.github;
33
const darkCodeTheme = themes.dracula;
4+
// This is defined in the Netlify environment variables on the Netlify UI
5+
const { ADD_SLASH_DOCS_TO_URL } = process.env;
46

57
/** @type {import('@docusaurus/types').DocusaurusConfig} */
68
module.exports = {
79
title: "OpenSauced",
810
tagline: "The path to your next Open Source contribution",
9-
url: "https://docs.opensauced.pizza",
10-
baseUrl: "/",
11+
url: ADD_SLASH_DOCS_TO_URL ? "https://opensauced.pizza" : "https://docs.opensauced.pizza",
12+
baseUrl: ADD_SLASH_DOCS_TO_URL ? "/docs/" : "/",
1113
onBrokenLinks: "throw",
1214
onBrokenMarkdownLinks: "warn",
1315
favicon: "img/favicon.ico",

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
base = "/"
3+
publish = "build" # Make sure this points to the correct output directory
4+
command = "npm run build" # The command to build your site

0 commit comments

Comments
 (0)