aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/App.vue13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/App.vue b/src/App.vue
index 4120fe5..5ab5c0d 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,6 +4,7 @@
4 v-if="config" 4 v-if="config"
5 :class="[ 5 :class="[
6 `theme-${config.theme}`, 6 `theme-${config.theme}`,
7 `page-${currentPage}`,
7 isDark ? 'is-dark' : 'is-light', 8 isDark ? 'is-dark' : 'is-light',
8 !config.footer ? 'no-footer' : '', 9 !config.footer ? 'no-footer' : '',
9 ]" 10 ]"
@@ -171,6 +172,7 @@ export default {
171 data: function () { 172 data: function () {
172 return { 173 return {
173 loaded: false, 174 loaded: false,
175 currentPage: null,
174 configNotFound: false, 176 configNotFound: false,
175 config: null, 177 config: null,
176 services: null, 178 services: null,
@@ -202,14 +204,11 @@ export default {
202 let config; 204 let config;
203 try { 205 try {
204 config = await this.getConfig(); 206 config = await this.getConfig();
205 const path = 207 this.currentPage = window.location.hash.substring(1) || "default";
206 window.location.hash.substring(1) != ""
207 ? window.location.hash.substring(1)
208 : null;
209 208
210 if (path) { 209 if (this.currentPage !== "default") {
211 let pathConfig = await this.getConfig(`assets/${path}.yml`); // the slash (/) is included in the pathname 210 let pageConfig = await this.getConfig(`assets/${this.currentPage}.yml`);
212 config = Object.assign(config, pathConfig); 211 config = Object.assign(config, pageConfig);
213 } 212 }
214 } catch (error) { 213 } catch (error) {
215 console.log(error); 214 console.log(error);