commit 61baeb18070be628a1def838899a7624e1ea9470 Author: Alexis Hassler Date: Fri Apr 12 23:08:34 2019 +0200 First version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..15e9da4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +_site +.sass-cache +Gemfile.lock \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..53d89e2 --- /dev/null +++ b/.htaccess @@ -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] \ No newline at end of file diff --git a/404.html b/404.html new file mode 100644 index 0000000..c472b4e --- /dev/null +++ b/404.html @@ -0,0 +1,24 @@ +--- +layout: default +--- + + + +
+

404

+ +

Page not found :(

+

The requested page could not be found.

+
diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..89285aa --- /dev/null +++ b/Gemfile @@ -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 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..e8c3c2d --- /dev/null +++ b/LICENSE.txt @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0f62c02 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Bootstrap project to start a wiki powered by [Jekyll](https://jekyllrb.com/) + +See https://jek4wik.github.io for more information \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2c2abca --- /dev/null +++ b/_config.yml @@ -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: "" diff --git a/_data/i18n/en.yml b/_data/i18n/en.yml new file mode 100644 index 0000000..9eb2fef --- /dev/null +++ b/_data/i18n/en.yml @@ -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:" diff --git a/_data/i18n/fr.yml b/_data/i18n/fr.yml new file mode 100644 index 0000000..bcd592a --- /dev/null +++ b/_data/i18n/fr.yml @@ -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:" diff --git a/_data/users.yml b/_data/users.yml new file mode 100644 index 0000000..5c3afb1 --- /dev/null +++ b/_data/users.yml @@ -0,0 +1,3 @@ +Alexis: + name: Alexis Hassler + logo: img/sewatech.png diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..6239949 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,12 @@ +
+ diff --git a/_includes/formatted_date.html b/_includes/formatted_date.html new file mode 100644 index 0000000..317eeba --- /dev/null +++ b/_includes/formatted_date.html @@ -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 }} diff --git a/_includes/functions/redirect-page.html b/_includes/functions/redirect-page.html new file mode 100644 index 0000000..9fd7401 --- /dev/null +++ b/_includes/functions/redirect-page.html @@ -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 %} diff --git a/_includes/functions/wiki-pages.html b/_includes/functions/wiki-pages.html new file mode 100644 index 0000000..670af12 --- /dev/null +++ b/_includes/functions/wiki-pages.html @@ -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 %} \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 0000000..c758d50 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,10 @@ + + {{ page.title }} + + + {% if include.redirect_url %} + + + {% endif %} + + \ No newline at end of file diff --git a/_includes/links.html b/_includes/links.html new file mode 100644 index 0000000..af2013c --- /dev/null +++ b/_includes/links.html @@ -0,0 +1,12 @@ +{% if page.links != nil %} + +{% endif %} \ No newline at end of file diff --git a/_includes/logo.html b/_includes/logo.html new file mode 100644 index 0000000..11864bf --- /dev/null +++ b/_includes/logo.html @@ -0,0 +1,3 @@ + diff --git a/_includes/tags.html b/_includes/tags.html new file mode 100644 index 0000000..d523626 --- /dev/null +++ b/_includes/tags.html @@ -0,0 +1,21 @@ +{% if page.tags.size > 0 %} + +{% endif %} diff --git a/_includes/toc.html b/_includes/toc.html new file mode 100644 index 0000000..3875091 --- /dev/null +++ b/_includes/toc.html @@ -0,0 +1,8 @@ +{% if page.toc == true %} +
+

{{ site.data.i18n[site.lang].label.toc }}

+
+ {{ content | toc_only }} +
+
+{% endif %} diff --git a/_includes/user.html b/_includes/user.html new file mode 100644 index 0000000..04dbdb8 --- /dev/null +++ b/_includes/user.html @@ -0,0 +1,14 @@ +{% if page.author %} +
+

{{ site.data.i18n[site.lang].label.author }}

