diff options
| author | mo8it <mo8it@proton.me> | 2025-05-17 19:53:30 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2025-05-17 19:53:30 +0200 |
| commit | 2f700991f32de65ad8a6972edfa688731fa528f4 (patch) | |
| tree | 3026b3539c192b34bafbeade2f164f714da9fc73 | |
| parent | b4a6b87e2402c8b1e56227957ed9b61406d2ce24 (diff) | |
Remove macros
| -rw-r--r-- | website/input.css | 2 | ||||
| -rw-r--r-- | website/templates/404.html | 6 | ||||
| -rw-r--r-- | website/templates/base.html | 12 | ||||
| -rw-r--r-- | website/templates/index.html | 2 | ||||
| -rw-r--r-- | website/templates/macros.html | 38 | ||||
| -rw-r--r-- | website/templates/page.html | 34 |
6 files changed, 40 insertions, 54 deletions
diff --git a/website/input.css b/website/input.css index cd7a777..3dd5501 100644 --- a/website/input.css +++ b/website/input.css @@ -38,7 +38,7 @@ @apply my-5 rounded-full; } img { - @apply max-w-full w-full h-full mx-auto my-5 object-contain md:w-3/4 lg:w-3/5 rounded-sm shadow-sm; + @apply md:w-3/4 lg:w-3/5; } blockquote { @apply px-3 pt-2 pb-0.5 my-4 border-s-4 border-white/80 bg-white/7 rounded-sm italic; diff --git a/website/templates/404.html b/website/templates/404.html index ecee207..9bbd441 100644 --- a/website/templates/404.html +++ b/website/templates/404.html @@ -1,16 +1,14 @@ {% extends "base.html" %} -{% import "macros.html" as macros %} - {% block content %} <div class="flex flex-col mx-auto text-center"> <h1>DON'T PANIC!</h1> <h2>404: Page not found!</h2> - <img class="max-h-[50vh]" + <img class="max-h-[50vh] mx-auto" src="{{ get_url(path='images/panic.svg') | safe }}" alt=""> - {{ macros::btn(link=get_url(path="/") , content="Back to the homepage") }} + <a class="text-2xl font-bold" href="{{ get_url(path='/') }}">Back to homepage</a> </div> {% endblock %} diff --git a/website/templates/base.html b/website/templates/base.html index 5745db3..8306ac7 100644 --- a/website/templates/base.html +++ b/website/templates/base.html @@ -52,7 +52,7 @@ <a class="transition duration-500 hover:scale-110" href="{{ get_url(path='/') | safe }}" aria-hidden="true"> - <img class="m-0 w-12 h-12" + <img class="w-12 h-12" src="{{ get_url(path=config.extra.logo_path) | safe }}" alt=""> </a> @@ -68,17 +68,17 @@ {% block content %}{% endblock %} </main> - <footer class="pt-2 pb-1 mt-auto text-center"> - <div class="mx-auto inline-flex gap-x-1.5 items-center"> + <footer class="pt-2 pb-1 mt-auto text-center text-sm"> + <div class="mt-2 mx-auto inline-flex gap-x-1.5 items-center"> <img class="w-8 h-8" src="{{ get_url(path='images/rust_logo.svg') | safe }}" alt=""> - <div class="text-sm italic">Rustlings is an official Rust project</div> + <div class="italic">Rustlings is an official Rust project</div> </div> - <nav class="flex flex-col gap-y-3 justify-around py-3 bg-black/30 rounded-sm sm:flex-row sm:rounded-full"> + <nav class="mt-3 flex flex-col gap-y-3 justify-around py-3 bg-black/30 rounded-sm sm:flex-row sm:rounded-full"> {% for footer_item in config.extra.footer_items %} - <a class="text-sm no-underline" href="{{ footer_item.url | safe }}">{{ footer_item.name }}</a> + <a class="no-underline" href="{{ footer_item.url | safe }}">{{ footer_item.name }}</a> {% endfor %} </nav> </footer> diff --git a/website/templates/index.html b/website/templates/index.html index c61defd..0d2b2e3 100644 --- a/website/templates/index.html +++ b/website/templates/index.html @@ -1,7 +1,5 @@ {% extends "base.html" %} -{% import "macros.html" as macros %} - {% block content %} <div class="m-3"> <h1>Rustlings</h1> diff --git a/website/templates/macros.html b/website/templates/macros.html deleted file mode 100644 index dd7b928..0000000 --- a/website/templates/macros.html +++ /dev/null @@ -1,38 +0,0 @@ -{% macro toc() %} - {% if page.toc %} - <div class="px-4 py-0.5 my-3 border-s-4 rounded-xl border-double"> - <nav> - <ul class="ml-0 list-none"> - {% for parent in page.toc %} - {% if parent.level == 2 %} - <li> - {#- -#} - <a href="{{ parent.permalink | safe }}">{{ parent.title }}</a> - {#- -#} - {% if parent.children %} - <ul class="my-0 ml-5 list-none"> - {% for child in parent.children %} - {% if child.level == 3 %} - <li> - {#- -#} - <a class="text-base" href="{{ child.permalink | safe }}">{{ child.title }}</a> - {#- -#} - </li> - {% endif %} - {% endfor %} - </ul> - {% endif %} - {#- -#} - </li> - {% endif %} - {% endfor %} - </ul> - </nav> - </div> - {% endif %} -{% endmacro %} - -{% macro btn(link, content) %} - <a class="py-1.5 px-3 my-2 no-underline bg-gray-800 rounded-xl transition duration-500 hover:scale-[1.02]" - href="{{ link | safe }}">{{ content | safe }}</a> -{% endmacro %} diff --git a/website/templates/page.html b/website/templates/page.html index 90b269d..8c9a9f1 100644 --- a/website/templates/page.html +++ b/website/templates/page.html @@ -1,11 +1,39 @@ {% extends "base.html" %} -{% import "macros.html" as macros %} - {% block content %} <article> <h1>{{ page.title }}</h1> - {{ page.content | replace(from="<!-- toc -->", to=macros::toc() ) | safe }} + <div class="px-4 py-0.5 my-3 border-s-4 rounded-xl border-double"> + <nav> + <ul class="ml-0 list-none"> + {% for parent in page.toc %} + {% if parent.level == 2 %} + <li> + {#- -#} + <a href="{{ parent.permalink | safe }}">{{ parent.title }}</a> + {#- -#} + {% if parent.children %} + <ul class="my-0 ml-5 list-none"> + {% for child in parent.children %} + {% if child.level == 3 %} + <li> + {#- -#} + <a class="text-base" href="{{ child.permalink | safe }}">{{ child.title }}</a> + {#- -#} + </li> + {% endif %} + {% endfor %} + </ul> + {% endif %} + {#- -#} + </li> + {% endif %} + {% endfor %} + </ul> + </nav> + </div> + + {{ page.content | safe }} </article> {% endblock %} |
