From 86efdd0afb6219298ee7625e73dc1cb6004b7ca4 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 19 Jul 2024 21:10:35 -0400 Subject: split up templates --- config.toml | 2 +- content/_index.md | 4 ++-- templates/404.html | 17 +++++++---------- templates/base.html | 32 +++----------------------------- templates/index.html | 25 +++++++++++-------------- templates/page.html | 6 +++--- templates/partials/footer.html | 3 +++ templates/partials/head.html | 20 ++++++++++++++++++++ templates/partials/nav.html | 9 +++++++++ templates/section.html | 5 +++++ 10 files changed, 64 insertions(+), 59 deletions(-) create mode 100644 templates/partials/footer.html create mode 100644 templates/partials/head.html create mode 100644 templates/partials/nav.html create mode 100644 templates/section.html 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" +++ - {% endblock nav %} + {% include "partials/nav.html" %} {% block content %}{% endblock content %} - {% block footer %} - - {% endblock footer %} + {% include "partials/footer.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 }} -
- {% for gif in config.extra.gifs %} - {% set img = '' ~ gif.alt ~ '' %} - {% if gif.href %} - {{ img | safe }} - {% else %} - {{ img | safe }} - {% endif %} - {% endfor %} -
+
+ {% for gif in config.extra.gifs %} + {% set img = '' ~ gif.alt ~ '' %} + {% if gif.href %} + {{ img | safe }} + {% else %} + {{ img | safe }} + {% endif %} + {% endfor %} +
{% 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 %} -
- {{ page.content | safe }} -
+
+ {{ page.content | safe }} +
{% 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 @@ + 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 @@ + + + + + + {% if page.title %} + {{ page.title }} :: {{ config.title }} + {% elif section.title %} + {{ section.title }} :: {{ config.title }} + {% else %} + {{ config.title }} + {% endif %} + {% if page.description %} + + {% elif section.description %} + + {% else %} + + {% endif %} + 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 @@ + 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 %} -- cgit v1.2.3