forked from opengaming/osgameclones
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tags.html
36 lines (33 loc) · 1.48 KB
/
tags.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{% macro render_tag(tag_class, tag_names, tag_props) %}
{%- if tag_names -%}
{%- if tag_names is string -%}
{% set tag_names = [tag_names] %}
{%- endif -%}
{%- for tag_name in tag_names %}
{%- set className = ["tag", tag_class.lower(), tag_name.lower().replace(' ', '-')] -%}
{%- set dataName = tag_name.lower().replace(' ', '-') -%}
<span title="{{ tag_class | title }}" class="{{ className | join(' ') }}" data-name="{{ dataName }}">
{{- tag_name -}}
{%- if tag_props -%}<span class="tag-badge">{{ tag_props }}</span>{%- endif -%}
</span>
{% endfor -%}
{%- endif -%}
{% endmacro %}
{% macro render_tag_groups(tag_class, tag_names, tag_props) %}
{%- if tag_names -%}
{%- if tag_names is string -%}
{% set tag_names = [tag_names] %}
{%- endif -%}
<span class="tag-groups" {% if tag_class != "langs" %}itemprop="description"{% endif %}> {{ tag_class }}:
{%- for tag_name in tag_names %}
{%- set className = ["tag", tag_class.lower(), tag_name.lower().replace(' ', '-')] -%}
{%- set dataName = tag_name.lower().replace(' ', '-') -%}
<span title="{{ tag_class | title }}" class="{{ className | join(' ') }}" data-name="{{ dataName }}"
{% if tag_class == "langs" %}itemprop="programmingLanguage"{% endif %}>
{{- tag_name -}}
{%- if tag_props -%}<span class="tag-badge">{{ tag_props }}</span>{%- endif -%}
</span>
{% endfor -%}
</span>
{%- endif -%}
{% endmacro %}