When I first started Psyke.org, the site was built and updated by hand using nothing but a text editor. As the site grew this became quite cumbersome — even small design changes or content updates would take too long to be practical.
I considered using a CMS to edit the site, but decided against it for two reasons:
- None of the systems available at the time had the features I was looking for.
- Hosting would be cheaper if the site could run without access to server-side scripting.
This led to the development of my templating system, Yggdrasil. This tool made it easy for me to apply design changes across the site and to add or edit content.
In the following, I will try to describe how the site is built and published.
All the files that make up the site are placed in a directory tree with the same structure as the published site. The two basic file types in the source tree are
.html files only contain tags that can occur between
</body> (view source of this page). I generally only keep one HTML file (
index.html) in each directory of the source. I do this to get nice, clean URLs (e.g. http://www.psyke.org/about/how/ and to make an eventual migration to a full CMS a lot easier.
.tmpl files contain a combination of HTML tags and Perl code snippets. This HTML content of the template files is wrapped around the content of a
.html file. This page is built by wrapping the following templates around the
.html file mentioned above:
- head-section.tmpl (empty)
- nav-category.tmpl (empty)
- sidebar-text.tmpl (empty)
<!-- ignore --> comments found in the templates are used to keep some of the content from being indexed by the local search engine.
After adding or editing text, the following steps are performed:
- The script ylink.pl is used to generate the templates
- Yggdrasil is used to apply templates to the content. Yggdrasil uses SmartyPants to create correct quotes, dashes and ellipsis.
- The site is uploaded to the public web server using either FileZilla or the built-in FTP functionality of Yggdrasil.
- The site is re-indexed by the PerlFect Search script.
To add content to the ‘Pictures’ section of the site, the following steps are performed: