Ghost - An Overview

Ghost - An Overview

While I'd already done enough digging around to know that Ghost would be a good platform to migrate to, there were nevertheless a few things that caught me by surprise. One moderately miffing me, the others for the better.

Migration

This was the big win. One could kindof get content exported out of wordpress in preparation for Joomla, and ditto Drupal, the latter has convergence issues, and while the backend has some fantastic ideas, the infrastructure is not turnkey for individuals who just want something that works. Given what I'm about to write, that is a higher bar than you think.

So. Ghost had just updated to version 2. While the Ghost foundation also maintains the WP export plugin, that had not been updated yet. As a result, the data export format wasn't compatible with the new instance I'd set up. Well, my testing had been dune in 1.x via prefab containers, so it wasn't that big of a deal to spin one up to import the data.

The WP data exported out as a JSON file, with titles, authors, content, etc. wrapped up in the data structure. Getting the images re-pathed for the new content directory was more challenging than expected because both BBEdit and Sublime choked on the large document when I told it to do a grep find and replace. I ended up using the guide at Ghost for beginners and executing the recommended sed command. Incidentally, those guides, more than the ones at digital ocean, were invaluable. A relative newbie who can get around an FTP app could follow the directions if they weren't insisting on installing to a linux instance from scratch and setting up remote keyed ssh access/etc.

I also have to give some props to Digital Ocean. Easy to spin up instances, even prefab ghost containers - but they do need to update the docs as the versions are sufficiently far behind that extra steps are needed. Fortunately the ghost dev team documents the crap out of everything, especially the installation/udpate scripts, which helpfully told you exactly how to jump past the unforseen hurdles. It also does an excellent job of setting Nginx up as needed - though I had to do some digging to redirect "www" traffic to the root domain name, AND to setup a valid SSL key (basically ran ghost-setup for thelastredount.com and www.thelastredoubt.com to generate and place the keys/nginx files, then redirected the www traffic, key references intact, to the root domain).

So I scp'd the images down to the final VM, imported the data into a droplet, upgraded the droplet to 2.x and exported it, imported it into the new VM, and I was up and running.

The data came over fairly clean. WP left a bunch of <div> tags that caused formatting issues in a small but significant percentage of posts, so I'm going through to clean up that and similar issues. There were some quirks in previous instagram embeds that broke on export, but getting the original posts where they still existed and generating a new embed was easy. Youtube embeds worked out of the box where the videos still exist.

After that it was mostly finding and choosing a theme, doing the brute-force formatting cleanup, establishing a backup routine, etc., but my blog was moved.

As a note - my host provides reasonably priced hosting and has, as recommended by several friends, been fairly resistant to kicking people off for "wrongthink". I'll be exploring where else to park DNS services though because, with no ability to set time to live for the record entries, it took hours after the cutover for the new version to be consistently "alive".

Editing

The default editor is no longer plain markdown. If you simply start typing it's plain font text. Keyboard shortcuts for bold, etc., are available, and selecting text allows you to apply bold, italics, links, or make something a blockquote via a popup menu. Clean, simple elegant, but not my preferred method. I understand why they moved away from "markdown as default" - why have people learn new stuff - but a larger percentage of the user base is coders anyway. That said it is clean, simple, and doesn't confuse you with options to do 50 different things.

Clicking the "+" to the left gets you options to drop in a block of HTML, Markdown, a divider, or an image. It also gives you an embed block for Youtube, Instagram, etc., simply by pasting in the relevant URL. These aren't blocks like the new Gutenberg WP editor where every paragraph is a block, but instead "long chunk of text, followed by an image/embed, followed by more text"

You can of course simply insert image references directly into the markdown, and if you need a specific HTML tag or style or class (like floating an image left), even add a raw HTML tag with relevant formatting, without using blocks at all. I've simply pasted in the updated instagram embed codes into markdown with no issues.

Images can be drag and dropped into the markdown, HTML, or image blocks. You can set a header image easily via the gear icon in the upper left, which also allows you to set a specific URL, excerpt text, tags, authors, metadata for the individual post for SEO, code injection for the specific post (above and beyond the sitewide code injection if you set any), and whether it should be a static "page".

Easy, clean, elegant.

Management

