Skip to content

Commit 2d80505

Browse files
committed
fix(docs): base URL handling
1 parent b72dd05 commit 2d80505

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const BASE_URL = 'https://bootstrap-vue.org'
1+
export const BASE_URL = 'https://bootstrap-vue.github.io/bootstrap-vue/'
22
export const BASE_URL_DEV = 'https://dev.bootstrap-vue.org'
33

44
export const GA_TRACKING_ID = 'UA-89526435-1'

docs/nuxt.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ const IS_PROD_DOCS =
3131

3232
// --- Utility methods ---
3333

34+
const getBaseUrlPath = url => {
35+
const { pathname } = new URL(url)
36+
37+
if (pathname.endsWith('/')) {
38+
return pathname
39+
}
40+
41+
return `${pathname}/`
42+
}
43+
3444
// Get routes by a given dir
3545
const getRoutesByDir = (root, dir, excludes = []) =>
3646
fs
@@ -235,6 +245,10 @@ module.exports = {
235245
transpile: [({ isLegacy }) => isLegacy && 'highlight.js']
236246
},
237247

248+
router: {
249+
base: getBaseUrlPath(BASE_URL)
250+
},
251+
238252
loading: {
239253
color: '#ccc',
240254
height: '3px'

0 commit comments

Comments
 (0)