fix possible XSS
GitHub -> sourcehut
IfModule mod_rewrite.c
CMS verpiss dich,
keiner vermisst dich!
WofFS' Content Machine is a tiny perl CGI which takes a directory tree of Markdown files or shell scripts (or whatever) and turns it into a browsable website.
Setup your web server (apache or lighttpd are recommended), and install perl and markdown, too. On a Debian system:
apt-get install apache2 perl markdown
Download wcm and unpack it in your document root (or whereever you want):
cd /var/www wget http://woffs.de/downloads/wcm-20120410.tar.gz tar xvzf wcm-20120410.tar.gz
Point your browser at http://localhost/wcm-20120410/index.pl
.
If you just see the source code of the perl script, you have to
include something like
<Directory /var/www/wcm-20120410/> AllowOverride All
in your /etc/apache2/sites-available/default
or
whereever your apache config is. Reload config:
/etc/init.d/apache2 reload
Now your browser should display the WCM page. Please drop me a line if this is not the case, so I can update the HOWTO accordingly.
If rewriting works,
you can try http://localhost/wcm-20120410/
, and the links
will be nicer ("/WCM" instead of "/index.pl?page=WCM").
Look at the files under /var/www/wcm-20120410/src/
,
menu and content come from there.
File extensions are
Everything before the first "_" in the filename is ignored. You can use that for menu sorting. If the Filename begins with "0", the File does not show up in the menu (a hidden entry).
You can have subdirectories for submenus. Edit the $menulevel value in index.pl to decide how many levels of submenus are shown for not-selected items. (The submenu of the selected item will always be shown.)
You can use the special filename "index" (or better "0_index" or "00_index", or "00_index.sh" if it is a shell script, etc) to have a directory index.
Within the text and the html template you can use special strings:
http://woffs.de/
in this case)http://woffs.de/
in this case)Only within the html template you can additionally use:
You can (ab)use symlinks to point to another page. A redirection will then be created.
You are invited to have a look at the source code of the main script and to download wcm-20120410.tar.gz including some examples for easy setup.
The Software is Licensed under GNU AGPL.
You can browse the Git repository or get your copy with
git clone git://woffs.de/git/fd/wcm.git
or use sourcehut.
Feel free to contact me.
After discovering that I don't need embedded HTML editors, although I want to enter the content in a readable and writable way; and that I don't need a CMS, although I want automatic menus, I decided to write my own Content Machine.
One weekend in late August 2010 I spent some hours with this, and finally it ended up in ~130 lines of a perl CGI which serves the whole thing. All in one script!
With a little bit of shell magic and pandoc I moved my own Webpage from LightNEasy (which is a really light CMS, but still much more than I need) to my new Content Machine within some hours.