+
+ {% assign author = site.data.users[page.author] %} + + {% if author.logo %} + + {% endif %} +
+
+{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..1179bdf --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,34 @@ + + + {% include head.html %} + + + +
+
+
+ +

+ {{ page.title }} +

+ +
+
+ {{ content | inject_anchors }} +
+
+
+
+ +
+ {% include logo.html %} + {% include user.html %} + {% include toc.html %} + {% include links.html %} + {% include tags.html %} +
+
+ + {% include footer.html %} + + diff --git a/_layouts/redirect.html b/_layouts/redirect.html new file mode 100644 index 0000000..dd802d2 --- /dev/null +++ b/_layouts/redirect.html @@ -0,0 +1,35 @@ + + {% include /functions/redirect-page.html %} + + {% assign redirect_url = redirect_page.url | append: ".html" %} + {% include head.html redirect_url = redirect_url %} + + + +
+
+
+ +

+ {{ redirect_page.title }} +

+ +
+
+
+

{{ site.data.i18n[site.lang].label.redirect }} :

+ +
+
+
+
+
+
+ {% include logo.html %} +
+
+ {% include footer.html %} + + diff --git a/_layouts/tag.html b/_layouts/tag.html new file mode 100644 index 0000000..ce28504 --- /dev/null +++ b/_layouts/tag.html @@ -0,0 +1,56 @@ + + + + {{ page.title }} + + + + + + +
+
+
+ +

+ {{ page.tags }} +

+ +
+
+ {{ content }} +
+
+ +
+

{{ site.data.i18n[site.lang].label.tag_pages }} {{ page.tags }}

+
+
    + {% 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 %} +
  • {{ other_page.title }}
  • + {% endif %} + {% endfor %} + {% endfor %} +
+
+
+ +
+
+
+ {% include logo.html %} +
+
+ {% include footer.html %} + + diff --git a/_layouts/user.html b/_layouts/user.html new file mode 100644 index 0000000..73dae17 --- /dev/null +++ b/_layouts/user.html @@ -0,0 +1,4 @@ +--- +layout: default +--- +{{ content }} diff --git a/_layouts/wiki.html b/_layouts/wiki.html new file mode 100644 index 0000000..73dae17 --- /dev/null +++ b/_layouts/wiki.html @@ -0,0 +1,4 @@ +--- +layout: default +--- +{{ content }} diff --git a/_sass/wiki.scss b/_sass/wiki.scss new file mode 100644 index 0000000..50696a4 --- /dev/null +++ b/_sass/wiki.scss @@ -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%; +} diff --git a/_special/Redirect.html b/_special/Redirect.html new file mode 100644 index 0000000..7e3d2c8 --- /dev/null +++ b/_special/Redirect.html @@ -0,0 +1,5 @@ +--- +layout: redirect +title: Example of redirection +redirect: New +--- diff --git a/_special/Tag:Example.md b/_special/Tag:Example.md new file mode 100644 index 0000000..e1f80e0 --- /dev/null +++ b/_special/Tag:Example.md @@ -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 diff --git a/_special/User:Alexis.html b/_special/User:Alexis.html new file mode 100644 index 0000000..96c11a2 --- /dev/null +++ b/_special/User:Alexis.html @@ -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. diff --git a/_wiki-legacy/Old.html b/_wiki-legacy/Old.html new file mode 100644 index 0000000..d38f528 --- /dev/null +++ b/_wiki-legacy/Old.html @@ -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 +--- +

Old

+

This is an old page from an ancient Wiki.

+

Migrated

+

It has been exported as an HTML file, with a frontmatter.

diff --git a/_wiki/Main.md b/_wiki/Main.md new file mode 100644 index 0000000..783a203 --- /dev/null +++ b/_wiki/Main.md @@ -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) diff --git a/_wiki/Minimal.md b/_wiki/Minimal.md new file mode 100644 index 0000000..8eefc33 --- /dev/null +++ b/_wiki/Minimal.md @@ -0,0 +1,4 @@ +--- +layout: wiki +--- +Example with minimal frontmatter \ No newline at end of file diff --git a/_wiki/New-Adoc.adoc b/_wiki/New-Adoc.adoc new file mode 100644 index 0000000..a666ca1 --- /dev/null +++ b/_wiki/New-Adoc.adoc @@ -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 +---- \ No newline at end of file diff --git a/_wiki/New.md b/_wiki/New.md new file mode 100644 index 0000000..21352db --- /dev/null +++ b/_wiki/New.md @@ -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. diff --git a/css/main.scss b/css/main.scss new file mode 100644 index 0000000..d7ba096 --- /dev/null +++ b/css/main.scss @@ -0,0 +1,4 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- +@import "wiki"; \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..e8b4e38 Binary files /dev/null and b/favicon.ico differ diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000..1f2ce0a --- /dev/null +++ b/feed.xml @@ -0,0 +1,23 @@ +--- +layout: null +--- + + + + {{ site.title }} + {{ site.description }} + {{ site.url }} + {% include /functions/wiki-pages.html %} + {% for post in wiki_pages reversed%} + {% unless post.draft %} + + {{ post.title | xml_escape }} + {{ post.description | xml_escape | truncate: 300 }} + {{ post.created | date_to_xmlschema }} + {{ post.url | prepend: site.url | append: '.html'}} + {{ post.url | prepend: site.url | append: '.html' }} + + {% endunless %} + {% endfor %} + + diff --git a/img/sewatech.png b/img/sewatech.png new file mode 100644 index 0000000..977d7d7 Binary files /dev/null and b/img/sewatech.png differ diff --git a/img/wiki.png b/img/wiki.png new file mode 100644 index 0000000..e6c3203 Binary files /dev/null and b/img/wiki.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..9bc660a --- /dev/null +++ b/index.html @@ -0,0 +1,3 @@ +--- +layout: redirect +--- diff --git a/tags.html b/tags.html new file mode 100644 index 0000000..5eca23d --- /dev/null +++ b/tags.html @@ -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 %} + +