fix: clean up html/njk formatting

This commit is contained in:
Devin Haska 2024-02-04 10:53:11 -08:00
parent a65a26ebe4
commit 9b773d7ce2
5 changed files with 45 additions and 61 deletions

View file

@ -1 +1,3 @@
<footer>Footer.</footer> <footer>
Footer.
</footer>

View file

@ -1 +1,3 @@
<header>{% include "partials/menu.html" %}</header> <header>
{% include "partials/menu.html" %}
</header>

View file

@ -3,17 +3,7 @@
<ul> <ul>
{% for item in navigation.top %} {% for item in navigation.top %}
<li> <li>
<a <a class="nav" href="{{ item.url }}" {{ helpers.getLinkActiveState(item.url, page.url) | safe }}>{{ item.text }}</a>
class="nav"
href="{{ item.url }}"
{{
helpers.getLinkActiveState(item.url,
page.url)
|
safe
}}
>{{ item.text }}</a
>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

View file

@ -1,38 +1,32 @@
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<!-- charset/http-equiv/viewport --> <!-- charset/http-equiv/viewport -->
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/assets/css/global.css" /> <link rel="stylesheet" href="/assets/css/global.css" />
{% for preload in preloads %} {% for preload in preloads %}
<link <link rel="preload"
rel="preload"
as="{{ preload.as }}" as="{{ preload.as }}"
href="{{ preload.href }}" href="{{ preload.href }}"
{% {% if preload.crossorigin %}crossorigin{% endif %} />
if {% endfor %}
preload.crossorigin {% set fontCss %}
%}crossorigin{% {% include "css/fontFace.njk" %}
endif {% include "css/fontVariables.njk" %}
%} {% endset %}
/> <style>{{ fontCss | minifyCss | safe }}</style>
{% endfor %} {% set fontCss %} {% include "css/fontFace.njk" %} {% include {% set colorCss %}
"css/fontVariables.njk" %}{% endset %} {% include "css/colorVariables.njk" %}
<style> {% endset %}
{{ fontCss | minifyCss | safe }} <style>{{ colorCss | minifyCss | safe }}</style>
</style>
{% set colorCss %} {% include "css/colorVariables.njk" %} {% endset %}
<style>
{{ colorCss | minifyCss | safe }}
</style>
</head> </head>
<body> <body>
{% include "partials/header.html" %} {% include "partials/header.html" %}
<main id="main" class="wrapper flow">{{ content | safe }}</main> <main id="main" class="wrapper flow">
{{ content | safe }}
</main>
{% include "partials/footer.html" %} {% include "partials/footer.html" %}
</body> </body>
</html> </html>

View file

@ -3,12 +3,8 @@ layout: base
--- ---
<p>{{ date }}</p> <p>{{ date }}</p>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<ul> <ul>
{% for category in categories %} {% for category in categories %}<li>#{{ category }}</li>{% endfor %}
<li>#{{ category }}</li>
{% endfor %}
</ul> </ul>
{{ content | safe }} {{ content | safe }}