mirror of https://github.com/docker/docs.git
Optimize keywords-list logic in docs layout
This commit is contained in:
parent
74d6897d83
commit
1d9c7fd691
|
@ -177,11 +177,16 @@
|
||||||
{{ content }}
|
{{ content }}
|
||||||
<!-- tags -->
|
<!-- tags -->
|
||||||
{% unless page.notags == true %}
|
{% unless page.notags == true %}
|
||||||
{% assign keywords = page.keywords | split:"," %}
|
{% assign keywords = page.keywords | split:"," -%}
|
||||||
{% for keyword in keywords %}{% assign strippedKeyword = keyword | strip %}
|
{% if keywords.size > 0 -%}
|
||||||
{% capture keywordlist %}{{ keywordlist }}<a href="https://docs.docker.com/search/?q={{strippedKeyword}}">{{strippedKeyword}}</a>{% unless forloop.last %}, {% endunless %}{% endcapture %}
|
<span class="glyphicon glyphicon-tags" style="padding-right: 10px"></span><span style="vertical-align: 2px">
|
||||||
{% endfor %}
|
{%- for keyword in keywords -%}
|
||||||
{% if keywordlist.size > 0 %}<span class="glyphicon glyphicon-tags" style="padding-right: 10px"></span><span style="vertical-align: 2px">{{ keywordlist }}</span>{% endif %}
|
{%- assign strippedKeyword = keyword | strip -%}
|
||||||
|
<a href="https://docs.docker.com/search/?q={{ strippedKeyword }}">{{ strippedKeyword }}</a>
|
||||||
|
{%- unless forloop.last %}, {% endunless -%}
|
||||||
|
{% endfor -%}
|
||||||
|
</span>
|
||||||
|
{% endif -%}
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
<!-- link corrections -->
|
<!-- link corrections -->
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
|
|
Loading…
Reference in New Issue