<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Michael Jay Lissner</title><link href="https://michaeljaylissner.com/" rel="alternate"></link><link href="https://michaeljaylissner.com/feeds/tag/meta" rel="self"></link><id>https://michaeljaylissner.com/</id><updated>2014-08-27T00:00:00-07:00</updated><entry><title>New Version of the Site is Now Live</title><link href="https://michaeljaylissner.com/posts/2014/08/27/site-v5-is-go/" rel="alternate"></link><updated>2014-08-27T00:00:00-07:00</updated><author><name>Mike Lissner</name></author><id>tag:michaeljaylissner.com,2014-08-27:posts/2014/08/27/site-v5-is-go/</id><summary type="html">
&lt;p&gt;I have big news today for the small world of people who read my blog regularly:
A new version of the site is now live and the old version shall die a quick death. &lt;/p&gt;
&lt;p&gt;Version 4 was pretty nice though, while it lasted:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Site v4" src="https://michaeljaylissner.com/images/oldsite/v4.png"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Other old versions of the site &lt;a href="https://michaeljaylissner.com/about"&gt;still available&lt;/a&gt;!&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="the-improvements"&gt;The improvements&lt;/h2&gt;
&lt;p&gt;This new version comes with some big improvements that I’m quite 
pleased with:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you find typos in a blog post, you can edit them on Github and I can 
   easily integrate your changes. Check out the link on the right to 
   edit the typos in this very page. (I’ve left a few conspicuous ones as a 
   treasure hunt for the reader!)&lt;/li&gt;
&lt;li&gt;The site is now &lt;em&gt;much&lt;/em&gt; faster and can handle immense traffic without a 
   hitch, thanks to being hosted by &lt;a href="https://pages.github.com/"&gt;Github Pages&lt;/a&gt;. The previous version would
   have occasional hiccups during times of high traffic – something that’s 
   really quite untenable.&lt;/li&gt;
&lt;li&gt;Comments are now moved to &lt;a href="https://disqus.com"&gt;Disqus&lt;/a&gt;, though unfortunately old comments have
   not made the jump to the new version of the blog. Comments are collapsed by 
   default so the scrollbar actually represents the length of a 
   highly-commented post.&lt;/li&gt;
&lt;li&gt;The site now looks bad-ass. Regardless of whether you’re on a phone, tablet
   computer, or what-have-you, it’s going to look good.&lt;/li&gt;
&lt;li&gt;All content has been categorized as well as tagged, as you can see in the 
   sidebar. There are Atom feeds for each.&lt;/li&gt;
&lt;li&gt;The homepage has a new design that focuses on my projects and bio, and then 
   has recent posts below that.&lt;/li&gt;
&lt;li&gt;Long articles like this one get an automatic table of contents on the left.&lt;/li&gt;
&lt;li&gt;The site is now optimized for speed dial in Opera and to be made into apps
   on mobile phones and tablets. For example, if you’re reading this on 
   Android Chrome, you can simply click “Add to homescreen” in the &lt;code&gt;⋮&lt;/code&gt;
   thing and you’ll be all set.&lt;/li&gt;
&lt;li&gt;Security is now invincible: No more webserver to update, no more database, 
   no more outdated Drupal. It’s basically impossible to hack the new site. 
   I’ve also added my &lt;a href="https://michaeljaylissner.com/archive/mike.gpg"&gt;&lt;span class="caps"&gt;PGP&lt;/span&gt; key&lt;/a&gt; to the &lt;a href="https://michaeljaylissner.com/contact"&gt;contact page&lt;/a&gt;, for those interested. &lt;/li&gt;
&lt;li&gt;The entire site is now static and doesn’t require that I pay for or maintain
   a server or database. Bonus!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So those are the high-level changes you can see as of now. If you’re interested
