1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-05-27 22:57:45 +02:00

Remove macros

This commit is contained in:
mo8it 2025-05-17 19:53:30 +02:00
parent b4a6b87e24
commit 2f700991f3
6 changed files with 40 additions and 54 deletions

View File

@ -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;

View File

@ -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 %}

View File

@ -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>

View File

@ -1,7 +1,5 @@
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block content %}
<div class="m-3">
<h1>Rustlings</h1>

View File

@ -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 %}

View File

@ -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 %}