<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="3.7.3">Jekyll</generator><link href="https://ldeck.github.io/atom.xml" rel="self" type="application/atom+xml" /><link href="https://ldeck.github.io/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2018-04-25T05:16:25+00:00</updated><id>https://ldeck.github.io/</id><title type="html">ldeck’s musings</title><subtitle>Random tech musings from downunder.</subtitle><author><name>Lachlan Deck</name></author><entry><title type="html">Personal Blog with Github Pages and Jekyll themes Pt2.</title><link href="https://ldeck.github.io/jekyll/github/general/markdown/2018/04/25/blogging-with-jekyll-pt2.html" rel="alternate" type="text/html" title="Personal Blog with Github Pages and Jekyll themes Pt2." /><published>2018-04-25T03:05:00+00:00</published><updated>2018-04-25T03:05:00+00:00</updated><id>https://ldeck.github.io/jekyll/github/general/markdown/2018/04/25/blogging-with-jekyll-pt2</id><content type="html" xml:base="https://ldeck.github.io/jekyll/github/general/markdown/2018/04/25/blogging-with-jekyll-pt2.html">&lt;p&gt;In &lt;a href=&quot;/jekyll/github/general/markdown/2018/04/14/blogging-with-jekyll-pt1.html&quot;&gt;Part 1&lt;/a&gt; I said that blogging with &lt;a href=&quot;https://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt; and &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; is a popular choice but it could be much simpler.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt; instructions, disappointingly, left us with an &lt;code class=&quot;highlighter-rouge&quot;&gt;index.html&lt;/code&gt; file simply containing the text &lt;code class=&quot;highlighter-rouge&quot;&gt;Hello, World&lt;/code&gt;. As an advanced option that would be great, but but I’d hoped for a markdown-based blog site out of the box.&lt;/p&gt;

&lt;h2 id=&quot;jekylls-prerequisites&quot;&gt;Jekyll’s Prerequisites&lt;/h2&gt;

&lt;p&gt;As it turns out Jekyll’s &lt;a href=&quot;https://jekyllrb.com/docs/quickstart/&quot;&gt;Quickstart Guide&lt;/a&gt; assumes you have a ruby development environment already.&lt;/p&gt;

&lt;p&gt;See my &lt;a href=&quot;/ruby/development/2018/04/25/ruby-development-environment-quickstart.html&quot;&gt;Ruby development environment quickstart guide&lt;/a&gt; to fulfil that requirement for macOS.&lt;/p&gt;

&lt;p&gt;Jekyll’s &lt;a href=&quot;https://jekyllrb.com/docs/installation/&quot;&gt;installation&lt;/a&gt; documentation is otherwise helpful for various platforms.&lt;/p&gt;

&lt;h2 id=&quot;installing-jekyll&quot;&gt;Installing Jekyll&lt;/h2&gt;

&lt;p&gt;As Jekyll’s &lt;a href=&quot;https://jekyllrb.com/docs/installation/&quot;&gt;installation&lt;/a&gt; documentation suggests we install both &lt;code class=&quot;highlighter-rouge&quot;&gt;bundler&lt;/code&gt; to manage plugins and themes along with jekyll itself.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gem install bundler jekyll
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In part 3, we’ll use look at theming jekyll.&lt;/p&gt;

&lt;p&gt;You can also now refer again to Jekyll’s &lt;a href=&quot;https://jekyllrb.com/docs/quickstart/&quot;&gt;quickstart guide&lt;/a&gt;, it’s basic &lt;a href=&quot;https://jekyllrb.com/docs/usage/&quot;&gt;usage&lt;/a&gt; and various &lt;a href=&quot;https://jekyllrb.com/docs/home/&quot;&gt;docs&lt;/a&gt;.&lt;/p&gt;</content><author><name>Lachlan Deck</name></author><summary type="html">In Part 1 I said that blogging with GitHub Pages and Jekyll is a popular choice but it could be much simpler.</summary></entry><entry><title type="html">Ruby development environment quickstart guide</title><link href="https://ldeck.github.io/ruby/development/2018/04/25/ruby-development-environment-quickstart.html" rel="alternate" type="text/html" title="Ruby development environment quickstart guide" /><published>2018-04-25T01:00:00+00:00</published><updated>2018-04-25T01:00:00+00:00</updated><id>https://ldeck.github.io/ruby/development/2018/04/25/ruby-development-environment-quickstart</id><content type="html" xml:base="https://ldeck.github.io/ruby/development/2018/04/25/ruby-development-environment-quickstart.html">&lt;p&gt;Sandboxing ruby projects from external changes is imho the sensible choice.&lt;/p&gt;

&lt;p&gt;This is true, of course, for any development environment. It’s quite frustrating to come back to a project after some time and find it broken because it depended on a particular system configuration that just worked at the time.&lt;/p&gt;

&lt;p&gt;One of the underlying remedies for ruby is to use a &lt;a href=&quot;https://blog.metova.com/choosing-a-ruby-version-management-tool&quot;&gt;ruby version manager&lt;/a&gt; like &lt;a href=&quot;https://github.com/rbenv/rbenv&quot;&gt;rbenv&lt;/a&gt;. So on macOS the following will do the trick.&lt;/p&gt;

&lt;h3 id=&quot;step-1-install-rbenv-with-ruby-build&quot;&gt;Step 1. Install rbenv with ruby-build&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew install rbenv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-2-initialise-your-shell-with-rbenv&quot;&gt;Step 2. Initialise your shell with rbenv&lt;/h3&gt;

