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

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
_site
.sass-cache
Gemfile.lock

10
.htaccess Normal file
View File

@ -0,0 +1,10 @@
RewriteEngine On
RewriteCond %{QUERY_STRING} ^title=Special:Newpages\&feed=rss$
RewriteRule ^index\.php$ /feed.xml? [R=301,L]
RewriteCond %{QUERY_STRING} ^title=Sp%C3%A9cial:Nouvelles_pages&feed=rss$
RewriteRule ^index\.php$ /feed.xml? [R=301,L]
RewriteCond %{QUERY_STRING} [^&?]*?=([^&?]*)[&]?(.*)
RewriteRule ^index\.php$ /%1.html?%2 [R=301,L]

24
404.html Normal file
View File

@ -0,0 +1,24 @@
---
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>

12
Gemfile Normal file
View File

@ -0,0 +1,12 @@
source "https://rubygems.org"
# Run Jekyll with `bundle exec`, like so:
# bundle exec jekyll serve
gem "jekyll", "3.8.5"
gem "nokogiri"
group :jekyll_plugins do
gem 'jekyll-asciidoc', "~> 2.1.1"
gem "jekyll-toc", "~> 0.11.0"
end

21
LICENSE.txt Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Parker Moore
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
Bootstrap project to start a wiki powered by [Jekyll](https://jekyllrb.com/)
See https://jek4wik.github.io for more information

29
_config.yml Normal file
View File

@ -0,0 +1,29 @@
title: Jekyll for Wiki
description: > # this means to ignore newlines
Bootstrap project based on Jekyll to build a static Wiki
baseurl: "" # the subpath of your site, e.g. /blog
url: "htpps://jek4wik.github.io"
# Build settings
markdown: kramdown
plugins:
- jekyll-asciidoc
- jekyll-toc
encoding: UTF-8
lang: en # fr is also supported ; feel free to contribute other languages
date_format: "%-d %b %Y"
collections:
wiki:
output: true
permalink: "/:path"
path: "" # avoid wiki in the url
wiki-legacy:
output: true
permalink: "/:path"
path: ""
special:
output: true
permalink: "/:path"
path: ""

15
_data/i18n/en.yml Normal file
View File

@ -0,0 +1,15 @@
home: Main
logo: /img/wiki.png
label:
author: Author
links: Links
tags: Other pages
toc: Table of content
modified: Modified
created: Created
redirect: "Redirect to"
tag_pages: "Pages with tag"
main_page: "Main page"
prefix:
tag: "Tag:"
user: "User:"

15
_data/i18n/fr.yml Normal file
View File

@ -0,0 +1,15 @@
home: Accueil
logo: /img/wiki.png
label:
author: Auteur
links: Formation(s)
tags: Autres articles
toc: Sommaire
modified: Modification
created: Création
redirect: "Rediriger vers"
tag_pages: "Pages dans la catégorie"
main_page: "Page principale"
prefix:
tag: "Tag:"
user: "Utilisateur:"

3
_data/users.yml Normal file
View File

@ -0,0 +1,3 @@
Alexis:
name: Alexis Hassler
logo: img/sewatech.png

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 %}

34
_layouts/default.html Normal file
View File

@ -0,0 +1,34 @@
<html>
<head>
{% include head.html %}
</head>
<body class="mediawiki skin-monobook action-view">
<div id="globalWrapper">
<div id="column-content">
<div id="content" class="wiki-body" role="main">
<h1 id="firstHeading" class="firstHeading">
<span dir="auto">{{ page.title }}</span>
</h1>
<div id="bodyContent" class="wiki-body-content">
<div id="mw-content-text" dir="ltr">
{{ content | inject_anchors }}
</div>
</div>
</div>
</div>
<div id="column-one">
{% include logo.html %}
{% include user.html %}
{% include toc.html %}
{% include links.html %}
{% include tags.html %}
</div>
</div>
{% include footer.html %}
</body>
</html>

35
_layouts/redirect.html Normal file
View File

@ -0,0 +1,35 @@
<html>
{% include /functions/redirect-page.html %}
<head>
{% assign redirect_url = redirect_page.url | append: ".html" %}
{% include head.html redirect_url = redirect_url %}
</head>
<body>
<div id="globalWrapper">
<div id="column-content">
<div id="content" class="wiki-body" role="main">
<h1 id="firstHeading" class="firstHeading" lang="fr">
<span dir="auto">{{ redirect_page.title }}</span>
</h1>
<div id="bodyContent" class="wiki-body-content">
<div id="mw-content-text" dir="ltr" class="mw-content-ltr" lang="fr">
<div class="redirectMsg">
<p>{{ site.data.i18n[site.lang].label.redirect }} :</p>
<ul class="redirectText">
<li><a href="{{ redirect_page.url }}.html" title="{{ redirect_page.name }}">{{ redirect_page.title }}</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="column-one">
{% include logo.html %}
</div>
</div>
{% include footer.html %}
</body>
</html>

