Skip to content

Commit 2f70099

Browse files
committed
Remove macros
1 parent b4a6b87 commit 2f70099

File tree

6 files changed

+40
-54
lines changed

6 files changed

+40
-54
lines changed

website/input.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@apply my-5 rounded-full;
3939
}
4040
img {
41-
@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;
41+
@apply md:w-3/4 lg:w-3/5;
4242
}
4343
blockquote {
4444
@apply px-3 pt-2 pb-0.5 my-4 border-s-4 border-white/80 bg-white/7 rounded-sm italic;

website/templates/404.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
{% extends "base.html" %}
22

3-
{% import "macros.html" as macros %}
4-
53
{% block content %}
64
<div class="flex flex-col mx-auto text-center">
75
<h1>DON'T PANIC!</h1>
86
<h2>404: Page not found!</h2>
97

10-
<img class="max-h-[50vh]"
8+
<img class="max-h-[50vh] mx-auto"
119
src="{{ get_url(path='images/panic.svg') | safe }}"
1210
alt="">
1311

14-
{{ macros::btn(link=get_url(path="/") , content="Back to the homepage") }}
12+
<a class="text-2xl font-bold" href="{{ get_url(path='/') }}">Back to homepage</a>
1513
</div>
1614
{% endblock %}

website/templates/base.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<a class="transition duration-500 hover:scale-110"
5353
href="{{ get_url(path='/') | safe }}"
5454
aria-hidden="true">
55-
<img class="m-0 w-12 h-12"
55+
<img class="w-12 h-12"
5656
src="{{ get_url(path=config.extra.logo_path) | safe }}"
5757
alt="">
5858
</a>
@@ -68,17 +68,17 @@
6868
{% block content %}{% endblock %}
6969
</main>
7070

71-
<footer class="pt-2 pb-1 mt-auto text-center">
72-
<div class="mx-auto inline-flex gap-x-1.5 items-center">
71+
<footer class="pt-2 pb-1 mt-auto text-center text-sm">
72+
<div class="mt-2 mx-auto inline-flex gap-x-1.5 items-center">
7373
<img class="w-8 h-8"
7474
src="{{ get_url(path='images/rust_logo.svg') | safe }}"
7575
alt="">
76-
<div class="text-sm italic">Rustlings is an official Rust project</div>
76+
<div class="italic">Rustlings is an official Rust project</div>
7777
</div>
7878

79-
<nav class="flex flex-col gap-y-3 justify-around py-3 bg-black/30 rounded-sm sm:flex-row sm:rounded-full">
79+
<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">
8080
{% for footer_item in config.extra.footer_items %}
81-
<a class="text-sm no-underline" href="{{ footer_item.url | safe }}">{{ footer_item.name }}</a>
81+
<a class="no-underline" href="{{ footer_item.url | safe }}">{{ footer_item.name }}</a>
8282
{% endfor %}
8383
</nav>
8484
</footer>

website/templates/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{% extends "base.html" %}
22

3-
{% import "macros.html" as macros %}
4-
53
{% block content %}
64
<div class="m-3">
75
<h1>Rustlings</h1>

website/templates/macros.html

Lines changed: 0 additions & 38 deletions
This file was deleted.

website/templates/page.html

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
11
{% extends "base.html" %}
22

3-
{% import "macros.html" as macros %}
4-
53
{% block content %}
64
<article>
75
<h1>{{ page.title }}</h1>
86

9-
{{ page.content | replace(from="<!-- toc -->", to=macros::toc() ) | safe }}
7+
<div class="px-4 py-0.5 my-3 border-s-4 rounded-xl border-double">
8+
<nav>
9+
<ul class="ml-0 list-none">
10+
{% for parent in page.toc %}
11+
{% if parent.level == 2 %}
12+
<li>
13+
{#- -#}
14+
<a href="{{ parent.permalink | safe }}">{{ parent.title }}</a>
15+
{#- -#}
16+
{% if parent.children %}
17+
<ul class="my-0 ml-5 list-none">
18+
{% for child in parent.children %}
19+
{% if child.level == 3 %}
20+
<li>
21+
{#- -#}
22+
<a class="text-base" href="{{ child.permalink | safe }}">{{ child.title }}</a>
23+
{#- -#}
24+
</li>
25+
{% endif %}
26+
{% endfor %}
27+
</ul>
28+
{% endif %}
29+
{#- -#}
30+
</li>
31+
{% endif %}
32+
{% endfor %}
33+
</ul>
34+
</nav>
35+
</div>
36+
37+
{{ page.content | safe }}
1038
</article>
1139
{% endblock %}

0 commit comments

Comments
 (0)