Serverside render footer

This way it's easy to add new links or a changed copyright to the footer
on all pages.
This commit is contained in:
Wolvan 2022-01-04 22:11:27 +01:00
parent 3e06f08e42
commit 5b5dc9d922
2 changed files with 7 additions and 3 deletions

View file

@ -51,9 +51,9 @@
</main>
<footer>
<ul>
<li><a href="https://github.com/Wolvan/poll.horse" target="_blank">Github Repo</a></li>
{{ FOOTER_LINKS }}
</ul>
<div class="copyright">© 2021 Wolvan</div>
<div class="copyright">{{ FOOTER_COPYRIGHT }}</div>
</footer>
</body>
</html>

View file

@ -55,7 +55,11 @@ class MinificationTransform extends RenderTransform {
const defaultReplacements = {
"TITLE": "Poll Horse",
"DEVELOPER_CONTACT_INFO": "developer@poll.horse"
"DEVELOPER_CONTACT_INFO": "developer@poll.horse",
"FOOTER_COPYRIGHT": `© ${ (new Date()).getFullYear() } Wolvan`,
"FOOTER_LINKS": `
<li><a href="https://github.com/Wolvan/poll.horse" target="_blank">Github Repo</a></li>
`
};
class Defaults2RenderTransform extends MinificationTransform {
constructor(replacements = {}) {