pmd/docs/_includes/custom/shuffle_panel.html
Andreas Dangel a62b5a388e [doc] Use new self hosted fontawesome
Note: the css class "fa" is deprecated and "fas" should be used
instead. "fab" is for branding icons (like github).
2020-09-18 10:45:00 +02:00

57 lines
2.5 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Argument summary: -->
<!-- tags: comma-separated tags determining the pages included in the panel -->
<!-- except_tags: comma-separated tags to filter out some pages -->
<!-- A page is included if it has all the include tags and none of the exclude tags -->
<!-- title: Display title of the panel -->
<!-- description: Description of the panel -->
<!-- datagroups: json array containing the data groups for the shuffle logic -->
<!-- fa-style (optional) : Name of the fontawesome style, e.g. "fas" (for solid), or "fab" (for brands). Default is "fas" -->
<!-- fa-icon (optional) : Name of the fontwaresome icon to use, as a css class, eg. "fa-list" -->
<!-- titlemaker (optional) : name of a variable that's evaluated to determine the displayed title of the page. Default is page.title -->
{% assign titlemaker = include.titlemaker | default: "page.title" %}
{% assign include_tags = include.tags | split: "," %}
{% assign exclude_tags = include.except_tags | split: "," %}
{% assign sorted_pages = site.pages | sort_using: site.data.sidebars.pmd_sidebar %}
{% assign panel_id = include.title | downcase | strip | replace: ' ', '-' | prepend: "shuffle-panel-" %}
<div class="col-xs-6 col-sm-4 col-md-4" data-groups='{{ include.datagroups }}' id="{{ panel_id }}">
<div class="panel panel-default">
{% if include.fa-icon != "" and include.fa-icon != nil %}
<div class="panel-heading text-center">
<span class="fa-stack fa-5x">
<i class="fas fa-circle fa-stack-2x text-secondary"></i>
<i class="{{ include.fa-style | default: "fas" }} {{ include.fa-icon }} fa-stack-1x fa-inverse"></i>
</span>
</div>
{% endif %}
<div class="panel-heading text-center">{{ include.title }}</div>
<div class="panel-body">
<p class="landing-page cat-description">
{{ include.description }}
</p>
<ul>
{% for page in sorted_pages %}
{% capture included %}{{ page.tags | intersect: include_tags | equals: include_tags }}{% endcapture %}
{% capture excluded %}{{ page.tags | intersect: exclude_tags | empty }}{% endcapture %}
{% if included contains "true" and excluded contains "true" %}
<li><a href="{{page.url | remove: '/'}}">{% eval titlemaker %}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</div>