ishani.org v.2016

Working with Jekyll

After moving the site to use Jekyll I needed to sort out some process for writing, generating and uploading the static content.

While there is the ultimate goal of getting it sat on a git repo server-side with a magic post-commit hook to do generation and deployment, at the moment I'm playing on Hard Mode by doing it all manually on my Windows desktop.

SyncBack

I use Sublime Text, Abyss X1, SyncBack to do so, like this!

Editing

Sublime Text is my new favorite thing, along with Package Control which opens up a wide array of extensions for the editor.

Package Control

Here are a few that I like so far:

  • MarkdownEditing to add better syntactic preview and highlighting for your posts and pages.
  • Google SpellCheck is really neat; highlight blocks of text and this extensions flings them past Google to correct the spelling and grammar.
  • Base16 .. because I'm fond of the eighties colour scheme!
  • Jekyll for a more complete editing back-end specifically for Jekyll. This adds some really neat shortcuts, including adding posts with the correct boilerplate, managing drafts and so on.

Sublime Jekyll

I have my site defined as a Project which gives a folder view of the content as well as letting me define custom settings for the editing session (required for the Jekyll package above). Don't forget to exclude the the Sublime project files in your _config.yml otherwise they'll end up on the server...

exclude: ['ishani-jekyll.sublime-project', 'ishani-jekyll.sublime-workspace']

Building

I've listed any Jekyll plugins in use on the About page. I have one custom bit of code currently, as there was no way to have links to non-post pages using Liquid tags.

Usually in Jekyll one can use

{% post_url 2010-07-21-name-of-post %}

to generate a valid anchor to the full URL of a given post. However I'm also using the experimental Collections feature which didn't have a similar system in place. I hacked one together, thus (note, specific to 'projects' collections):

eg:

{% page_link About %}

Testing

Aprelium's Abyss X1 is a powerful little web server with minimal overhead and install fuss. I use the serving directory as my Jekyll output path to rapidly preview the results locally.

jekyll build -s ishani-jekyll -d Y:\Abyss\htdocs\

Deployment

We now need to get any changed files synced via FTP, as well as clean out any deleted items so the server-copy matches. This is where SyncBack comes in.

I use SyncBackSE 6 for a bunch of other major backup tasks on my PC and can thoroughly recommend it. It offers the most staggering array of configurable options that - while initially overwhelming - give a level of control I couldn't find in any other product.

For this task, we need two steps. Remember that Jekyll completely wipes out the target directory during generation so that the resulting data doesn't have any left-overs from previous runs. This is great for having perfect data but not so good if you sync directly from your output to your FTP.

Across two runs with no changes, you will still get timestamp changes on every single file, meaning most sync tools - SyncBack included by default - will assume they all need to be uploaded again to the FTP. Switching to comparing file hashes is possible but my server doesn't support hash comparison over FTP.

SyncBack

To solve this, just have a prebuild step that syncs from the Jekyll output directory to a second store. The prebuild step uses hash comparison to only sync the real changes between runs; this directory is then the one used to update the FTP server. Both steps are run as Mirror operations so that the file structure matches exactly.

3 click deployment! .. It'll do for now.