Ikiwiki: Difference between revisions
No edit summary |
No edit summary |
||
| (36 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
[[File:Ikiwikimeme.jpg|thumb|made by [[User:Barbs|Barbs]]]] | |||
== About == | == About == | ||
Ikiwiki is a very lightweight wiki | Ikiwiki is a very lightweight wiki compiler that generates static html from markdown files through a git repository. | ||
It is a very cool project with terrible documentation, so let's compile what we know and learn in this page! | It is a very cool project with terrible documentation, so let's compile what we know and learn in this page! | ||
== | == Installing on Debian == | ||
<blockquote>'''NOTE:''' | <blockquote>'''NOTE:''' | ||
| Line 11: | Line 13: | ||
where '''<u>$USER</u>''' put the name of the local user</blockquote> | where '''<u>$USER</u>''' put the name of the local user</blockquote> | ||
sudo apt install ikiwiki | sudo apt install ikiwiki | ||
make sure you also have <code>librpc-xml-perl</code> and <code> | make sure you also have <code>librpc-xml-perl</code> and <code>python3-docutils</code> | ||
=== Setup <ref>https://ikiwiki.info/setup/#index1h2</ref> === | === Setup <ref>https://ikiwiki.info/setup/#index1h2</ref> === | ||
| Line 17: | Line 19: | ||
<code>ikiwiki --setup /etc/ikiwiki/auto.setup</code> | <code>ikiwiki --setup /etc/ikiwiki/auto.setup</code> | ||
If you get this error: | If you get this error: | ||
/etc/ikiwiki/auto.setup: Only one Term::ReadLine::Gnu instance is allowed. at /usr/share/perl5/IkiWiki/Setup/Automator.pm line 17. | ''/etc/ikiwiki/auto.setup: Only one Term::ReadLine::Gnu instance is allowed. at /usr/share/perl5/IkiWiki/Setup/Automator.pm line 17.'' | ||
try adding <code>PERL_RL=Perl</code> before ikiwiki <ref>https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1113969</ref><blockquote>you will then get a series of prompts:</blockquote> | |||
What will the wiki be named? '''<u>$WIKI</u>''' | What will the wiki be named? '''<u>$WIKI</u>''' | ||
What revision control system to use? git | What revision control system to use? git | ||
What wiki user (or openid) will be admin? <u>'''$USER'''</u> | What wiki user (or openid) will be admin? <u>'''$USER'''</u> | ||
Choose a password: | Choose a password: | ||
You can later change these settings in <code>/home/'''<u>$USER</u>'''/'''<u>$WIKI</u>'''.setup</code> | |||
[[File:Ikiwikiiii.jpg|center|frameless|484x484px]] | |||
[[File:Ikiwiki edit flow.jpg|thumb|ikiwiki edit flow]] | [[File:Ikiwiki edit flow.jpg|thumb|ikiwiki edit flow]] | ||
=== Variables === | === Variables === | ||
[[File:Ikiwikiiii.jpg|right|frameless]] | |||
Two important variables in the ikiwiki universe are <code>$srcdir</code>, the source directory, and <code>$destdir</code>, the destination directory. | Two important variables in the ikiwiki universe are <code>$srcdir</code>, the source directory, and <code>$destdir</code>, the destination directory. | ||
| Line 36: | Line 42: | ||
<big>and your <code>$destdir</code> is <code>/home/'''<u>$USER</u>'''/public_html/'''<u>$WIKI</u>'''</code></big> | <big>and your <code>$destdir</code> is <code>/home/'''<u>$USER</u>'''/public_html/'''<u>$WIKI</u>'''</code></big> | ||
== | == Publishing your ikiwiki with nginx == | ||
'''SEE ALSO:''' [[User:Eleni/Setting up a public server|Setting up a public server]] | |||
=== Ikiwiki on a subdomain === | |||
<blockquote>what has worked for me ([[User:Eleni|eleni]])</blockquote>move your <code>$destdir</code> from <code>/home/'''<u>$USER</u>'''/public_html/'''<u>$WIKI</u>'''</code> in <code>/var/www/html/'''<u>$WIKI</u>'''/</code> | |||
DONT FORGET! update <code>/home/$USER/$WIKI.setup</code> with the new destination path! | |||
==== nginx configuration ==== | |||
inside <code>/etc/nginx/site-available</code> create a new file for your subdomain -> <code>subdomain.example.com</code><syntaxhighlight lang="nginx"> | |||
server { | |||
server_name subdomain.example.com; #YOURSUBDOMAIN | |||
root /var/www/html/$WIKI; | |||
index index.html index.htm; | |||
location / { | |||
try_files $uri $uri/ =404; | |||
} | |||
} | |||
</syntaxhighlight>then run <code>ln -s /etc/nginx/sites-available/subdomain.example.com /etc/nginx/sites-enabled</code> | |||
restart nginx and you're done! | |||
== | == Installing ikiwiki on a phone server == | ||
Claudio pls add here <3 | Claudio pls add here <3 | ||
== Editing the wiki == | == Editing the wiki == | ||
=== | === Adding content === | ||
add local.css in the git folder <code>/home/'''<u>$USER</u>'''/'''<u>$WIKI</u>'''/</code> | <big>'''!''' always add and modify inside <code>$srcdir</code> '''!'''</big> | ||
start by creating an index page with <code>touch index.mdwn</code> then <code>sudo nano index.mdwn</code> to add content. use [https://www.markdownguide.org/basic-syntax/ markdown syntax]! | |||
to add the file to the git repository for the first time, run <code>git add index.mdwn</code> | |||
every time you're done make changes to your wiki, run <code>git commit -a -m "your inspirational message"</code> then <code>git push</code> | |||
your last step to compile the files in the git repository in ikiwiki is to run | |||
ikiwiki $srcdir $destdir -- refersh | |||
for example, | |||
ikiwiki /home/'''<u>$USER</u>'''/'''<u>$WIKI</u>'''/ /home/'''<u>$USER</u>'''/public_html/'''<u>$WIKI</u>''' --refresh | |||
to create nested linked pages, you can make directories in the <code>$srcdir</code> | |||
=== Templates === | |||
==== Using global templates ==== | |||
Tou use the default ikiwiki templates found in <code>/usr/share/ikiwiki/templates</code> , you need to create a template folder in <code>/home/'''<u>$USER</u>'''/'''<u>$WIKI</u>'''/</code> <pre> | |||
mkdir templates/ | |||
</pre>and add a template there. '''For example,''' if you want a template for '''all pages''', copy <code>/usr/share/ikiwiki/templates/page.tmpl</code> in <code>/home/'''<u>$USER</u>'''/'''<u>$WIKI</u>'''/templates</code> and edit to your liking!! | |||
To render a new template in your wiki, you run <code>--rebuild</code> instead of <code>--refresh</code> | |||
==== Using custom templates ==== | |||
When you make your first <code>index.mdwn</code> in your '''srcdir''', you can then run | |||
<pre> | |||
ikiwiki --refresh srcdir/ destdir/ | |||
</pre> | |||
You will notice that the wiki header vanishes (goodbyeeee). | |||
[[File:Ikiwikisuccess.png|thumb|center|First time (before) wiki is created after setup configuration file.]] | |||
[[File:Ikiwikiscreenshot.png|thumb|center|Second time, after refreshing the first time with your .mdwn index file.]] | |||
SOO together with [[User:Barbs]] we kind of got pissed and decided to take a look into what is going on. | |||
We started looking into templates, and with no surpise, the main documentation is pretty lame, but we found a link that sort of explains the situation ok: | |||
https://scripts.mit.edu/gitweb/www/ikiwiki.git/blob/b30fed47ea20c4b04c1cf9c68b6d69cfa0612c3a:/doc/wikitemplates.mdwn#l4 | |||
Soo, looking back at our <code>index.mdwn</code>, we picked one of the templates listed and added a link in markdown to make use of it we used "blogpost.tmpl": | |||
<pre> | |||
[[plugins/blogpost.tmpl]] | |||
# Welcome to my ikiwiki | |||
## It sucks | |||
But just for now... | |||
see you soon. | |||
</pre> | |||
(This is my index.mdwn file) | |||
So this worked (sort of) and it showed the status bar again! | |||
[[File:Ikiwiki-w-template-.png|thumb|center|Now the status bar is back, but there is a weird thing at the line where I wrote which template we used.]] === | |||
'''Question for Marloes >:)''' | |||
'''Q:'''Did you define which template to use in your setup file or did you put ''<nowiki>[[plugins/pagetemplatename]]</nowiki>'' in every file you made and then rendered it?? | |||
=== Emojis === | |||
Because interepreting ikiwiki's official documentation can give you a headache, you can rest your mind by filling your pages with emojis. | |||
https://ikiwiki.info/smileys/ | |||
Simply typing the text that is associated with an emoji illustrated at this link, will make it spawn on your page(s) once refreshed | |||
examples: | |||
<pre> | |||
/!\ | |||
{OK} | |||
</pre> | |||
=== Customizing the header === | |||
blahblah | |||
=== Customizing CSS === | |||
add <code>local.css</code> in the git folder <code>/home/'''<u>$USER</u>'''/'''<u>$WIKI</u>'''/</code> | |||
that way you can fully customize your wiki! | that way you can fully customize your wiki! | ||
= | sometimes, changes in the <code>local.css</code> file is overwritten by the <code>style.css</code>, so if something does not appear to work, try including '''!important''' | ||
for example;<syntaxhighlight lang="css"> | |||
body { | |||
max-width:50% !important; | |||
} | |||
</syntaxhighlight> | |||
== Projects | == Plugins == | ||
Some features of ikiwiki are not enabled by default. | |||
The documentation mentions that to enable a plugin you can edit your <code>$WIKI.setup</code> file, but there is a command that allows you to activate a plugin without editing the .setup file by hand: | |||
<pre> | |||
ikiwiki --changesetup $WIKI.setup --plugin calendar | |||
</pre> | |||
Next you should refresh or rebuild you wiki using the updated setup to see any changes. | |||
== Projects built on ikiwiki == | |||
* [https://damaged.bleu255.com/ Damaged Earth Catalogue] | * [https://damaged.bleu255.com/ Damaged Earth Catalogue] | ||
* [https://permacomputing.net/ Permacomputing] | * [https://permacomputing.net/ Permacomputing] | ||
* [https://wiki.fanon.radio/ Fanon Radio Wiki] | * [https://wiki.fanon.radio/ Fanon Radio Wiki] | ||
* [https://eleni.fanon.radio/ Eleni's personal website hehe] | * [https://eleni.fanon.radio/ Eleni's personal website hehe] | ||
* [https://hub.xpub.nl/rushtonhosts/everything-magazine-archive/ the Everything magazine archive] | |||
* [https://www.cs.unb.ca/~bremner/ David Bremner' personal website (UNB professor)] | |||
* [https://gitlab.com/spi-inc/website Software in the Public Interest] | |||
== Links to sort == | |||
* [https://www.wikimatrix.org/show/ikiwiki#tabs A table of ikiwiki features] | |||
* [https://permacomputing.net/installing/ pmc installation guide] | |||
== References == | == References == | ||
Latest revision as of 18:15, 17 June 2026
About
Ikiwiki is a very lightweight wiki compiler that generates static html from markdown files through a git repository.
It is a very cool project with terrible documentation, so let's compile what we know and learn in this page!
Installing on Debian
NOTE:
where $WIKI put the name of your wiki
where $USER put the name of the local user
sudo apt install ikiwiki
make sure you also have librpc-xml-perl and python3-docutils
Setup [1]
You run the following command:
ikiwiki --setup /etc/ikiwiki/auto.setup
If you get this error:
/etc/ikiwiki/auto.setup: Only one Term::ReadLine::Gnu instance is allowed. at /usr/share/perl5/IkiWiki/Setup/Automator.pm line 17.
try adding PERL_RL=Perl before ikiwiki [2]
you will then get a series of prompts:
What will the wiki be named? $WIKI What revision control system to use? git What wiki user (or openid) will be admin? $USER Choose a password:
You can later change these settings in /home/$USER/$WIKI.setup
Variables
Two important variables in the ikiwiki universe are $srcdir, the source directory, and $destdir, the destination directory.
You make changes in $srcdir only! Ikiwiki does the rest.
by default, your $srcdir is /home/$USER/$WIKI/
and your $destdir is /home/$USER/public_html/$WIKI
Publishing your ikiwiki with nginx
SEE ALSO: Setting up a public server
Ikiwiki on a subdomain
what has worked for me (eleni)
move your $destdir from /home/$USER/public_html/$WIKI in /var/www/html/$WIKI/
DONT FORGET! update /home/$USER/$WIKI.setup with the new destination path!
nginx configuration
inside /etc/nginx/site-available create a new file for your subdomain -> subdomain.example.com
server {
server_name subdomain.example.com; #YOURSUBDOMAIN
root /var/www/html/$WIKI;
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
then run ln -s /etc/nginx/sites-available/subdomain.example.com /etc/nginx/sites-enabled
restart nginx and you're done!
Installing ikiwiki on a phone server
Claudio pls add here <3
Editing the wiki
Adding content
! always add and modify inside $srcdir !
start by creating an index page with touch index.mdwn then sudo nano index.mdwn to add content. use markdown syntax!
to add the file to the git repository for the first time, run git add index.mdwn
every time you're done make changes to your wiki, run git commit -a -m "your inspirational message" then git push
your last step to compile the files in the git repository in ikiwiki is to run
ikiwiki $srcdir $destdir -- refersh
for example,
ikiwiki /home/$USER/$WIKI/ /home/$USER/public_html/$WIKI --refresh
to create nested linked pages, you can make directories in the $srcdir
Templates
Using global templates
Tou use the default ikiwiki templates found in /usr/share/ikiwiki/templates , you need to create a template folder in /home/$USER/$WIKI/
mkdir templates/
and add a template there. For example, if you want a template for all pages, copy /usr/share/ikiwiki/templates/page.tmpl in /home/$USER/$WIKI/templates and edit to your liking!!
To render a new template in your wiki, you run --rebuild instead of --refresh
Using custom templates
When you make your first index.mdwn in your srcdir, you can then run
ikiwiki --refresh srcdir/ destdir/
You will notice that the wiki header vanishes (goodbyeeee).
SOO together with User:Barbs we kind of got pissed and decided to take a look into what is going on. We started looking into templates, and with no surpise, the main documentation is pretty lame, but we found a link that sort of explains the situation ok:
Soo, looking back at our index.mdwn, we picked one of the templates listed and added a link in markdown to make use of it we used "blogpost.tmpl":
[[plugins/blogpost.tmpl]] # Welcome to my ikiwiki ## It sucks But just for now... see you soon.
(This is my index.mdwn file)
So this worked (sort of) and it showed the status bar again!
===
Question for Marloes >:)
Q:Did you define which template to use in your setup file or did you put [[plugins/pagetemplatename]] in every file you made and then rendered it??
Emojis
Because interepreting ikiwiki's official documentation can give you a headache, you can rest your mind by filling your pages with emojis.
Simply typing the text that is associated with an emoji illustrated at this link, will make it spawn on your page(s) once refreshed
examples:
/!\
{OK}
Customizing the header
blahblah
Customizing CSS
add local.css in the git folder /home/$USER/$WIKI/
that way you can fully customize your wiki!
sometimes, changes in the local.css file is overwritten by the style.css, so if something does not appear to work, try including !important
for example;
body {
max-width:50% !important;
}
Plugins
Some features of ikiwiki are not enabled by default.
The documentation mentions that to enable a plugin you can edit your $WIKI.setup file, but there is a command that allows you to activate a plugin without editing the .setup file by hand:
ikiwiki --changesetup $WIKI.setup --plugin calendar
Next you should refresh or rebuild you wiki using the updated setup to see any changes.
Projects built on ikiwiki
- Damaged Earth Catalogue
- Permacomputing
- Fanon Radio Wiki
- Eleni's personal website hehe
- the Everything magazine archive
- David Bremner' personal website (UNB professor)
- Software in the Public Interest