Table of Contents
Techxplorer’s CMS
Techxplorer’s CMS is a small number of PHP scripts and accompanying JavaScript files designed to power a small website such as this one. It has similar design goals to the MultiMarkdown CMS. I decided to develop my own system for three main reasons:
- I wanted to see if I could do it
- I wanted something in PHP as I’m allergic to Perl
- I didn’t need all of the functionality that the MultiMarkdown CMS provides
The source code for Techxplorer’s CMS is available on GitHub.
Capabilities of the CMS
The capabilities of this CMS are limited to those that I’ve needed when building this website. Over time and as the site grows, I’m likely to add additional capabilities. In the current version the CMS can:
- Convert MultiMarkdown source files into HTML files when the md file is newer or there is no corresponding HTML file
- Match the URL of the request to a HTML file in the content directory
- Incorporate the HTML from the file into the website template
- Automatically add a table of contents via JavaScript when required
- Automatically create links from citations to a bibliography when required
- Add an image cycle to a page
- Automatically include page, directory and site specific metadata
You are encouraged to look at the code, which is rather straight forward and includes many comments, to understand how the system works
Components of the CMS
There are three main components to the CMS. The full list of software used by me to build the CMS and manage the content is available on the about this site page.
Build Content Script
The first component is the build content script. This script searches for MultiMarkdown files in the specified content directory and any sub directories. Any file that is newer than the corresponding HTML file, or doesn’t have a corresponding HTML file is converted.
This file is stored outside the web root and shouldn’t be uploaded as part of the website.
The build content script is a PHP script that is designed to be run from the command line and uses the shell script technique. Therefore it will not work on Windows based systems without modification. As I don’t use Windows this isn’t likely to occur.
Rendering Script
The rendering script provides a variety of functions for rendering content. Its primary task is to match the requested URL to a file in the content directory and to incorporate the HTML in the file into the template.
Helper JavaScript
The helper JavaScript uses the jQuery library, and a small number of plugins, to add the finishing touches to the page. This includes an image cycle, as seen on the homepage of this website, and automatically adding a table of contents.
The helper JavaScript will also scan for citations and automatically create links to a bibliography if required. This was most useful when I added my honours thesis, completed in 2011, to this site.
