Enable dynamic ordering of sections

This commit is contained in:
Yan Lin 2025-07-09 14:10:52 +02:00
parent ddadc8685e
commit 51d12d7ab1
9 changed files with 100 additions and 62 deletions

View file

@ -29,6 +29,8 @@ block content %}
</div>
</div>
{% for section in data.sections %}
{% if section == 'publications' %}
<article class="section" id="publications">
<div class="d-flex align-items-center mb-1">
<h3 class="section-title d-inline-block mb-0">
@ -58,7 +60,7 @@ block content %}
>
</div>
</article>
{% elif section == 'projects' %}
<article class="section" id="projects">
<div class="d-flex align-items-center mb-1">
<h3 class="section-title d-inline-block mb-0">
@ -82,7 +84,7 @@ block content %}
</div>
</div>
</article>
{% elif section == 'teaching' %}
<article class="section" id="teaching">
<div class="d-flex align-items-center mb-1">
<h3 class="section-title d-inline-block mb-0">
@ -98,7 +100,7 @@ block content %}
'partials/teaching.html' %} {% endfor %}
</div>
</article>
{% elif section == 'presentations' %}
<article class="section" id="presentations">
<div class="d-flex align-items-center mb-1">
<h3 class="section-title d-inline-block mb-0">
@ -114,7 +116,7 @@ block content %}
'partials/presentation.html' %} {% endfor %}
</div>
</article>
{% elif section == 'services' %}
<article
id="services"
class="rounded text-body-emphasis bg-body-secondary flex-md-row my-4 position-relative p-4 transition-shadow"
@ -131,5 +133,7 @@ block content %}
</ul>
</div>
</article>
{% endif %}
{% endfor %}
{% endblock %} {% block extra_js %} {{ super() }} {% endblock %}

View file

@ -1,35 +1,43 @@
<nav class="navbar navbar-expand">
<ul class="navbar-nav d-flex justify-content-evenly mx-auto gap-3 gap-sm-5">
{% for section in data.sections %}
{% if section == 'publications' %}
<li class="nav-item">
<a class="link nav-link px-0" href="/#publications">
<span class="d-inline d-md-none">Pubs</span>
<span class="d-none d-md-inline">Publications</span>
</a>
</li>
{% elif section == 'projects' %}
<li class="nav-item">
<a class="link nav-link px-0" href="/#projects">
<span class="d-inline d-md-none">Work</span>
<span class="d-none d-md-inline">Projects</span>
</a>
</li>
{% elif section == 'teaching' %}
<li class="nav-item">
<a class="link nav-link px-0" href="/#teaching">
<span class="d-inline d-md-none">Teach</span>
<span class="d-none d-md-inline">Teaching</span>
</a>
</li>
{% elif section == 'presentations' %}
<li class="nav-item">
<a class="link nav-link px-0" href="/#presentations">
<span class="d-inline d-md-none">Talks</span>
<span class="d-none d-md-inline">Presentations</span>
</a>
</li>
{% elif section == 'services' %}
<li class="nav-item">
<a class="link nav-link px-0" href="/#services">
<span class="d-inline d-md-none">Service</span>
<span class="d-none d-md-inline">Services</span>
</a>
</li>
{% endif %}
{% endfor %}
<li class="nav-item">
<a class="link nav-link px-0" href="https://blog.yanlincs.com">
<span class="d-inline d-md-none">Blog</span>

View file

@ -1,6 +1,6 @@
<div class="list-group-item px-0">
<div class="d-flex justify-content-between align-items-center mb-1">
<p class="d-inline-block mb-0 venue-name primary-text">
<p class="d-inline-block mb-0 venue-name secondary-text">
{{ presentation.tags|join("<span class='text-muted'> | </span>")|safe }}
</p>
<div class="d-flex gap-2">