{% set LAYOUT = 'full-width' %} {% extends "base.html" %} {# 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', 'fab fa-github-alt', 'Git repository'), ('bitbucket.org', 'fab fa-bitbucket', 'Mercurial repository'), ('youtube.com', 'fas fa-play', 'Play video'), ('ohloh.net', 'fas fa-bar-chart-o', 'Contribution statistics'), ('stackoverflow.com', 'fab fa-stack-overflow', 'Community support'), ('stackexchange.com', 'fab fa-stack-exchange', 'Community support'), ('twitter.com', 'fab fa-twitter', 'Social media activities'), ('bugs.launchpad.net', 'fas fa-bug', 'Reported bugs'), ('trac.wordpress.org', 'fas fa-bug', 'Reported bugs'), ('sourceforge.net/apps/trac', 'fas fa-bug', 'Reported bugs'), ('bugs.debian.org', 'fas fa-bug', 'Reported bugs'), ('bugs.kde.org', 'fas fa-bug', 'Reported bugs'), ('mantis', 'fas fa-bug', 'Reported bugs'), ('ticket=on', 'fas fa-bug', 'Reported bugs'), ('gmane.org', 'fas fa-envelope-o', 'Mailing-list participation'), ('type_of_search=mlists', 'fas fa-envelope-o', 'Mailing-list participation'), (SITEURL, 'fas fa-bullhorn', 'Announcement on this blog'), ] %} {% macro render_card(all_tags, project) %}
{% if project.inactive %}
Inactive
{% endif %} {% if project.thumb %} {% if project.thumb_link %}{% endif %} {{ project.name }} thumbnail {% if project.thumb_link %}{% endif %} {% endif %}

{{ project.name }}

{% if project.roles or project.tools %}

{% endif %} {% if project.desc %}

{{ project.desc }}

{% endif %} {% if project.links %}

{% for link in project.links %} {# Default icon in case of no match #} {% set matches = [('', 'fas fa-home', 'Project home')] %} {% for rule in ICONS|reverse %} {% if rule[0] and link.find(rule[0]) != -1 %} {% if matches.append(rule) %} {% endif %} {% endif %} {% endfor %} {% endfor %}

{% endif %}
{% 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 %} {% 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 %}
{% 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 %}