DokuWiki

I use DokuWiki to build this website. It is running on one awesome droplet. It is served by Apache2. The domain name paulsammut.com points to it and a virtual host on port 80 picks up the traffic.

Change Log

The following are modifications I have done to it.

  • Changed theme to Boostrap3
  • Removed the footer by deleting everything inside dokuwiki/lib/tpl/dokuwiki/tpl_footer.php
  • Added a google analytics plugin
  • Added a mathjax plugin
  • Added a discussion plugin for comments

I tried a couple of vim plugins that allow you to log into the DokuWiki server and serve up pages to vim for editing, but they were dependant on an old package of dokuwikixmlrpc which I could not get to install. I tried for a day to update the package to allow the install but I was sure to keep running into problems.

I use the nblock/vim-dokuwiki syntax highlighting plugin. To activate I have to run this command:

:set ft=dokuwiki

I added a function in my .vimrc that checks if the file is a DokuWiki file and sets this syntax automatically. It does this with two checks:

  • File extension is *.txt
  • First line contains ===== which is DokuWiki syntax for main heading

It then sends keys to unfold the doc, as the doc opens fully folded by default.

" For DokuWiki txt files.
au BufRead *.txt call s:checkSyntaxDokuWiki()
 
" Check if first line contains heading
fun! s:checkSyntaxDokuWiki()
    if getline(1) =~ "======"
        set ft=dokuwiki
        normal zR
    endif
endfunction

So I spent over an hour redoing the site to have a hierarchy system of namespaces. After I set it up, I realized I didn't want it. It adds unnecessary complication to the page and here are the reasons I reverted back to pre-namespace.

  • Forcing me to have start pages for every parent node in the hierarchy
  • Complicates the links by now adding their trace
  • Forces me to write duplicate code with links
  • Adds hours of reshuffling for no appreciable gain
  • The DokuWiki site doesn't use namespaces for its content

I use various plugins to get the functionality I wanted.

Discussion Plugin

I use the DokuWiki Discussion Plugin to add comments. I tried using the plugin┬╗discussion┬╗automatic setting and turning off discussion where I didn't want it, but this did not work. So I had to add the string at the end of every %page using this commnad:

printf "\n" | tee -a *.txt

Analytics Plugin

I set up Google Analytics using the Google Analytics DokuWiki plugin link. I just had to enter the tracking ID into the plugin configuration.

  • dokuwiki.txt
  • Last modified: 2019/03/31 14:49
  • (external edit)