56
_layouts/tag.html Normal file
View File

@ -0,0 +1,56 @@
<html dir="ltr" class="client-js" lang="fr">
<head>
<meta charset="UTF-8">
<title>{{ page.title }}</title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/css/main.css">
<style>
.columns {
-webkit-columns: 3;
-moz-columns: 3;
columns: 3;
width: 100%;
}
</style>
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-monobook action-view">
<div id="globalWrapper">
<div id="column-content">
<div id="content" class="wiki-body" role="main">
<h1 id="firstHeading" class="firstHeading" lang="fr">
<span dir="auto">{{ page.tags }}</span>
</h1>
<div id="bodyContent" class="wiki-body-content">
<div id="mw-content-text" dir="ltr" class="mw-content-ltr" lang="fr">
{{ content }}
</div>
</div>
<div>
<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>
<div id="column-one">
{% include logo.html %}
</div>
</div>
{% include footer.html %}
</body>
</html>

4
_layouts/user.html Normal file
View File

@ -0,0 +1,4 @@
---
layout: default
---
{{ content }}

4
_layouts/wiki.html Normal file
View File

@ -0,0 +1,4 @@
---
layout: default
---
{{ content }}

539
_sass/wiki.scss Normal file
View File

@ -0,0 +1,539 @@
body {
font: x-small sans-serif;
background: #acabab;
color: black;
margin: 0;
padding: 0;
direction: ltr;
unicode-bidi: embed;
}
a {
text-decoration: none;
color: #0645ad;
background: none;
&:visited {
color: #0b0080;
}
&:active {
color: #faa700;
}
&:hover, &:focus {
text-decoration: underline;
}
&.stub {
color: #772233;
}
&.new {
color: #ba0000;
}
}
#p-personal a.new {
color: #ba0000;
}
a.new:visited {
color: #a55858;
}
.wiki-body a.external {
color: #36b;
&:visited {
color: #636;
}
&:active {
color: #b63;
}
}
img {
border: none;
vertical-align: middle;
}
hr {
height: 1px;
color: #aaa;
background-color: #aaa;
border: 0;
margin: 0.2em 0;
}
h1, h2, h3, h4, h5, h6 {
color: black;
background: none;
font-weight: normal;
margin: 0;
overflow: hidden;
padding-top: .5em;
padding-bottom: .17em;
border-bottom: 1px solid #aaa;
}
h1 {
font-size: 188%;
}
h2 {
font-size: 150%;
}
h3, h4, h5, h6 {
border-bottom: none;
font-weight: bold;
}
h3 {
font-size: 132%;
}
h4 {
font-size: 116%;
}
h5 {
font-size: 108%;
}
h6 {
font-size: 100%;
}
h1, h2 {
margin-bottom: 0.6em;
}
h3, h4, h5 {
margin-bottom: 0.3em;
}
p {
margin: .4em 0 .5em 0;
line-height: 1.5em;
img {
margin: 0;
}
}
ul {
line-height: 1.5em;
list-style-type: square;
margin: .3em 0 0 1.6em;
padding: 0;
}
ol {
line-height: 1.5em;
margin: .3em 0 0 3.2em;
padding: 0;
list-style-image: none;
}
li {
margin-bottom: 0.1em;
}
dt {
font-weight: bold;
margin-bottom: 0.1em;
}
dl {
margin-top: .2em;
margin-bottom: 0.5em;
}
dd {
line-height: 1.5em;
margin-left: 1.6em;
margin-bottom: 0.1em;
}
q {
font-style: italic;
}
pre, code, tt, kbd, samp {
font-family: monospace, Courier;
}
code {
color: black;
padding: 1px 4px;
span {
border: 0;
}
}
pre {
color: black;
background-color: #f9f9f9;
border: 1px solid #ddd;
padding: 1em;
}
table {
font-size: 100%;
}
fieldset {
border: 1px solid #2f6fab;
margin: 1em 0 1em 0;
padding: 0 1em 1em;
line-height: 1.5em;
&.nested {
margin: 0 0 0.5em 0;
padding: 0 0.5em 0.5em;
}
}
legend {
padding: .5em;
font-size: 95%;
}
form {
border: none;
margin: 0;
}
textarea {
width: 100%;
padding: .1em;
display: block;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
select {
vertical-align: top;
}
.center {
width: 100%;
text-align: center;
}
*.center * {
margin-left: auto;
margin-right: auto;
}
.small {
font-size: 94%;
}
table.small {
font-size: 100%;
}
.visualClear {
clear: both;
}
div.floatright, table.floatright {
margin: 0 0 .5em .5em;
border: 0;
}
div {
&.floatright p {
font-style: italic;
}
&.floatleft {
margin: 0 .5em .5em 0;
border: 0;
}
}
table.floatleft {
margin: 0 .5em .5em 0;
border: 0;
}
div {
&.floatleft p {
font-style: italic;
}
&.thumb {
margin-bottom: .5em;
width: auto;
background-color: transparent;
}
&.thumbinner {
border: 1px solid #ccc;
padding: 3px;
background-color: #f9f9f9;
font-size: 94%;
text-align: center;
overflow: hidden;
}
}
html {
.thumbimage {
border: 1px solid #ccc;
}
.thumbcaption {
border: none;
line-height: 1.4em;
padding: 3px;
font-size: 94%;
text-align: left;
}
}
img.thumbborder {
border: 1px solid #dddddd;
}
div {
&.tright {
margin: 0.5em 0 1.3em 1.4em;
}
&.tleft {
margin: 0.5em 1.4em 1.3em 0;
}
}
.catlinks {
border: 1px solid #aaa;
background-color: #f9f9f9;
padding: 5px;
margin-top: 1em;
clear: both;
}
.usermessage {
background-color: #ffce7b;
border: 1px solid #ffa500;
color: black;
font-weight: bold;
margin: 2em 0 1em;
padding: .5em 1em;
vertical-align: middle;
}
#siteNotice {
position: relative;
text-align: center;
margin: 0;
}
#localNotice {
margin-bottom: 0.9em;
}
.firstHeading {
margin-bottom: .1em;
line-height: 1.2em;
padding-bottom: 0;
}
#siteSub {
display: none;
}
#jump-to-nav {
margin-top: -1.4em;
margin-bottom: 1.4em;
}
#contentSub, #contentSub2 {
font-size: 84%;
line-height: 1.2em;
margin: 0 0 1.4em 1em;
color: #545454;
width: auto;
}
span.subpages {
display: block;
}
div#column-content {
width: 100%;
float: right;
margin: 0 0 .6em -15em;
padding: 0;
}
.wiki-body {
margin: 1em 0 0 15em;
padding: 1em;
position: relative;
z-index: 2;
background: white;
color: black;
border: 1px solid #aaa;
border-right: none;
line-height: 1.5em;
}
div#column-one {
padding-top: 160px;
}
#column-one h2 {
position: absolute;
top: -9999px;
}
div#globalWrapper {
font-size: 127%;
width: 100%;
margin: 0;
padding: 0;
}
a {
color: #002bb8;
&:visited {
color: #5a3696;
}
&.new {
color: #cc2200;
}
}
#p-personal a.new {
color: #cc2200;
}
ul {
list-style-type: square;
list-style-image: url(data:image/gif;base64,R0lGODlhBQANAIAAAGOMnP///yH5BAEAAAEALAAAAAAFAA0AAAIJjI+pu+APo4SpADs=);
}
pre {
line-height: 1.1em;
}
#firstHeading {
padding-top: 0;
font-size: 210%;
font-weight: bold;
}
.portlet {
border: none;
margin: 0 0 .5em;
padding: 0;
float: none;
width: 16.5em;
overflow: hidden;
h3 {
background: transparent;
padding: 0 1em 0 .5em;
display: inline;
height: 1em;
/* text-transform:lowercase; */
font-size: 91%;
font-weight: normal;
white-space: nowrap;
}
}
.portlet-body {
font-size: 95%;
background-color: white;
color: black;
border-collapse: collapse;
border: 1px solid #aaa;
padding: 0 0.8em 0.3em 0.5em;
&:after {
content: '';
clear: both;
display: block;
}
}
.portlet {
ul {
line-height: 1.5em;
font-size: 95%;
}
li {
padding: 0;
margin: 0;
}
}
#p-logo {
top: 10px;
left: 10px;
position: absolute;
z-index: 3;
height: 155px;
width: 12em;
overflow: visible;
a {
display: block;
height: 155px;
width: 15em;
background-repeat: no-repeat;
background-position: 35% 50% !important;
text-decoration: none;
&:hover {
display: block;
height: 155px;
width: 15em;
background-repeat: no-repeat;
background-position: 35% 50% !important;
text-decoration: none;
}
}
}
div#footer {
background-color: white;
border-top: 1px solid #fabd23;
border-bottom: 1px solid #fabd23;
margin: .6em 0 1em 0;
overflow: hidden;
padding: .4em 0 .3em 0;
text-align: center;
font-size: 90%;
ul {
list-style-type: none;
list-style-image: unset;
}
li {
display: inline;
margin: 0 1.3em;
}
}
#column-one {
font-size: 14px;
}
#column-content {
font-size: 16px;
}
ul#f-list {
float: left;
width: 100%;
}
.floatleft {
float: left;
clear: left;
}
.floatright {
float: right;
clear: right;
}
#f-poweredbyico {
margin:0 8px;
position:relative;
top:-2px;
float:right;
height:1%;
}

