Use blogk and extends for footer content

This commit is contained in:
Helen Chong 2024-04-18 13:52:29 +08:00
parent e6778f4050
commit 667de9699c
2 changed files with 39 additions and 31 deletions

View File

@ -0,0 +1,35 @@
<footer class="footer">
{% block footerContent %}
{{ footerContent }}
{% endblock %}
</footer>
<style>
.footer {
margin-top: auto;
background: var(--clr-main-footer-bg);
width: 72%;
padding: 0.8rem;
text-align: center;
display: grid;
}
.footer p {
padding: 0;
}
.footer__links {
justify-self: center;
list-style: none;
margin: 0;
padding: 0;
display: flex;
gap: 0.7em;
}
@media only screen and (min-width: 600px) {
.footer {
width: 100%;
}
}
</style>

View File

@ -1,4 +1,6 @@
<footer class="footer"> {% extends "global/footer.njk" %}
{% block footerContent %}
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} since <time>11 September 2022</time></p> <p>Made with ♥ by {{ sitemeta.siteAuthor.name }} since <time>11 September 2022</time></p>
{% set currentUrl %}{{ page.url }}{% endset %} {% set currentUrl %}{{ page.url }}{% endset %}
@ -13,34 +15,5 @@
| |
<li><a href="/feed.xml">RSS</a></li> <li><a href="/feed.xml">RSS</a></li>
</ul> </ul>
</footer> {% endblock %}
<style>
.footer {
margin-top: auto;
background: var(--clr-main-footer-bg);
width: 72%;
padding: 0.8rem;
text-align: center;
display: grid;
}
.footer p {
padding: 0;
}
.footer__links {
justify-self: center;
list-style: none;
margin: 0;
padding: 0;
display: flex;
gap: 0.7em;
}
@media only screen and (min-width: 600px) {
.footer {
width: 100%;
}
}
</style>