21 @ oct

How the hell is this fuckin website made ?

I don’t give a fuck about new web 2.0.53 DOT MY BALLS websites. Many of them are just heavy craps. Here is a minimalistic website…

What do I need ? something to share my knowledge. Something fast. Powerful. I don’t need, I don’t want animations, heavy pictures,
bloated “admin interface”.

I want to write plain text. But I want it to be readable, browseable.
I write plain text but it shows a complete simple (minimalistic), static HTML website

I want to keep old versions of what I've written.
I also may want my friends to be able to write on my website.
I use subversion.

I like coding, although i'm not a good programmer. I may want to share some snippets.
Use a good editor, luke.

Ingredients

Recipe

  • Set up a subversion repository.
  • get my hacked genosite script, or the official genosite script from suckless.org. You also may be interested in chgmj, a similar script, written in python by a friend of mine.
  • Set a post-commit hook to update a httpd-served checkout directory.
    Here is mine:

    /usr/local/bin/svn update /usr/local/www/zecrazytux.net --username=commit --password=prout
    chmod +x /usr/local/www/zecrazytux.net/Bordel/gen.sh.txt
    /usr/local/www/zecrazytux.net/Bordel/gen.sh.txt /usr/local/www/zecrazytux.net
    
  • Check Out from a client, create the folders and write some markdown files (.md), and commit

  • If you need to post some code, use :TOhtml in vim to save highlighted code into html. (copy CSS definitions to the main CSS file, so that it is ready for any next use :))
    in .vimrc:
      let html_use_css=1
      let html_no_pre=1  
      let html_use_xhtml=1  
    

You may want automatic syntax highlighting. For that, check the latest python Markdown implementation that add syntax highlighting thanks to pygments.
If you want to stay with discount, the C markdown implementation, here is a way to script Vim syntax highlighting (it is really great, because: the markdown file only contains text (no xhtml code as it would if we were using TOhtml manually) and you can modify the source code, it will always be up to date on the website :)
Take a look at my script: I've added shell script sourcing (that can be a security problem if many users can access the repository !). If a file $WHATEVER_TITLE.sosh exists, it is sourced while html page generation.

To colour a source code in the test.html page, test.md must exist and test.sosh may contains:

    echo ":TOhtml" > /tmp/vim-scriptin
    echo ":wq! /tmp/vim-htmltemp" >> /tmp/vim-scriptin
    echo ":w! /tmp/toto3" >> /tmp/vim-scriptin
    echo ":q!" >> /tmp/vim-scriptin
    vim -N -s /tmp/vim-scriptin Bordel/manage-mail-identities -T xterm > /dev/null
    echo '<div class="code">'
    grep '^<span'  /tmp/vim-htmltemp
    echo '</div>'
  • Setup webserver’s CGI capability for .sh files (for sitemap.sh, 404.sh, and rss.sh) and configure the webserver to use your personnal 404.sh error page

Enjoy, luke !

To modify or add content to the website, all you need to do is to deal with the svn repository (update/add/delete/commit…)
and write mardkdown files (*.md)

Easy, isn’t it ?