&lt;p&gt;I use &lt;a href=&quot;https://github.com/Bash-it/bash-it&quot;&gt;bash-it&lt;/a&gt;, thus&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bash-it enable plugin rbenv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But, it is otherwise achieved via rbenv:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Run this and follow the instructions to set up rbenv integration with your shell
rbenv init
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-3-verify-rbenv-is-setup&quot;&gt;Step 3. Verify rbenv is setup&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# assume we've opened a new terminal
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-4-install-recent-ruby&quot;&gt;Step 4. Install recent ruby&lt;/h3&gt;

&lt;p&gt;Now install a ruby version via rbenv.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# list the most recent stable version:
rbenv install -l | grep -E '^\s*[0-9\.]+$' | tail -n 1

# install that ruby version globally. e.g.,
rbenv install 2.5.1
rbenv global 2.5.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;step-5-project-initialisation&quot;&gt;Step 5. Project initialisation&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# init project dir and cd into it
mkdir my-new-project
cd $_

# init .ruby-version
rbenv local 2.5.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;An alternative / complementary solution, I use &lt;a href=&quot;https://direnv.net&quot;&gt;direnv&lt;/a&gt;. See &lt;a href=&quot;https://github.com/direnv/direnv/wiki/Ruby&quot;&gt;direnv’s ruby wiki page&lt;/a&gt; for further tips.&lt;/p&gt;</content><author><name>Lachlan Deck</name></author><summary type="html">Sandboxing ruby projects from external changes is imho the sensible choice.</summary></entry><entry><title type="html">Personal Blog with Github Pages and Jekyll themes Pt1.</title><link href="https://ldeck.github.io/jekyll/github/general/markdown/2018/04/14/blogging-with-jekyll-pt1.html" rel="alternate" type="text/html" title="Personal Blog with Github Pages and Jekyll themes Pt1." /><published>2018-04-14T00:20:00+00:00</published><updated>2018-04-14T00:20:00+00:00</updated><id>https://ldeck.github.io/jekyll/github/general/markdown/2018/04/14/blogging-with-jekyll-pt1</id><content type="html" xml:base="https://ldeck.github.io/jekyll/github/general/markdown/2018/04/14/blogging-with-jekyll-pt1.html">&lt;p&gt;Getting started with &lt;a href=&quot;https://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt; is fairly straightforward if all you want is plain text on a white canvas.&lt;/p&gt;

&lt;p&gt;To setup a markdown based blog, however, jekyll is a popular option.&lt;/p&gt;

&lt;h2 id=&quot;the-good&quot;&gt;The Good.&lt;/h2&gt;

&lt;p&gt;Jekyll has promise.&lt;/p&gt;

&lt;p&gt;Why give Jekyll a go? My thinking was…&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;It’s suggested by GitHub.&lt;/li&gt;
  &lt;li&gt;It has lots of community contributed themes.&lt;/li&gt;
  &lt;li&gt;Both of these should save me time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The end result is that it’s simple to create blog posts: create a &lt;strong&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;YYYY-MM-DD-name-of-post.markdown&lt;/code&gt;&lt;/strong&gt; file in your &lt;code class=&quot;highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory, commit and push.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;---
layout: post
title:  &quot;Welcome to Jekyll!&quot;
date:   2018-04-14 11:10:16 +1100
categories: jekyll update
---
Create this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;the-bad&quot;&gt;The Bad.&lt;/h2&gt;

&lt;p&gt;The Jekyll docs are verbose from the start.&lt;/p&gt;

&lt;p&gt;Too much reading is given to fine-grained options, reading more like man pages, with all the options up front and any examples, if any, buried at the end.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://jekyllrb.com/docs/quickstart/&quot;&gt;Quick Start Guide&lt;/a&gt;, ironically not linked to from Jekyll’s homepage, ends with a section called &lt;strong&gt;Next Steps&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Building a Jekyll site with the default theme is just the first step.
The real magic happens when you start creating blog posts,
using the front matter to control templates and layouts,
and taking advantage of all the awesome configuration options Jekyll makes available.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is exactly what we want to do, but there’s no link to the relevant instructions for doing this; the next button takes you instead to &lt;code class=&quot;highlighter-rouge&quot;&gt;Installation&lt;/code&gt;, which presumably you’ve already done if you managed to get through the &lt;em&gt;Quick Start Guide&lt;/em&gt;, right?&lt;/p&gt;

&lt;h2 id=&quot;lets-fix-that&quot;&gt;Let’s Fix That.&lt;/h2&gt;

&lt;p&gt;Providing a step-by-step guide beyond generating “Hello, World!” would have been easy. It could go something like this:&lt;/p&gt;

&lt;p&gt;Perform the initial steps provided by &lt;a href=&quot;https://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt;. i.e.,&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create a repository called &lt;em&gt;yourusername&lt;/em&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;.github.io&lt;/code&gt; &lt;a href=&quot;https://github.com/new&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Clone your new repository to a local directory as &lt;a href=&quot;https://help.github.com/articles/cloning-a-repository/&quot;&gt;GitHub describes&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Generate a Jekyll blog site (see part 2).&lt;/li&gt;
  &lt;li&gt;Generate and write a blog post (see part 2).&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Commit and push.&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git add &lt;span class=&quot;nt&quot;&gt;--all&lt;/span&gt;
 &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git commit &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;My initial blog site&quot;&lt;/span&gt;
 &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;View your handy work at https://&lt;em&gt;yourusername&lt;/em&gt;.github.io.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Well, in &lt;a href=&quot;/jekyll/github/general/markdown/2018/04/25/blogging-with-jekyll-pt2.html&quot;&gt;part 2&lt;/a&gt; we’ll move towards getting jekyll up and running.&lt;/p&gt;</content><author><name>Lachlan Deck</name></author><summary type="html">Getting started with GitHub Pages is fairly straightforward if all you want is plain text on a white canvas.</summary></entry></feed>