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> </main>
<footer> <footer>
<ul> <ul>
<li><a href="https://github.com/Wolvan/poll.horse" target="_blank">Github Repo</a></li> {{ FOOTER_LINKS }}
</ul> </ul>
<div class="copyright">© 2021 Wolvan</div> <div class="copyright">{{ FOOTER_COPYRIGHT }}</div>
</footer> </footer>
</body> </body>
</html> </html>

View file

@ -55,7 +55,11 @@ class MinificationTransform extends RenderTransform {
const defaultReplacements = { const defaultReplacements = {
"TITLE": "Poll Horse", "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 { class Defaults2RenderTransform extends MinificationTransform {
constructor(replacements = {}) { constructor(replacements = {}) {