X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FApp.vue;h=d97df0cc18d1f5ad5ff1af3ba5f8c8b1a059619c;hb=d1b29caaa62ef19e9dd68babf334ec25a966f945;hp=d7054a7f453c8e0bd03eb0f64975482c44722d44;hpb=0ae40f78f837e95ba2ccb04025c6bebcc09d7ab4;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/src/App.vue b/src/App.vue index d7054a7..d97df0c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,7 +14,7 @@
{{ config.subtitle }} @@ -26,7 +26,7 @@ @@ -40,9 +40,9 @@
@@ -51,7 +51,7 @@
@@ -159,7 +159,16 @@ export default { } this.config = merge(defaults, config); this.services = this.config.services; - document.title = `${this.config.title} | ${this.config.subtitle}`; + document.title = + this.config.documentTitle || + `${this.config.title} | ${this.config.subtitle}`; + if (this.config.stylesheet) { + let stylesheet = ""; + for (const file of this.config.stylesheet) { + stylesheet += `@import "${file}";`; + } + this.createStylesheet(stylesheet); + } }, methods: { getConfig: function (path = "assets/config.yml") { @@ -235,6 +244,11 @@ export default { }, }; }, + createStylesheet: function (css) { + let style = document.createElement("style"); + style.appendChild(document.createTextNode(css)); + document.head.appendChild(style); + }, }, };