mirror of
https://github.com/clockworkpi/wiki.clockworkpi.com.git
synced 2025-12-12 16:58:50 +01:00
Fix #2 List of tags
This commit is contained in:
parent
6773809206
commit
8d635a3f71
@ -10,6 +10,12 @@ label:
|
||||
redirect: "Redirect to"
|
||||
tag_pages: "Pages with tag"
|
||||
main_page: "Main page"
|
||||
global_pages: "Special pages"
|
||||
prefix:
|
||||
tag: "Tag:"
|
||||
user: "User:"
|
||||
global_pages:
|
||||
- url: /Main
|
||||
text: Home page
|
||||
- url: /Special:Tags
|
||||
text: All the tags
|
||||
|
||||
@ -10,6 +10,12 @@ label:
|
||||
redirect: "Rediriger vers"
|
||||
tag_pages: "Pages dans la catégorie"
|
||||
main_page: "Page principale"
|
||||
global_pages: "Pages spéciales"
|
||||
prefix:
|
||||
tag: "Tag:"
|
||||
user: "Utilisateur:"
|
||||
global_pages:
|
||||
- url: /Accueil
|
||||
text: Accueil
|
||||
- url: /Special:Tags
|
||||
text: Toutes les catégories
|
||||
|
||||
18
_global/Special:Tags.html
Normal file
18
_global/Special:Tags.html
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: default
|
||||
title: Tags
|
||||
menu: ['global']
|
||||
---
|
||||
{%- include /functions/wiki-tags.html -%}
|
||||
<ul>
|
||||
{%- for tag in tags -%}
|
||||
{%- assign counter = 0 -%}
|
||||
{%- for other_page in wiki_pages %}
|
||||
{%- if other_page.tags contains tag -%}
|
||||
{%- assign counter = counter | plus: 1 -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
|
||||
<li id="n-tag-{{ tag }}"><a href="/{{ site.data.i18n[site.lang].prefix.tag }}{{ tag }}.html">{{ tag }}</a> ({{counter}} pages)</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
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>
|
||||
@ -2,20 +2,18 @@
|
||||
<head>
|
||||
{% include head.html %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main">
|
||||
<h1 id="title">{{ page.title }}</h1>
|
||||
<div id="content">{{ content | inject_anchors }}</div>
|
||||
</div>
|
||||
<div id="menu">
|
||||
{% include logo.html %}
|
||||
{% include user.html %}
|
||||
{% include toc.html %}
|
||||
{% include links.html %}
|
||||
{% include tags.html %}
|
||||
{%- include logo.html -%}
|
||||
{%- assign menu = page.menu | default: layout.menu -%}
|
||||
{%- for item in menu -%}
|
||||
{%- include {{item}}.html -%}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
|
||||
{% include footer.html %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
<html dir="ltr" class="client-js" lang="fr">
|
||||
<html>
|
||||
{%- include /functions/redirect-page.html -%}
|
||||
|
||||
<head>
|
||||
{%- assign redirect_url = redirect_page.url | default: site.data.i18n[site.lang].home | append: ".html" -%}
|
||||
{%- include head.html redirect_url = redirect_url -%}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main">
|
||||
<h1 id="title">{{ redirect_page.title }}</h1>
|
||||
@ -18,7 +16,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="menu">
|
||||
{%- include logo.html -%}
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
---
|
||||
layout: default
|
||||
menu: ['global']
|
||||
---
|
||||
{{ content }}
|
||||
@ -1,34 +1,20 @@
|
||||
<html dir="ltr" class="client-js" lang="fr">
|
||||
<head>
|
||||
{% include head.html %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main">
|
||||
<h1 id="title">{{ page.tags }}</h1>
|
||||
<div id="content">
|
||||
{{ content | inject_anchors }}
|
||||
</div>
|
||||
<div id="pages">
|
||||
<h3>{{ site.data.i18n[site.lang].label.tag_pages }} {{ page.tags }}</h3>
|
||||
<div class="columns">
|
||||
<ul>
|
||||
{% include /functions/wiki-pages.html %}
|
||||
{% for tag in page.tags %}
|
||||
{% for other_page in wiki_pages %}
|
||||
{% if other_page.tags contains tag and other_page.slug != page.slug %}
|
||||
<li><a href="{{ other_page.url }}">{{ other_page.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu">
|
||||
{% include logo.html %}
|
||||
</div>
|
||||
|
||||
{% include footer.html %}
|
||||
</body>
|
||||
</html>
|
||||
---
|
||||
layout: default
|
||||
menu: ['global']
|
||||
---
|
||||
{{ content | inject_anchors }}
|
||||
<div id="pages">
|
||||
<h3>{{ site.data.i18n[site.lang].label.tag_pages }} {{ page.tags }}</h3>
|
||||
<div class="columns">
|
||||
<ul>
|
||||
{% include /functions/wiki-pages.html %}
|
||||
{% for tag in page.tags %}
|
||||
{% for other_page in wiki_pages %}
|
||||
{% if other_page.tags contains tag and other_page.slug != page.slug %}
|
||||
<li><a href="{{ other_page.url }}">{{ other_page.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
---
|
||||
layout: default
|
||||
menu: ['user', 'toc', 'links', 'tags']
|
||||
---
|
||||
{{ content }}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
layout: user
|
||||
layout: simple
|
||||
title: Alexis
|
||||
toc: false
|
||||
created: 2019-04-12
|
||||
modified: 2019-04-12
|
||||
revisions:
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
layout: wiki
|
||||
layout: simple
|
||||
title: Main Page
|
||||
toc: false
|
||||
created: 2009-04-12
|
||||
modified: 2009-04-12
|
||||
revisions:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user