Issue #6 List of pages per user

This commit is contained in:
Alexis Hassler
2019-05-18 11:21:16 +02:00
parent 45bc42f572
commit e285abc65b
21 changed files with 109 additions and 116 deletions

View File

@@ -1,5 +1,3 @@
{%- include /functions/wiki-pages.html -%}
{%- if include.page -%}
{%- assign source_page = include.source_page -%}
{%- else -%}
@@ -7,7 +5,7 @@
{%- endif -%}
{%- assign redirect = source_page.redirect | liquify -%}
{%- for other_page in wiki_pages -%}
{%- for other_page in site.data.wiki_pages -%}
{%- if other_page.id == redirect -%}
{%- assign redirect_page = other_page -%}
{%- endif -%}

View File

@@ -1,7 +0,0 @@
{%- assign wiki_pages = '' | split: '' -%}
{%- for collection in site.collections -%}
{%- assign prefix = collection.label | slice: 0, 4 -%}
{%- if prefix == 'wiki' -%}
{%- assign wiki_pages = wiki_pages | concat: collection.docs -%}
{%- endif -%}
{%- endfor -%}

View File

@@ -1,33 +0,0 @@
{%- 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 -%}

View File

@@ -3,11 +3,10 @@
<h3>{{ site.data.i18n[site.lang].label.tags }}</h3>
<div class="portlet-body">
<ul>
{%- include /functions/wiki-pages.html -%}
{%- for tag in page.tags -%}
<li id="n-tag-{{ tag }}"><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}.html">{{ tag }}</a></li>
<ul>
{%- for other_page in wiki_pages -%}
{%- for other_page in site.data.wiki_pages -%}
{%- if other_page.tags contains tag and other_page.id != page.id -%}
<li><a href="{{ other_page.url }}.html">{{ other_page.title }}</a></li>
{%- endif -%}

View File

@@ -1,9 +1,9 @@
{%- if page.author -%}
{%- if page.author_full -%}
<div id="author" class="portlet">
<div class="portlet-body">
{%- assign author = site.data.users[page.author] -%}
{%- assign author = page.author_full -%}
<ul>
<li><a href="/{{ site.data.i18n[site.lang].prefix.user }}{{ page.author }}">{{ author.name }}</a></li>
<li><a href="{{ author.url }}">{{ author.name }}</a></li>
</ul>
{%- if author.logo -%}
<img src="/{{ author.logo }}" style="max-width: 100%;margin: 3px" />