mirror of
https://github.com/clockworkpi/wiki.clockworkpi.com.git
synced 2026-03-19 02:12:40 +01:00
Fix #2 List of tags
This commit is contained in:
33
_includes/functions/wiki-tags.html
Normal file
33
_includes/functions/wiki-tags.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{%- comment -%}
|
||||
=======================
|
||||
The following part extracts all the tags from your posts and sort tags, so that you do not need to manually collect your tags to a place.
|
||||
=======================
|
||||
{%- endcomment -%}
|
||||
{%- assign rawtags = "" -%}
|
||||
{%- include /functions/wiki-pages.html -%}
|
||||
|
||||
{%- for wiki_page in wiki_pages -%}
|
||||
{%- assign ttags = wiki_page.tags | join:'|' | append:'|' -%}
|
||||
{%- assign rawtags = rawtags | append:ttags -%}
|
||||
{%- endfor -%}
|
||||
{%- assign rawtags = rawtags | split:'|' | sort -%}
|
||||
|
||||
{%- comment -%}
|
||||
=======================
|
||||
The following part removes dulpicated tags and invalid tags like blank tag.
|
||||
=======================
|
||||
{%- endcomment -%}
|
||||
|
||||
{%- assign tags = "" -%}
|
||||
{%- for tag in rawtags -%}
|
||||
{%- if tag != "" -%}
|
||||
{%- if tags == "" -%}
|
||||
{%- assign tags = tag | split:'|' -%}
|
||||
{%- endif -%}
|
||||
{%- unless tags contains tag -%}
|
||||
{%- assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' -%}
|
||||
{%- endunless -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
|
||||
{%- assign wiki_tags = tags -%}
|
||||
8
_includes/global.html
Normal file
8
_includes/global.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div id="global" class="portlet">
|
||||
<h3>{{ site.data.i18n[site.lang].label.global_pages }}</h3>
|
||||
<ul class="portlet-body">
|
||||
{%- for link in site.data.i18n[site.lang].global_pages -%}
|
||||
<li><a href="{{link.url}}.html">{{link.text}}</a></li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user