Ikiwiki: Difference between revisions
mNo edit summary |
No edit summary |
||
| (6 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 compiler that generates static html from markdown files through a git repository. | Ikiwiki is a very lightweight wiki compiler that generates static html from markdown files through a git repository. | ||
| 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 23: | Line 25: | ||
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:Ikiwiki edit flow.jpg|thumb|ikiwiki edit flow]] | 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]] | |||
=== 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 87: | Line 93: | ||
to create nested linked pages, you can make directories in the <code>$srcdir</code> | to create nested linked pages, you can make directories in the <code>$srcdir</code> | ||
=== Using templates === | === 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 | When you make your first <code>index.mdwn</code> in your '''srcdir''', you can then run | ||
<pre> | <pre> | ||
| Line 126: | Line 141: | ||
'''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?? | '''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 === | === Customizing the header === | ||
| Line 145: | Line 173: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== 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 == | == Projects built on ikiwiki == | ||
| Line 152: | Line 187: | ||
* [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://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 == | == Links to sort == | ||
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