joseph schmitt


The how and why of this website, both for your enjoyment and my future forgetfulness.

This website is built using Kirby and PHP templates via the Kirby API. The content itself is generated by parsing Markdown files using MultiMarkdown. All pages are styled via CSS files that are generated via SASS and the Compass framework. The JavaScript uses jQuery and is combined and minified using UglifyJS.

There are several affordances built into the backend of this website that make it particularly easy to edit from any device almost anywhere in the world with an Internet connection. The entire codebase is located inside a folder in my personal Dropbox account. For security reasons1, this folder is then shared to a second Dropbox account used by my development server. When I make changes to any content or PHP files from any Dropbox-linked device, those changes are synced up to my personal Dropbox account, shared to my server's Dropbox account, downloaded to my dev server's Dropbox directory, symlinked into my dev server's public directory, and then instanty available to be viewed at my dev server's URL.

Since I'm using SASS for my styles and JavaScript minification for my scripts, simply updating the source files will not have those changes reflected on the dev site: they must be compiled to the proper CSS and JavaScript directories. I use the Grunt taskrunner to set up a job that automatically monitors my SASS and JavaScript source files for changes on my server. If changes are detected, Grunt automatically runs the SASS compiler for styles or UglifyJS for scripts and copies them to their respective directories.

What does this all mean? I can continuously run and preview a version of this website from any computer or Internet-connected device, even an iPhone or an iPad, and instantly see those changes reflected live on the Internet. No matter where I am or what I'm doing, I have full control and access over my website.

Since I'm using Git2 as my local source control manager to track changes and history, I figured that was also a good system to use for deploying this site to my production server. I use a technique described by Bob Belderbos that utilizes Git's push system to copy my files to the server. Therefore, once any changes are checked into master, I can simply enter git push web to have my changes pushed to a remote repository on my server, and those files copied to the public directory from which they're served out to all of you!!

  1. It is generally a bad idea to share your entire Dropbox directory to a public-facing server. If an attacker ever gains access to that server, they also gain access to your entire Dropbox directory structure. As a precaution against that, I merely share just my site's folder to a separate account, and that account is publicly on my server. If my server ever gets comporomised, only my website's files will be at risk, not my entire Dropbox account. 

  2. One of the really cool things about using Git is I don't need to make "draft" entries anymore: I simply start a new branch with the entry I'm working on, and once it's done I just merge it into master and push to web.