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