diff --git a/README.md b/README.md index 8de6c02..e8b69a0 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,4 @@ If an item is overwritten in a new release, the attributes from the new item are - [ ] Make mobile friendly - [ ] Add mobile navigation and search - [ ] Create more react components for already existing CSS comps +- [ ] Refactor hardcoded subfolder in routing diff --git a/common/config.js b/common/config.js index 8484771..92f6702 100644 --- a/common/config.js +++ b/common/config.js @@ -5,6 +5,10 @@ export const quadrants = [ 'tools', ]; +export function assetUrl(file) { + return `/techradar/assets/${file}` +} + export const getPageNames = (radar) => { return [ 'index', diff --git a/common/file.js b/common/file.js index e75c4bf..933911d 100644 --- a/common/file.js +++ b/common/file.js @@ -27,7 +27,7 @@ export const jsPath = (...pathInSrc) => ( ); export const distPath = (...pathInDist) => ( - relativePath('dist', ...pathInDist) + relativePath('dist', 'techradar', ...pathInDist) ); export const getAllMarkdownFiles = (folder) => ( diff --git a/js/client.js b/js/client.js index 2651663..5e509e7 100644 --- a/js/client.js +++ b/js/client.js @@ -18,7 +18,9 @@ const getPageNameFromPath = (path) => { } const historyManager = store => { - const history = createHistory(); + const history = createHistory({ + basename: '/techradar' + }); // If browser-back button is pressed, provide new pageName to store history.listen((location, action) => { diff --git a/js/components/Footer.js b/js/components/Footer.js index 63688c1..5bc53da 100644 --- a/js/components/Footer.js +++ b/js/components/Footer.js @@ -1,14 +1,14 @@ import React from 'react'; import classNames from 'classnames'; import Branding from './Branding'; -import { getItemPageNames, isMobileViewport } from '../../common/config'; +import { assetUrl, getItemPageNames, isMobileViewport } from '../../common/config'; export default function Footer({ items, pageName }) { return (