My personal wiki




This site is maintained using vimwiki, a vim plugin allowing you to create a wiki easily. This page will explain a bit the set up of this vimwiki. You may want to check this page if you want to set up your own vimwiki website because this whole infra has been done using just OpenSSH, NGINX and vim (of course).

Seperate user to maintain the wiki

To maintain this wiki, I decided to create a seperate user for security and make maintenance easier. The user don't have shell access but just SFTP access so I can mount the wiki using sshfs like this:

 $ sshfs server:/ ~/mnt

This user does not have any privilege other than editing it's home directory and is chrooted into it's home directory. In the home directory there are only 2 folders: docs and docs_html

docs will contain the whole vimwiki. docs_html will contain the exported HTML.

NGINX Configuration

The NGINX configuration is fairly simple to set up. You just have to set up the root directive to the docs_html folder.

server {
    listen 80;
    root /path/to/wikiuser/docs_html;

Vimwiki set up

To set up vimwiki, I suggest you take a look at their website. It is pretty well documented how to get it. It is just a simple plugin to install in your vim configuration.

Custom template and CSS

Vimwiki has a feature that allows you to create a template and CSS stylesheet. If you don't have made any stylesheet, vimwiki will generate one in the docs_html folder. Feel free to modify it or change it.

Concerning templates, you might want to create your own HTML template. To have help about the templating system. Type :help vimwiki in vim.

If you just want a practical example, have my vimwiki configuration :

let g:vimwiki_list = [{'path': '~/mnt/docs',
                        \ 'template_path': '~/mnt/docs/temp/',
                        \ 'template_default': 'template',
                        \ 'template_ext': '.html'}]