in the technical nitty-gritty, read on.&lt;/p&gt;
&lt;h2 id="the-tech"&gt;The Tech&lt;/h2&gt;
&lt;p&gt;The original motivation to rebuild the site came when the old version kept 
overwhelming the server that was running it and requiring that I step in to 
make it work again. And if that weren’t annoying enough, I have been paying
for that server for the past several years, which just seems a bit silly for
a simple blog like this one. &lt;/p&gt;
&lt;p&gt;The solution? A so-called &lt;a href="http://staticsitegenerators.net/"&gt;Static Site Generator&lt;/a&gt; or &lt;span class="caps"&gt;SSG&lt;/span&gt;. With one of these,
the paradigm for your site totally changes. Instead of having a dynamic site
that loads every time somebody visits the page or makes a comment, you 
generate the &lt;em&gt;entire&lt;/em&gt; website on your laptop (this takes about 30 seconds), 
creating static &lt;span class="caps"&gt;HTML&lt;/span&gt;, and then push that to some cloud provider of choice (in 
my case, I use Github pages for this because it’s free and easy).&lt;/p&gt;
&lt;p&gt;There are about 300 SSGs right now and the one I eventually landed on was 
&lt;a href="https://github.com/getpelican/pelican/"&gt;Pelican&lt;/a&gt; due to it being written in a language I knew (Python), and due to
it having lots of good themes and plugins. I briefly tried to make a switch to
&lt;a href="http://hugo.spf13.com/"&gt;Hugo&lt;/a&gt; instead because it’s written in Go and is much faster at generating 
content, but the documentation for Hugo isn’t very good yet, and &lt;a href="https://github.com/spf13/hugo/issues/96"&gt;it
doesn’t support basic pagination&lt;/a&gt;, which is something of a showstopper. &lt;/p&gt;
&lt;h3 id="switching-to-a-ssg-from-drupal"&gt;Switching to a &lt;span class="caps"&gt;SSG&lt;/span&gt; from Drupal&lt;/h3&gt;
&lt;p&gt;Switching from Drupal was pretty awful and took a &lt;em&gt;lot&lt;/em&gt; of effort — 
&lt;em&gt;days&lt;/em&gt; of it! The goal was to get all of my posts exported from Drupal, 
convert them all to markdown, and to get them all live on Github pages. Let’s 
go through this process together. &lt;/p&gt;
&lt;h3 id="exporting-from-drupal"&gt;Exporting from Drupal&lt;/h3&gt;
&lt;p&gt;This step of the puzzle was, shall we say, a pain. Nobody has yet made a 
Drupal to Pelican converter, so I had to do it myself. &lt;a href="https://michaeljaylissner.com/scripts/drupal_to_hugo.py"&gt;The script&lt;/a&gt; that I 
wrote dug directly into Drupal’s database, pulled out the contents
and converted them to a format that Hugo could understand. At the time I 
thought Hugo would be the &lt;span class="caps"&gt;SSG&lt;/span&gt; for me, but later I switched to Pelican, and had
to write &lt;a href="https://michaeljaylissner.com/scripts/convert_from_hugo_to_pelican.py"&gt;another script&lt;/a&gt; to make the conversion from Hugo to Pelican.&lt;/p&gt;
&lt;h3 id="problems-with-drupal"&gt;Problems with Drupal&lt;/h3&gt;
&lt;p&gt;This was a good start, but Drupal has a few funny conventions. One is that it
allows files to be “attached” to blog posts. Most blogs don’t do this (Pelican
and Hugo included), so I had to go through all of the items that I attached to 
Drupal posts and convert them to inline links instead. This took a while.&lt;/p&gt;
&lt;p&gt;Another problem I ran into is that the posts themselves were written directly 
in &lt;span class="caps"&gt;HTML&lt;/span&gt;, which makes them kind of awful, and not very portable between blog
engines. Content for Hugo or Pelican should be written in Markdown, so I began
making this conversion to the &lt;a href="/archives.html"&gt;200+ posts&lt;/a&gt; on the site. In general, the process
for this was to find a post and begin cleaning it up. If I encountered 
something that a computer could reliably fix across all the posts (for example,
&lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; can be converted to &lt;code&gt;*&lt;/code&gt; and &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; to &lt;code&gt;**&lt;/code&gt;), I wrote a little script 
to do so. In the end, this took a lot of time, but I now have a collection of
a few hundred nicely-formed markdown files that power the blog.&lt;/p&gt;
&lt;h3 id="moving-to-github-pages"&gt;Moving to Github Pages&lt;/h3&gt;
&lt;p&gt;With all of the content converted properly, the remaining step was to get the
project live on Github. I found this process confusing, but the process is 
basically this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You need to take the output file from Pelican and put it into a Git 
branch called &lt;code&gt;gh-pages&lt;/code&gt;. To do this with Pelican is remarkably easy, as there is
a simple command you can run: &lt;code&gt;make github&lt;/code&gt;. Run that, and you’ll be all set,
with the content pushed and everything.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You need &lt;a href="https://github.com/mlissner/michaeljaylissner.com/blob/gh-pages/CNAME"&gt;a file named &lt;span class="caps"&gt;CNAME&lt;/span&gt;&lt;/a&gt; that simply contains the domain of your 
website. This is easy in theory — it’s just a plaintext file — but in 
practice it is difficult because you need the file to be created by the 
&lt;code&gt;make github&lt;/code&gt; command mentioned above. To do that add the &lt;span class="caps"&gt;CNAME&lt;/span&gt; file to a
directory at &lt;code&gt;content/extra/CNAME&lt;/code&gt; and then add the following to your pelican
configuration file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;EXTRA_PATH_METADATA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'extra/CNAME'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'path'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'CNAME'&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;STATIC_PATHS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'extra/CNAME'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Do that, and the file will get copied over whenever you run &lt;code&gt;make github&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you’ve done this correctly, you’ll see evidence of such in the 
repository’s settings page on Github, where it will tell you the domain
in the &lt;span class="caps"&gt;CNAME&lt;/span&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You need to configure your &lt;span class="caps"&gt;DNS&lt;/span&gt; provider to point your domain to Github.
This varies by provider, but I can tell you that your final version should
look something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="err"&gt;↪&lt;/span&gt; &lt;span class="n"&gt;dig&lt;/span&gt; &lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;michaeljaylissner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nostats&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nocomments&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nocmd&lt;/span&gt;

