mirror of https://github.com/lukechilds/docs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
872 B
32 lines
872 B
<div class="uk-margin-large-top">
|
|
<h3>Related Articles</h3>
|
|
|
|
{% assign maxRelated = 4 %}
|
|
{% assign minCommonTags = 1 %}
|
|
{% assign maxRelatedCounter = 0 %}
|
|
|
|
<ul class="uk-list">
|
|
{% for doc in site.bns %}
|
|
|
|
{% assign sameTagCount = 0 %}
|
|
{% assign commonTags = '' %}
|
|
|
|
{% for tag in doc.tags %}
|
|
{% if doc.url != page.url %}
|
|
{% if page.tags contains tag %}
|
|
{% assign sameTagCount = sameTagCount | plus: 1 %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if sameTagCount >= minCommonTags %}
|
|
<li><a href="{{ site.baseurl }}{{ doc.url }}">{{ doc.title }}</a></li>
|
|
{% assign maxRelatedCounter = maxRelatedCounter | plus: 1 %}
|
|
{% if maxRelatedCounter >= maxRelated %}
|
|
{% break %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|