First version

This commit is contained in:
Alexis Hassler
2019-04-12 23:08:34 +02:00
commit 61baeb1807
41 changed files with 1383 additions and 0 deletions

12
_includes/footer.html Normal file
View File

@@ -0,0 +1,12 @@
<div class="visualClear"></div>
<div class="site-footer" id="footer">
<div id="f-poweredbyico">
<a href="https://creativecommons.org/licenses/by-nc-sa/2.5/">
<img src="https://creativecommons.org/images/public/somerights20.png" alt="Paternit<69>-NonCommercial-ShareAlike 2.5" width="88" height="31">
</a>
</div>
<ul id="f-list">
<li>{% if page.modified %}{{ site.data.i18n[site.lang].label.modified }}: {{ page.modified }}{% endif %}<br/></li>
<li>{% if page.created %}{{ site.data.i18n[site.lang].label.created }}: {{ page.created }}{% endif %}</li>
</ul>
</div>

View File

@@ -0,0 +1,61 @@
{% comment %}
See https://github.com/oncleben31/jekyll-date-basic-i18n/
{% endcomment %}
{% comment %}
This include allows to translate the days and months in the date by using strings in _data/locales/[lang].yml
This include can be called with three parameters:
- include.date: the date to be processed
- include.format: the date format. (If empty a default format will be used)
- include.lang: lang to use for translation.
{% endcomment %}
{% comment %}
If the parameter date format is empty the default format set in _config.yml is used.
If there is no default in _config, "%b %-d, %Y" is used.
{% endcomment %}
{% assign date_format_to_be_translated = include.format | default: site.date_format | default: "%-d %b %Y" %}
{% comment %}
Init to have the indice of the day in the week (num_day) and the indice of the month in the year (num_mont)
Init the lang parameter depending if it's set in the include call, in the page or in the site settings
{% endcomment %}
{% assign num_day = include.date | date: "%w" | plus: 0 %}
{% assign num_month = include.date | date: "%-m" | plus: -1 %}
{% assign lang = include.lang | default: page.lang | default: site.lang %}
{% comment %}
Use translated abbreviated weekday if "%a" is used in the format and the translation is available in _data/locales/[lang].yml
{% endcomment %}
{% if site.data.locales[lang].abbreviated_weekday[num_day] %}
{% assign date_format_to_be_translated = date_format_to_be_translated | replace: "%a", site.data.locales[lang].abbreviated_weekday[num_day] %}
{% endif %}
{% comment %}
Use translated full weekday if "%A" is used in the format and the translation is available in _data/locales/[lang].yml
{% endcomment %}
{% if site.data.locales[lang].full_weekday[num_day] %}
{% assign date_format_to_be_translated = date_format_to_be_translated | replace: "%A", site.data.locales[lang].full_weekday[num_day] %}
{% endif %}
{% comment %}
Use translated abbreviated month if "%b" is used in the format and the translation is available in _data/locales/[lang].yml
{% endcomment %}
{% if site.data.locales[lang].abbreviated_month[num_month] %}
{% assign date_format_to_be_translated = date_format_to_be_translated | replace: "%b", site.data.locales[lang].abbreviated_month[num_month] %}
{% endif %}
{% comment %}
Use translated abbreviated weekday if "%B" is used in the format and the translation is available in _data/locales/[lang].yml
{% endcomment %}
{% if site.data.locales[lang].full_month[num_month] %}
{% assign date_format_to_be_translated = date_format_to_be_translated | replace: "%B", site.data.locales[lang].full_month[num_month] %}
{% endif %}
{{ include.date | date: date_format_to_be_translated }}

View File

@@ -0,0 +1,7 @@
{% include /functions/wiki-pages.html %}
{% assign redirect = page.redirect | default: site.data.i18n[site.lang].home %}
{% for other_page in wiki_pages %}
{% if other_page.slug == redirect %}
{% assign redirect_page = other_page %}
{% endif %}
{% endfor %}

View File

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

10
_includes/head.html Normal file
View File

@@ -0,0 +1,10 @@
<meta charset="UTF-8" />
<title>{{ page.title }}</title>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/css/main.css" />
{% if include.redirect_url %}
<link rel="canonical" href="{{ include.redirect_url }}">
<meta http-equiv="refresh" content="0; url={{ include.redirect_url }}" />
{% endif %}
<link rel="alternate" type="application/atom+xml" title="{{ site.title }} feed" href="/feed.xml" />

12
_includes/links.html Normal file
View File

@@ -0,0 +1,12 @@
{% if page.links != nil %}
<div class="generated-sidebar portlet" id="p-links">
<h3>{{ site.data.i18n[site.lang].label.links }}</h3>
<div class="portlet-body">
<ul>
{% for link in page.links %}
<li><a href="{{link.url}}">{{link.text}}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}

3
_includes/logo.html Normal file
View File

@@ -0,0 +1,3 @@
<div class="portlet" id="p-logo" role="banner">
<a href="/{{ site.data.i18n[site.lang].home }}.html" style="background-image: url({{ site.data.i18n[site.lang].logo }});" title="{{ site.data.i18n[site.lang].label.main_page }}"></a>
</div>

21
_includes/tags.html Normal file
View File

@@ -0,0 +1,21 @@
{% if page.tags.size > 0 %}
<div class="generated-sidebar portlet" id="p-navigation" role="navigation">
<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 %}
{% if other_page.tags contains tag and other_page.slug != page.slug %}
<li><a href="{{ other_page.url }}.html">{{ other_page.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</ul>
</div>
</div>
{% endif %}

8
_includes/toc.html Normal file
View File

@@ -0,0 +1,8 @@
{% if page.toc == true %}
<div class="generated-sidebar portlet" id="p-toc" role="toc">
<h3>{{ site.data.i18n[site.lang].label.toc }}</h3>
<div class="portlet-body">
{{ content | toc_only }}
</div>
</div>
{% endif %}

14
_includes/user.html Normal file
View File

@@ -0,0 +1,14 @@
{% if page.author %}
<div class="generated-sidebar portlet" id="p-author" role="author">
<h3>{{ site.data.i18n[site.lang].label.author }}</h3>
<div class="portlet-body">
{% assign author = site.data.users[page.author] %}
<ul>
<li><a href="/{{ site.data.i18n[site.lang].prefix.user }}{{ page.author }}.html">{{ author.name }}</a></li>
</ul>
{% if author.logo %}
<img src="/{{ author.logo }}" style="max-width: 100%;margin: 3px" />
{% endif %}
</div>
</div>
{% endif %}