My only two complaints are no ability to easily fetch previous graphics or images via a gallery, and no ability to bulk-select posts to tag/manage them. It's otherwise simple and clean, with the features needed. It doesn't try to be a theme editor, though it will allow you to pick between available themes. There's only one navigation menu and you just work with a drag and drop list of menu item names and the URL's they point to.

Tweaking

I mentioned earlier that you can provide custom HTML and javascript / CSS code in the header and footer of any individual post. You can do this sitewide to add a feature (code hilighting, forex) as well. Last but not least, the template and theme system exists in that happy medium that Wordpress existed in at one point in its past. In this case, using a templating system that many developers use to break out sections of the page to separate files for the header, footer, etc. Anyone with an OK understanding of HTML can do as I did for this theme and go into teh footer to excise out unneeded social media icons (or add a couple), or modify the copyright text. I added the infogalactic and blogroll links on the right by inserting the following html code in place of the placeholder banner:

<section class="widget widget-text">
<h2 class="widget-title">{{t "Friends of {blogtitle}" blogtitle=@blog.title}}</h2>
  <ul>
    <li><a href="http://www.castaliahouse.com/">Castalia House Publishing</a></li>
    <li><a href="http://www.scifiwright.com/">John C Wright</a></li>
    <li><a href="http://bayourenaissanceman.blogspot.com/">Bayou Renaissance Man</a></li>
    <li><a href="http://monsterhunternation.com/">Monster Hunter Nation</a></li>
    <li><a href="http://www.brianniemeier.com/">Brian Niemeier </a></li>
    <li><a href="https://www.nickcolebooks.com/">Nick Cole</a></li>
    <li><a href="http://jonmollison.com/">Jon Mollison</a></li>
    <li><a href="http://voxday.blogspot.com/">Vox Populi</a></li>
    <li><a href="http://esr.ibiblio.org/">Armed and Dangerous</a></li>
    <li><a href="https://jeffro.wordpress.com/">Jefro&#8217;s Space Gaming Blog</a></li>
    <li><a href="http://didactsreach.blogspot.com/">Didact&#8217;s Reach</a></li>
    <li><a href="https://freedomainradio.com/">Free Domain Radio</a></li>
    <li><a href="https://www.youtube.com/channel/UCC3L8QaxqEGUiBC252GHy3w">Stefan Molyneux Youtube</a></li>
    <li><a href="https://www.menofthewest.net/">Men of the West</a></li>
    <li><a href="https://www.dangerous.com/">Dangerous (Milo)</a></li>
    <li><a href="https://qcurtius.com/">Quintus Curtius</a></li>
    <li><a href="http://www.staresattheworld.com/">Stares at the World</a></li>
    <li><a href="https://www.youtube.com/channel/UCQeWZ0ninG-2pzlaenh2ECw">The Rageaholic</a></li>
    <li><a href="https://bradfordcwalker.blogspot.com/">Walker&#8217;s Retreat</a></li>
    <li><a href="http://empiresmustfall.blogspot.com/">Empires Must Fall</a></li>
    <li><a href="http://wastelandandsky.blogspot.com/">Wasteland and Sky</a></li>
  </ul>
</section><!-- .widget -->

I kept the first and last lines that defined the "widget" block, and modified the second line to swap in the text "Friends of" instead of "About". I excised everything else and included the list. I did something similar for the Infoglactic banner. I'm free to add any small blocks of HTML will fit in the sidebar without the wonkiness I've seen from trying the same in Wordpress which can react badly to insertions at times. Not adding amazon or other ads though.

Incidentally, since there's no UI I can go to to edit the blogroll or other similar tweaks - a plus given the above observed wonkiness - I decided to try something else geeky, and created an online private git repository for my theme (no, not at github) and cloned up my changes. I can work on the edits locally instead of ssh'ing into the the VM to run vim/etc., even test them on a local docker container running ghost, push them out. When I want to apply them I log in, do a git pull, and restart the ghost blog.

You can export out the content of the blog from the UI, as well as - most of the time - duplicate the image contents without stopping anything, but backing up the actual blog engine files and settings does require shutting down the blog for the more extensive backup, or at minimum restarting it to refresh the list of themes (or changes to them). It's not needed for switching to a different known theme, so perhaps a theme can be reloaded by switching back and forth, but I don't expect to do a lot of theme modifications in realtime.

About Last Redoubt

Ex nuke mechanic, jack of all trades.