diff options
| author | seth <[email protected]> | 2024-07-19 21:10:35 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-07-19 21:10:35 -0400 |
| commit | 86efdd0afb6219298ee7625e73dc1cb6004b7ca4 (patch) | |
| tree | e537d4a2f5cb59864eed1a60b7278b221006d230 | |
| parent | 531455110155d3c86de2aff091f36ebddcb27fa5 (diff) | |
split up templates
| -rw-r--r-- | config.toml | 2 | ||||
| -rw-r--r-- | content/_index.md | 4 | ||||
| -rw-r--r-- | templates/404.html | 17 | ||||
| -rw-r--r-- | templates/base.html | 32 | ||||
| -rw-r--r-- | templates/index.html | 25 | ||||
| -rw-r--r-- | templates/page.html | 6 | ||||
| -rw-r--r-- | templates/partials/footer.html | 3 | ||||
| -rw-r--r-- | templates/partials/head.html | 20 | ||||
| -rw-r--r-- | templates/partials/nav.html | 9 | ||||
| -rw-r--r-- | templates/section.html | 5 |
10 files changed, 64 insertions, 59 deletions
diff --git a/config.toml b/config.toml index 2dfaca1..5eb23b2 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ base_url = "https://getchoo.com" -title = "guzzle guzzle" +title = "getchoo's website" description = "guzzle guzzle" minify_html = true hard_link_static = true diff --git a/content/_index.md b/content/_index.md index fc9d2e0..7e351a0 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,6 +1,6 @@ +++ -title = "guzzle guzzle" -description = "guzzle guzzle" +title = "home" +description = "rawr" +++ <a hidden rel="me" href="https://wetdry.world/@getchoo"> diff --git a/templates/404.html b/templates/404.html index e0d1ed7..f391896 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,15 +1,12 @@ {% extends "base.html" %} -{% block title %}404!{% endblock title %} -{% block description %}Can I get you some tapwater?{% endblock description %} - {% block content %} -<h1>404 :(</h1> + <h1>404 :(</h1> -<img - src="/imgs/tapwater.png" - alt="Can I get you some tapwater?" - loading="lazy" - decoding="async" -> + <img + src="/imgs/tapwater.png" + alt="Can I get you some tapwater?" + loading="lazy" + decoding="async" + > {% endblock content %} diff --git a/templates/base.html b/templates/base.html index bbaa05f..b15d5eb 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,36 +1,10 @@ <!doctype html> <html lang="en"> - {% block head %} - <head> - <meta charset="UTF-8" /> - <title>{% block title %}{% endblock title %}</title> - <meta name="viewport" content="width=device-width,initial-scale=1" /> - <meta - name="description" - content="{% block description %}{% endblock description %}" - /> - <style>{{ load_data(path="static/main.css") | safe }}</style> - <link rel="sitemap" href="sitemap.xml" /> - </head> - {% endblock head %} + {% include "partials/head.html" %} <body> <h1><b>getchoo's website 🦀</b></h1> - {% block nav %} - <nav> - <div id="nav_links"> - {% for link in config.extra.nav_links %} - <a href="{{ link.url }}">{{ link.name }}</a> - {% endfor %} - </div> - - <hr /> - </nav> - {% endblock nav %} + {% include "partials/nav.html" %} {% block content %}{% endblock content %} - {% block footer %} - <footer> - <a href="{{ config.extra.repository_url }}">source code</a> - </footer> - {% endblock footer %} + {% include "partials/footer.html" %} </body> </html> diff --git a/templates/index.html b/templates/index.html index db540b6..8a9042f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,20 +1,17 @@ {% extends "base.html" %} -{% block title %}{{ section.title }}{% endblock title %} -{% block description %}{{ section.description }}{% endblock description %} - {% block content %} -{{ section.content | safe }} + {{ section.content | safe }} -<div id="gifs"> - {% for gif in config.extra.gifs %} - {% set img = '<img src = "/imgs/gifs/' ~ gif.name ~'" alt="' ~ gif.alt ~ '" width=88 height=31 loading="lazy" decoding="async">' %} - {% if gif.href %} - <a href="{{ gif.href }}">{{ img | safe }}</a> - {% else %} - {{ img | safe }} - {% endif %} - {% endfor %} -</div> + <div id="gifs"> + {% for gif in config.extra.gifs %} + {% set img = '<img src = "/imgs/gifs/' ~ gif.name ~'" alt="' ~ gif.alt ~ '" width=88 height=31 loading="lazy" decoding="async">' %} + {% if gif.href %} + <a href="{{ gif.href }}">{{ img | safe }}</a> + {% else %} + {{ img | safe }} + {% endif %} + {% endfor %} + </div> {% endblock content %} diff --git a/templates/page.html b/templates/page.html index bbe1a2b..fce601d 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -<div class="blogpost"> - {{ page.content | safe }} -</div> + <div class="blogpost"> + {{ page.content | safe }} + </div> {% endblock content %} diff --git a/templates/partials/footer.html b/templates/partials/footer.html new file mode 100644 index 0000000..122766f --- /dev/null +++ b/templates/partials/footer.html @@ -0,0 +1,3 @@ +<footer> + <a href="{{ config.extra.repository_url }}">source code</a> +</footer> diff --git a/templates/partials/head.html b/templates/partials/head.html new file mode 100644 index 0000000..5b1dcf6 --- /dev/null +++ b/templates/partials/head.html @@ -0,0 +1,20 @@ +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width,initial-scale=1" /> + <style>{{ load_data(path="static/main.css") | safe }}</style> + <link rel="sitemap" href="sitemap.xml" /> + {% if page.title %} + <title>{{ page.title }} :: {{ config.title }}</title> + {% elif section.title %} + <title>{{ section.title }} :: {{ config.title }}</title> + {% else %} + <title>{{ config.title }}</title> + {% endif %} + {% if page.description %} + <meta name="description" content="{{ page.description }}" /> + {% elif section.description %} + <meta name="description" content="{{ section.description }}" /> + {% else %} + <meta name="description" content="{{ config.description }}" /> + {% endif %} +</head> diff --git a/templates/partials/nav.html b/templates/partials/nav.html new file mode 100644 index 0000000..e65db1d --- /dev/null +++ b/templates/partials/nav.html @@ -0,0 +1,9 @@ +<nav> + <div id="nav_links"> + {% for link in config.extra.nav_links %} + <a href="{{ link.url }}">{{ link.name }}</a> + {% endfor %} + </div> + + <hr /> +</nav> diff --git a/templates/section.html b/templates/section.html new file mode 100644 index 0000000..d3312c1 --- /dev/null +++ b/templates/section.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} + {{ section.content | safe }} +{% endblock content %} |
