- document.title = `${this.config.title} | ${this.config.subtitle}`;
- } catch (error) {
- this.offline = true;
- }
- },
- methods: {
- getConfig: function () {
- return fetch("config.yml").then(function (response) {
- if (response.status != 200) {
- return;
+
+ 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);
+ }
+ },
+ getConfig: function (path = "assets/config.yml") {
+ return fetch(path).then((response) => {
+ if (response.status == 404 || response.redirected) {
+ this.configNotFound = true;
+ return {};
+ }
+
+ if (!response.ok) {
+ throw Error(`${response.statusText}: ${response.body}`);