diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-08-26 21:52:28 +0200 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-08-26 21:52:28 +0200 |
commit | 34259e1e94e3563520dd42edec234b08ea5fe9e3 (patch) | |
tree | 78158654ab8b50dd7359cb06ebed6381e997a00e /src | |
parent | 18d9582d7b2f63c26b768b52e11f0a63f62303ec (diff) | |
download | homer-34259e1e94e3563520dd42edec234b08ea5fe9e3.tar.gz homer-34259e1e94e3563520dd42edec234b08ea5fe9e3.tar.zst homer-34259e1e94e3563520dd42edec234b08ea5fe9e3.zip |
Additional page name as css classv22.08.1
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 13 |
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); |