+ 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}`);
+ }
+
+ const that = this;
+ return response
+ .text()
+ .then((body) => {
+ return parse(body);
+ })
+ .then(function (config) {
+ if (config.externalConfig) {
+ return that.getConfig(config.externalConfig);
+ }
+ return config;
+ });