Add categories

This commit is contained in:
2026-02-06 21:43:34 +00:00
parent 46605e5f75
commit e6ee67a46f
2 changed files with 30 additions and 20 deletions

View File

@@ -2,25 +2,30 @@
<main id="links-main">
<h2>Useful Links</h2>
<section id="links">
{% for link in links %}
<div class="link">
{% if link.get('img') is not none %}
<a href="{{link.src}}" target="_blank"></a>
<img class="link-thumb"
srcset="
{% for i in range(200, 5100, 100) %}
/image/{{ link.img }}?w={{i}} {{i}}w{{"," if not loop.last}}
{% endfor %}
"
sizes="
(max-width: 999px) 80vw,
(min-width: 1000px) 20vw
"
src="/image/{{ link.img }}">
</a>
{% endif %}
<a href="{{link.src}}" target="_blank"><h3>{{ link.title }}</h3></a>
<p>{{ link.description }}</p>
{% for category in links %}
<div class="category">
<h3>{{category}}</h3>
{% for link in links.get(category) %}
<div class="link">
{% if link.get('img') is not none %}
<a href="{{link.src}}" target="_blank"></a>
<img class="link-thumb"
srcset="
{% for i in range(200, 5100, 100) %}
/image/{{ link.img }}?w={{i}} {{i}}w{{"," if not loop.last}}
{% endfor %}
"
sizes="
(max-width: 999px) 80vw,
(min-width: 1000px) 20vw
"
src="/image/{{ link.img }}">
</a>
{% endif %}
<a href="{{link.src}}" target="_blank"><h3>{{ link.title }}</h3></a>
<p>{{ link.description }}</p>
</div>
{% endfor %}
</div>
{% endfor %}
</section>

View File

@@ -290,15 +290,20 @@ pre{
.link {
border-top: 1px solid #e5e5e5;
clear: both;
}
.link>img {
float: left;
padding-right: 20px;
max-width: 100px;
width: 100px;
}
.link>a>h3 {
padding-top: 10px;
margin: 0
}
.category {
padding-top: 10px;
}