(Via The Loop.)
One of the last things on my mind when going about the Jekyll transition was preserving my previous URL structure. For years, I have consciously made an effort to both “future-proof” and “prettify” my site’s URLs.
Squarespace threw a wrench in the works. When I was live on SS6, the URL to this blog post would probably look something like:
For the most part, that structure was fine by me, especially because there was little I could do to change it. Squarespace added
blog/ to the beginning of the URL (against my will) to indicate that it came from my blog (gasp), and the rest was organized by my to my liking: year, month, slug.
However, Jekyll would like to produce this instead:
This structure is actually preferable to me; no needless
blog/ prefix, and the leading zeroes in the month slot add some pleasing geekiness and symmetry.
One can imagine my dismay when I realized, upon launching this site, that, despite my best efforts to smooth out every blog post’s slug, previously standing links to the blog threw 404 errors left and right. Why?! Yep, the pesky
blog/ prefix, and the lack of leading zeroes. I had to fix this.
There was no way I was going to add
blog/ back to my URLs just to preserve my old links—blasphemy. After playing with Amazon S3’s redirect features, I whipped up the following routine rule to effective redirect all requests starting with
blog/ to the equivalent URL with out:
<RoutingRules> <RoutingRule> <Condition> <KeyPrefixEquals>blog/</KeyPrefixEquals> </Condition> <Redirect> <ReplaceKeyPrefixWith></ReplaceKeyPrefixWith> <HttpRedirectCode>302</HttpRedirectCode> </Redirect> </RoutingRule> </RoutingRules>
To this day, I haven’t come up with a perfect fix for the (lack of) leading zeroes. Ideally, I’d like to handle this with a large variety of redirects, sending
2015/01/, and so on. However, I’ve yet to figure out how to do this with S3’s routing rules. Instead, my best solution is to simply rewrite my blog’s URL structure to leave out leading zeroes, foregoing prettiness for backwards compatibility.
I accomplished this by modifying the
permalink settings in Jekyll’s
_config.yml file to:
i_month forgoes the leading zeroes; everything else was left unchanged. Obviously, this is somewhat of a quick fix that leaves me unsatisfied, and I’m still searching for ways to preserve my old links while maintaining an ideal URL structure from here on out. If you’ve got an idea, feel free to email me.
This announcement will come as a surprise to no one: obviously, the site is finally live, and is now running on Jekyll.
The entire transition has taken embarassingly long, and was made worse knowing that, having broken my Squarespace site (it turns out the Developer system didn’t play well with SS7), the entire blog was sitting behind a closed curtain, just withering away. With the migration already in full swing, I begrudgingly decided that the Squarespace site was not worth fixing.
As a result, the SS → Jekyll migration is not entirely complete. The process, my thought processes, and what’s left to do will be documented below.
I’ve long wanted to move from Squarespace, for reasons too legion to describe in detail now. Most of it boiled down to simplicity and control; together, they offer peace of mind. Squarespace as a service is unbeatable, and I would still recommend it to 99% of people out there wanting a hosted website. However, I was finding that too many things needed hacking, too many options were taken away from my control, and the laggy backend of SS6 and 7 actually turned me off from blogging at all.
A lot of nerds have made the move to Jekyll and they all seem happy with it. It bills itself as follows:
Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server.
Beautifully simple and low-maintenance. Exactly what I’ve been looking for.
Transitioning from Squarespace to Jekyll wasn’t difficult by any means, though I certainly had to fiddle with a more than a few things along the way. I’m not going to walk through setting up Jekyll; that’s handled in plenty of detail here.
Why Amazon S3 and not Github Pages?
When I first began the transition process, I had every intention of hosting my new site on Github Pages, the free hosting and publishing option by Github. The plus was that I would get to use git, version control, and free hosting. Plus, Github Pages runs Jekyll by default, so compatibility issues would likely be nonexistent.
However, this didn’t work out for one not-so-insignificant reason, which I didn’t put too much thought into right away: my photos. In multiple past lives, my website was both a photographic portfolio and a photoblog, and therefore played host to hundreds of high-quality images whose source files I didn’t want hanging out in a publicy-accessible repo.
There’s something appealing about a low-maintenance, scalable storage system like Amazon S3. Plus, there are a number of command line interfaces that play well with it.
The Jekyll website contains a section on various deployment methods, which is where I found s3_website. It’s a Ruby gem that places a configuration file called
s3_website.yml in your source Jekyll folder, which I then configured to connect with my S3 bucket. After the setup is done, all I have to do is run
s3_website push to push the
_site folder to S3.
Migrating my blog posts from Squarespace to Jekyll was by far the most time-consuming portion of the transition. I first tried exitwp (via Justin Blanton and Sid O’Neill), which broke more times than I could count, despite many attempts at hacking its source code. I eventually settled on this gist by Evan Walsh, which, with a few more modifications, worked perfectly.
The resultant markdown files were not without error; many had forgotten italics or formatting issues, and the majority of the blog posts ended up clumped together in massive chunks of text. As you can imagine, this resulted in the tedious process of going through each post one by one, comparing it to the original copy on Squarespace, and reformatting my entire blog, post by post. Combine that with a full time job and pursuits of graduate school and you might realize why this took so long to finish.
To fully take advantage of the convenience of Jekyll, I would need to fully automate the publishing process. I chose to do this through rake. I ended up placing the following Rakefile in my Jekyll directory:
desc "clean up site" task :clean do rm_rf '_site' FileList['**/*.bak'].clear_exclude.each do |f| rm_f f end end desc "build the site" task :build do sh "jekyll build" end desc "clean, build, then deploy to remote" task :deploy => [ :clean, :build ] do sh "s3_website push" sh "osascript _announce.scpt" end
Basically, the first task erases the
_site directory, the second task runs
jekyll build, which rebuilds the site, and the final task runs the first two, then pushes the site to S3 via s3_website as discussed early. The final line executes a script that I took from Justin Blanton’s post Display notifications when Jekyll-based operations complete, which announces (via Launchbar’s
display in large type command) that the tasks are all completed.
The whole thing runs smoothly and beautifully. I love it.
I had to teach myself quite a bit to construct the site from scratch. Jekyll uses the Liquid templating system, which was foreign to me before a couple of months ago, but otherwise is pretty simple.
For a long time, I toyed with the idea of returning to a traditional sidebar blog layout, à la Shawn Blanc and the like. However, after pondering this, I remembered why cascading single-column layouts are so popular: they work equally well in desktop and mobile layouts. When approaching the site design from a mobile perspective, sticking to my centered layout became a no-brainer.
I might discuss my design thought processes more in depth in another post. For the most part, things haven’t changed: the site is still predominantly off-black on off-white, with blue accents throughout. The font is PT Sans, which is both conservative and humanistic, and, importantly, is free. (Yes, this means goodbye to Avenir, my beloved. The font is not necessarily set; after fiddling for weeks, however, I kept finding myself coming back to PT Sans.) The same could go to the color scheme, which is not yet perfected—you’ll likely see some subtle changes come and go as time passes.
Where are the photos?
Oh yeah, about that… If you click the Photos link in the top navigation bar, you’ll find a page strangely lacking photos. The final step of the migration is extracting all of the media (i.e. photographs) from my current Squarespace site, uploading them to S3, and updating the photo posts to reference the new URLs. As you can imagine, due to the large amount of photos on the old blog, this process will likely take even longer than it did to transfer the text posts.
Until then, all photos (and the associated blog posts) have simply been left out of the blog for the time being. It’s quick and dirty, and exactly the opposite of how I’d like to handle this, but I’m just too anxious to get the blog back up and running in a timely matter.
Besides the aforementioned photo issue, the blog is mostly complete. There are still a few things left that I am aware of:
- The About page is empty, and other pages (Archives, for instance) still need to be created.
- I’m still looking for a good Search implementation for Jekyll. At this point, I might simply end up using Google site search.
- I’m relying on a basic xml feed for RSS, which, in 2015, is kind of lame. I’m split between Feedburner and Feedpress; that is, I know I want Feedpress, but I’m not convinced I want to pay for it.
I’m sure there’s plenty more that I haven’t yet found. If you do decide to go exploring and find something that I might have missed, feel absolutely free to email me or ping me on Twitter so I can fix it.
Thanks for sticking around. Here’s to plenty of writing to come!
For longer than I can remember, I’ve been a loyal user of the Apple’s EarPods, which were infinitely better than the company’s previous generation of earbuds, but were also by all means nothing extraordinary. There was adequate levels of sonic bliss.
However, after doing some research (not nearly as much as I would normally do, for the record) I decided to bite the bullet and purchase something better. I settled on the Shure SE215-CL sound isolating earphones. This decision was based on price, looks, user reviews, and having detachable and replaceable cables.
They arrived today. I’ll be honest: I might send them back.
This guy’s hilarious review is on point:
Yes, the design is initially awkward. Yes, there was a moment when I felt like a lab-monkey, given triangle pegs to put in round holes. Yes, I initiated a contest in my family for who could figure it out the quickest. The current record is 2.75 minutes and one person still can’t figure it out; it goes to show there’s variation as far as personal adjustment to the design. I was right at 4 minutes the first time I put them in.
Really, you all should’ve seen me attempt to get these into and around my ear as recommended by the step-by-step instructions and pictures included in the packaging. I felt like a child and was thisclose to calling up Kristin and asking her to come help me. Now that I have them in my ears, I’m afraid to take them back out for fear of never getting them back in again.
Yes, that’s my biggest complaint, but for a pair of headphones, getting the things into and out of your ear securely should not be so difficult, especially considering that they really to have to be securely in place for sonic bliss to actually take place.
And it does. Oh boy, do these things sound good.
I have a little while to return them, thanks to Amazon and a warranty I bought (cause I’m notorious for breaking nice things.) We’ll see how they fare over the coming couple of weeks. In the meantime, feel free to let me know your suggestions on high quality (yet budget friendly) in-ear noise-cancelling headphones on Twitter or via email.
UPDATE: I took them out and put them back in pretty easily. Furthermore, these thing are @#$%ing sonic heaven. I swear I’m hearing things I’ve never heard before.