Ikiwiki: Difference between revisions
| Line 40: | Line 40: | ||
=== Ikiwiki on a subdomain === | === 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 == | == Installing ikiwiki on a phone server == | ||
Revision as of 19:35, 30 April 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 python-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
heh
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 -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 --rebuild
for example,
ikiwiki /home/$USER/$WIKI/ /home/$USER/public_html/$WIKI --rebuild
this command rebuilds the whole wiki tree. If you just made content changes inside existing markdown files, you can write --refresh instead.
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;
}