5
_special/Redirect.html Normal file
View File

@ -0,0 +1,5 @@
---
layout: redirect
title: Example of redirection
redirect: New
---

16
_special/Tag:Example.md Normal file
View File

@ -0,0 +1,16 @@
---
layout: tag
title: Example of Tag
tags: Example
toc: false
created: 2019-04-12
modified: 2019-04-12
revisions:
- author: Alexis
date: 2019-04-12
comment: First version
---
## Example Tag
*Nice* examples

12
_special/User:Alexis.html Normal file
View File

@ -0,0 +1,12 @@
---
layout: user
title: Alexis
toc: false
created: 2019-04-12
modified: 2019-04-12
revisions:
- author: Alexis
date: 2019-04-12
comment: First version
---
I'm a developer.

17
_wiki-legacy/Old.html Normal file
View File

@ -0,0 +1,17 @@
---
layout: wiki
title: Old Page
tags: Example
toc: false
author: Alexis
created: 2009-04-12
modified: 2009-04-12
revisions:
- author: Alexis
date: 2009-04-12
comment: First version
---
<h2>Old</h2>
<p>This is an old page from an ancient Wiki.</p>
<h2>Migrated</h2>
<p>It has been exported as an HTML file, with a frontmatter.</p>

239
_wiki/Main.md Normal file
View File

