{% set LAYOUT = "full-width" %} {% extends "base.html" %} {# Rendered for a page carrying `Template: projects`, so it declares its language the same way page.html does. Unlike page.html it is also reachable with no page bound at all, through TEMPLATE_PAGES, and reading an attribute off an undefined name raises rather than rendering empty. #} {% block html_lang %}{{ page.lang if page is defined else DEFAULT_LANG }}{% endblock html_lang %} {# Map URL substring matches to link's icon, then label. Sorted by priority: the first items takes precedence over those at the end. #} {% set ICONS = [ ('github.com', 'github', 'Git repository'), ('youtube.com', 'play-fill', 'Play video'), ('ohloh.net', 'graph-up', 'Contribution statistics'), ('stackoverflow.com', 'stack-overflow', 'Community support'), ('stackexchange.com', 'stack-overflow', 'Community support'), ('twitter.com', 'twitter', 'Social media activities'), ('bugs.launchpad.net', 'bug-fill', 'Reported bugs'), ('trac.wordpress.org', 'bug-fill', 'Reported bugs'), ('sourceforge.net/apps/trac', 'bug-fill', 'Reported bugs'), ('bugs.debian.org', 'bug-fill', 'Reported bugs'), ('bugs.kde.org', 'bug-fill', 'Reported bugs'), ('mantis', 'bug-fill', 'Reported bugs'), ('ticket=on', 'bug-fill', 'Reported bugs'), ('gmane.org', 'envelope-fill', 'Mailing-list participation'), ('type_of_search=mlists', 'envelope-fill', 'Mailing-list participation'), (SITEURL, 'megaphone-fill', 'Announcement on this blog'), ] %} {% macro render_card(all_tags, project) %}
{% if project.inactive %}
Inactive
{% endif %} {# The below opens and closes in two separate {% if %} blocks, which djlint's indenter cannot pair up. Left to itself it dedents the whole rest of the macro, so that card-body ends up looking like a sibling of card rather than its child. #} {# djlint:off #} {% if project.thumb %} {% if project.thumb_link %}{% endif %} {{ project.name }} thumbnail {% if project.thumb_link %}{% endif %} {% endif %} {# djlint:on #}

{{ project.name }}

{% if project.roles or project.tools %} {# Not a

: a

{% endmacro %} {% macro render_projects(projects) %} {% set all_tags = [] %} {% for tag, articles in tags %} {% if all_tags.append({'name': tag.name, 'url': tag.url, 'articles': articles|length()}) %}{% endif %} {% endfor %} {% if projects is defined %}
{% block project_pre_content %} {% endblock project_pre_content %} {% set active_projects = [] %} {% set inactive_projects = [] %} {% for project in projects %} {% if project.inactive %} {% if inactive_projects.append(project) %}{% endif %} {% else %} {% if active_projects.append(project) %}{% endif %} {% endif %} {% endfor %} {% for project_list in [active_projects, inactive_projects] %} {% for project in project_list %}
{{ render_card(all_tags, project) }}
{% endfor %} {% endfor %} {% block project_post_content %} {% endblock project_post_content %}
{% endif %} {% endmacro %} {% macro render_project_group(group, projects) %} {{ group.pre }} {{ render_projects(projects) }} {{ group.post }} {% endmacro %} {% block extra_js %} {% endblock extra_js %} {% block content %} {% if PROJECT_GROUPS is defined %} {% for group in PROJECT_GROUPS %} {{ render_project_group(group, PROJECTS|selectattr("group", "sameas", group.id)) }} {% endfor %} {{ render_projects(PROJECTS|rejectattr("group", "defined")) }} {% else %} {{ render_projects(PROJECTS) }} {% endif %} {% endblock content %}