mirror of
https://github.com/Ellpeck/TinyLifeWeb.git
synced 2024-11-22 19:28:35 +01:00
improved the changelog & in-game news display on the docs site
This commit is contained in:
parent
93225b48a0
commit
e34488f498
2 changed files with 17 additions and 1 deletions
|
@ -41,7 +41,8 @@
|
||||||
"dest": "_site",
|
"dest": "_site",
|
||||||
"template": [
|
"template": [
|
||||||
"default",
|
"default",
|
||||||
"modern"
|
"modern",
|
||||||
|
"overrides"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
15
docs/overrides/conceptual.extension.js
Normal file
15
docs/overrides/conceptual.extension.js
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
exports.preTransform = function (model) {
|
||||||
|
if (model._path.includes("Changelog") || model._path.includes("InGameNews")) {
|
||||||
|
// reduce header levels by 1
|
||||||
|
model.conceptual = model.rawTitle + model.conceptual;
|
||||||
|
for (let i = 5; i >= 1; i--) {
|
||||||
|
model.conceptual = model.conceptual.replaceAll(`<h${i}`, `<h${i + 1}`);
|
||||||
|
model.conceptual = model.conceptual.replaceAll(`</h${i}`, `</h${i + 1}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set appropriate title
|
||||||
|
model.title = model._path.includes("Changelog") ? "Changelog" : "In-Game News";
|
||||||
|
model.rawTitle = `<h1>${model.title}</h1>`;
|
||||||
|
}
|
||||||
|
return model;
|
||||||
|
};
|
Loading…
Reference in a new issue