@ -0,0 +1,239 @@
---
layout: wiki
title: Main Page
toc: false
created: 2009-04-12
modified: 2009-04-12
revisions:
- author: Alexis
date: 2009-04-12
comment: First version
---
# Why ?
I wrote this template in 2019 because I wanted to migrate a mediawiki-powered wiki to jekyll.
The template has a layout and a navigation that can replace my old wiki.
# How to
If you want to use this template, clone the [repository](https://github.com/jek4wik/jek4wik), customize it and write _wiki_ pages.
## Settings
The general settings are in the _config.yml file.
You may choose the *language*.
English (en) and french (fr) are supported out-of-the box.
```yaml
lang: en
```
You may customize the *collections*.
The only contraint is that the name of collections containing wiki pages should start with wiki.
```yaml
collections:
wiki-one:
output: true
permalink: "/:path"
path: ""
wiki-two:
output: true
permalink: "/:path"
path: ""
special:
output: true
permalink: "/:path"
path: ""
```
Of course, you'll have to change the other site settings like title, description or url.
## i18n
The labels are in i18n files in the `_data/i18n` directory.
These files contain also prefixes for special pages, the name of home page and the logo that will be displayed on the top left.
```yaml
home: Main
logo: /img/wiki.png
label:
author: Author
links: Links
tags: Other pages
...
prefix:
tag: "Category:"
user: "User:"
```
## Users
The users are declared in the _data/users.yml file.
```yaml
Alexis:
name: Alexis Hassler
logo: img/sewatech.png
```
Each user should have its page in the `_special` directory.
The name of this page starts with the prefix defined in the i18n file (here `User:`)
and end with the user short name (here `Alexis`).
# Wiki pages
Wiki pages are in collections that name starts with wiki.
The bootstrap project provides 2 collections : `wiki` and `wiki-legacy`.
The pages can be written in HTML, Markdown or Asciidoc.
> Note: Asciidoc is not supported on Github pages.
## Regular wiki page
A regular wiki page should be place in a _wiki_ collection.
The only required metadata in frontmatter is the layout.
The simplest page may be something like this:
```yaml
---
layout: wiki
---
Example with minimal frontmatter
```
The frontmatter may contain the following attributes:
* title: will be displayed on top of the page
* author: will be displayed in a div in the left columns
* toc: true/false wether you want a generated table of content
* created and modified: date in format yyyy-MM-dd
* revisions: not displayed (maybe for a future use)
> Note: the toc plugin doesn't work on Github pages
## Redirect page
A redirect page should be place in a _wiki_ collection.
It should have a frontmatter with a **layout** and a **redirect**, and no content
```yaml
---
layout: redirect
redirect: New
---
```
> Note: redirections may be managed in an other way with the _jekyll-redirect-from_ plugin
## Tag page
A tag page should be place in a _special_ collection.
The file name should have the prefix defined in the _i18n_ file and end with the tag name.
For example, a file named `Tag:Example.md` would fit with the following i18n configuration.
```yaml
prefix:
tag: "Tag:"
```
> Note: this is in the i18n files because mediawiki translates this prefix ; it is Category in english and Catégorie in french
The tag page may have the same metadata as a regular page.
```yaml
---
layout: tag
title: Example of Tag
tags: Example
toc: false
created: 2019-04-12
modified: 2019-04-12
revisions:
- author: Alexis
date: 2019-04-12
comment: First version
---
## Example Tag
Nice examples
```
## User pages
A user page should be place in a _special_ collection.
The file name should have the prefix defined in the _i18n_ file and end with the user name.
For example, a file named `User:Example.md` would fit with the following i18n configuration.
```yaml
prefix:
user: "User:"
```
> Note: this is in the i18n files because mediawiki translates this prefix ; it is User in english and Utilisateur in french
The user page may have the same metadata as a regular page.
```yaml
---
layout: user
title: Alexis
created: 2019-04-12
modified: 2019-04-12
---
I'm a developer.
```
# Deploy
The simplest way to deploy your wiki is to generate the site and copy it to a Web Server.
```yaml
jekyll build
```
As any Jekyll web site, the generation may be done on a CI server (TravisCI,...) or with the CI capabilities of the Git server (Gitlab, Github actions,...).
## Apache HTTP server
A `.htaccess` file is provided.
If the site is deployed on a Apache HTTP server, some old mediawiki URLs are rewritten to the new Jekyll URLs.
## Github pages
The wiki may be deployed on Github pages with the following contraints:
* Only HTML or Markdown, no Asciidoc
* No generated toc
If you want to have this features on Github pages, you should push the generated site.
Any CI tool can help.
## Gitlab pages
[TBD]
## Github actions
[TBD]
## TravisCI
[TBD]
# Examples
* Example of a [new page](New.html)
* Example of a [legacy page](Old.html)
* Example of a [redirected page](Redirect.html)
* Example of a [user page](./User:Alexis.html)
* [RSS](feed.xml) feed of new pages
* Example of a [tag page](./Category:Example.html)
* [All tags page](./tags.html)

4
_wiki/Minimal.md Normal file
View File

@ -0,0 +1,4 @@
---
layout: wiki
---
Example with minimal frontmatter

27
_wiki/New-Adoc.adoc Normal file
View File

@ -0,0 +1,27 @@
---
layout: wiki
title: New Page (Adoc)
tags: Example
toc: false
author: Alexis
created: 2009-04-12
modified: 2009-04-12
revisions:
- author: Alexis
date: 2009-04-12
comment: First version
---
== New
This is an new page design for Jekyll.
== Adoc
It has been written in adoc.
Won't be displayed on Github Pages (direct).
Probably works via CI.
[source]
----
Example of source code
----

20
_wiki/New.md Normal file
View File

@ -0,0 +1,20 @@
---
layout: wiki
title: New Page
tags: Example
toc: false
author: Alexis
created: 2009-04-12
modified: 2009-04-12
revisions:
- author: Alexis
date: 2009-04-12
comment: First version
---
## New
This is an new page designed for Jekyll.
## Markdown
It has been written in Markdown.

4
css/main.scss Normal file
View File

@ -0,0 +1,4 @@
---
# Only the main Sass file needs front matter (the dashes are enough)
---
@import "wiki";

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

23
feed.xml Normal file
View File

@ -0,0 +1,23 @@
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.description }}</description>
<link>{{ site.url }}</link>
{% include /functions/wiki-pages.html %}
{% for post in wiki_pages reversed%}
{% unless post.draft %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.description | xml_escape | truncate: 300 }}</description>
<pubDate>{{ post.created | date_to_xmlschema }}</pubDate>
<link>{{ post.url | prepend: site.url | append: '.html'}}</link>
<guid isPermaLink="true">{{ post.url | prepend: site.url | append: '.html' }}</guid>
</item>
{% endunless %}
{% endfor %}
</channel>
</rss>

BIN
img/sewatech.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
img/wiki.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

3
index.html Normal file
View File

@ -0,0 +1,3 @@
---
layout: redirect
---

51
tags.html Normal file
View File

@ -0,0 +1,51 @@
---
layout: default
title: Tags
---
{% assign var = 10 %}
{% 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 %}
<ul>
{% for tag in 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 %}
<li><a href="{{ other_page.url }}">{{ other_page.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</ul>