&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;DiG&lt;/span&gt; &lt;span class="mf"&gt;9.9.5&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Ubuntu&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;michaeljaylissner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nostats&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nocomments&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nocmd&lt;/span&gt;
&lt;span class="p"&gt;;;&lt;/span&gt; &lt;span class="n"&gt;global&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;cmd&lt;/span&gt;
&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;michaeljaylissner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;A&lt;/span&gt;
&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;michaeljaylissner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt; &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;CNAME&lt;/span&gt;   &lt;span class="n"&gt;mlissner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;mlissner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;    &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;CNAME&lt;/span&gt;   &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fastly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fastly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;  &lt;span class="mi"&gt;2&lt;/span&gt;   &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;A&lt;/span&gt;   &lt;span class="mf"&gt;199.27.79.133&lt;/span&gt;
&lt;span class="n"&gt;fastly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;     &lt;span class="mi"&gt;66087&lt;/span&gt;   &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;NS&lt;/span&gt;  &lt;span class="n"&gt;ns4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;p04&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dynect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;fastly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;     &lt;span class="mi"&gt;66087&lt;/span&gt;   &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;NS&lt;/span&gt;  &lt;span class="n"&gt;ns3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;p04&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dynect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;fastly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;     &lt;span class="mi"&gt;66087&lt;/span&gt;   &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;NS&lt;/span&gt;  &lt;span class="n"&gt;ns2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;p04&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dynect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;fastly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;     &lt;span class="mi"&gt;66087&lt;/span&gt;   &lt;span class="n"&gt;IN&lt;/span&gt;  &lt;span class="n"&gt;NS&lt;/span&gt;  &lt;span class="n"&gt;ns1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;p04&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dynect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="final-words"&gt;Final Words&lt;/h2&gt;
&lt;p&gt;This is been a much larger undertaking than I expected, with tons of corner
cases that I wanted to fix before releasing a new version of the site. In the 
end though, this has been a good investment that I can expect to keep the site
going for the next five to ten years.&lt;/p&gt;
&lt;p&gt;I hope you enjoy the new look and new features.&lt;/p&gt;</summary><category term="meta"></category><category term="blog"></category><category term="me"></category></entry></feed>