✨ Basic multi-page support working (#584)
This commit is contained in:
@@ -10,6 +10,12 @@ import {
|
||||
import ErrorHandler from '@/utils/ErrorHandler';
|
||||
import ConfigSchema from '@/utils/ConfigSchema.json';
|
||||
|
||||
/* For a given sub-page, and page type, return the URL */
|
||||
export const makePageSlug = (pageName, pageType) => {
|
||||
const formattedName = pageName.toLowerCase().replaceAll(' ', '-').replaceAll('.yml', '');
|
||||
return `/${pageType}/${formattedName}`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initiates the Accumulator class and generates a complete config object
|
||||
* Self-executing function, returns the full user config as a JSON object
|
||||
|
||||
@@ -33,7 +33,7 @@ const setSwStatus = (swStateToSet) => {
|
||||
* Or disable if user specified to disable
|
||||
*/
|
||||
const shouldEnableServiceWorker = async () => {
|
||||
const conf = yaml.load((await axios.get('conf.yml')).data);
|
||||
const conf = yaml.load((await axios.get('/conf.yml')).data);
|
||||
if (conf && conf.appConfig && conf.appConfig.enableServiceWorker) {
|
||||
setSwStatus({ disabledByUser: false });
|
||||
return true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// A list of mutation names
|
||||
const KEY_NAMES = [
|
||||
'INITIALIZE_CONFIG',
|
||||
'INITIALIZE_MULTI_PAGE_CONFIG',
|
||||
'SET_CONFIG',
|
||||
'SET_REMOTE_CONFIG',
|
||||
'SET_MODAL_OPEN',
|
||||
@@ -10,6 +11,7 @@ const KEY_NAMES = [
|
||||
'SET_ITEM_SIZE',
|
||||
'SET_THEME',
|
||||
'SET_CUSTOM_COLORS',
|
||||
'USE_MAIN_CONFIG',
|
||||
'UPDATE_ITEM',
|
||||
'SET_PAGE_INFO',
|
||||
'SET_APP_CONFIG',
|
||||
|
||||
Reference in New Issue
Block a user