Ikiwiki: Difference between revisions
| Line 70: | Line 70: | ||
== Editing the wiki == | == Editing the wiki == | ||
=== Adding content === | |||
<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> | |||
=== Using templates === | === Using templates === | ||
| Line 105: | Line 121: | ||
So this worked (sort of) and it showed the status bar again! | 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.]] | [[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 [[plugins/pagetemplatename]] in every file you made?? | |||
to | |||
=== Customizing the header === | === Customizing the header === | ||
Revision as of 14:47, 19 May 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
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
Using 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??
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;
}