<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.5">Jekyll</generator><link href="https://www.hadji.co/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.hadji.co/" rel="alternate" type="text/html" /><updated>2024-02-24T14:51:24+00:00</updated><id>https://www.hadji.co/feed.xml</id><title type="html">Antonios Hadjigeorgalis</title><subtitle>Engineer+Entrepreneur&lt;/br&gt; Constantly improving everything I touch:&lt;/br&gt; Technology solutions, business strategy, cognitive &amp; physical performance
</subtitle><entry><title type="html">Operator Precedence of Computer Languages</title><link href="https://www.hadji.co/operator-precedence/" rel="alternate" type="text/html" title="Operator Precedence of Computer Languages" /><published>2019-11-28T10:08:36+00:00</published><updated>2019-11-28T10:08:36+00:00</updated><id>https://www.hadji.co/operator-precedence</id><content type="html" xml:base="https://www.hadji.co/operator-precedence/"><![CDATA[<p>This post is a holding place for references to operator precedence in various computer languages.</p>

<h2 id="c"><a href="https://en.cppreference.com/w/c/language/operator_precedence">C</a></h2>

<h2 id="c-1"><a href="https://en.cppreference.com/w/cpp/language/operator_precedence">C++</a></h2>

<h2 id="python"><a href="https://docs.python.org/3/reference/expressions.html#operator-precedence">Python</a></h2>

<h2 id="go"><a href="https://golang.org/ref/spec#Operator_precedence">Go</a></h2>]]></content><author><name></name></author><category term="technology" /><category term="compsci" /><summary type="html"><![CDATA[This post is a holding place for references to operator precedence in various computer languages.]]></summary></entry><entry><title type="html">Keto Sour Cream Showdown</title><link href="https://www.hadji.co/keto-sour-cream/" rel="alternate" type="text/html" title="Keto Sour Cream Showdown" /><published>2018-08-02T18:34:51+00:00</published><updated>2018-08-02T18:34:51+00:00</updated><id>https://www.hadji.co/keto-sour-cream</id><content type="html" xml:base="https://www.hadji.co/keto-sour-cream/"><![CDATA[<p>I am switching up my diet to experiment with prolonged ketosis.  First question, how to add a significant quantity of fat without carbs and extra protein.  Today, I review sour cream.</p>

<table class="table table-hover table-bordered">
  <thead>
    <tr>
      <th>Product</th>
      <th>Total Fat in container</th>
      <th>Price</th>
      <th>$/g fat</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="https://photos.google.com/share/AF1QipN5qVN6gbzbXH4t_ELQ88fmwxdHKpyEuvcfRuklzW6YFV9VzPdvwx1dF_77cDUmpA?key=VjZoQW5jR09RNjFWX1pTZWNxaWV0bVFUaFNTQm53">Green Valley Organics Lactose Free</a></td>
      <td>340g / 30g * 9g = 102g</td>
      <td>$4.49</td>
      <td>$0.04401</td>
    </tr>
    <tr>
      <td><a href="https://photos.google.com/share/AF1QipNiCaNBrwZ_fSt-Su_74q-LVFD1FkwIDvq9Dnz-fAwLSA4w1IkvhSihzFOChLxl5g?key=YzNzSXFsZjhtQUYycXN1VGZXUUwxSUVmT1NvVk9R">Snowville Creamery Creme Fraiche</a></td>
      <td>336g / 30g * 11g = 123.2g</td>
      <td>$5.99</td>
      <td>$0.04862</td>
    </tr>
    <tr>
      <td><a href="https://photos.google.com/share/AF1QipO11SvHEw1wtqUQaAi2-nY2wcKb2E1d35UvMZBCMta_fl_y6LrghStjK4PjZughWw?key=Z1JJbVBWcnNXamFVaEFvd2x6eTVnR2VsQV85cVJn">Wallaby Organic</a></td>
      <td>454g / 30g * 10g = 151.333g</td>
      <td>$4.69</td>
      <td>$0.03099</td>
    </tr>
  </tbody>
</table>

<p><br /></p>

<p>Hands down, the winner by taste was Green Valley Organics.  The lactose free part sounds great.  However, it appears to come at a cost of less Vitamin A.  This product shows 4% RDA for Vitamin A versus 8% for the other two.</p>

<p>The lowest cost, and also tasty, product was Wallaby Organic.  This one says it contains 2g of carbs compared to 1g for the others.  Unfortunately these numbers are alllowed to be rounded in weird ways so I’m not going to be too worried about the difference here.</p>

<p>If you know you like butterfat, the Snowville brand claims 36% butterfat on the lid.  And it is also yellow in color instead of white.  It was quite tasty as well.</p>

<p>I learned this week that too much protein can raise blood sugar levels and prevent ketosis.  Adding sour cream to my diet should help me reduce the amount of protein I consume.</p>

<p>My target macro-nutrient levels are:</p>

<table>
  <thead>
    <tr>
      <th>Category</th>
      <th>Quantity</th>
      <th>Percent</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Carbs:</td>
      <td>20g</td>
      <td>4.3%</td>
    </tr>
    <tr>
      <td>Protein:</td>
      <td>128g</td>
      <td>27.5%</td>
    </tr>
    <tr>
      <td>Fat:</td>
      <td>141g</td>
      <td>68.2%</td>
    </tr>
  </tbody>
</table>

<p><br />
The goal is to plan out my meals in such a way that I don’t have to count macro nutrient levels for everything I eat.</p>

<script>
window.onload = function () {
    // console.log( 'ready!' )
    let nodelist = document.getElementsByTagName('thead')
    for (let elem of nodelist) {
        elem.classList.add('thead-light')
    }
    // console.log( 'finished')
}
</script>]]></content><author><name></name></author><category term="food," /><category term="physical" /><category term="keto," /><category term="cheese" /><summary type="html"><![CDATA[I am switching up my diet to experiment with prolonged ketosis. First question, how to add a significant quantity of fat without carbs and extra protein. Today, I review sour cream.]]></summary></entry><entry><title type="html">Change Gnome Terminal Colors by Time of Day</title><link href="https://www.hadji.co/switch-terminal-colors-at-night/" rel="alternate" type="text/html" title="Change Gnome Terminal Colors by Time of Day" /><published>2016-11-30T16:08:00+00:00</published><updated>2016-11-30T16:08:00+00:00</updated><id>https://www.hadji.co/switch-terminal-colors-at-night</id><content type="html" xml:base="https://www.hadji.co/switch-terminal-colors-at-night/"><![CDATA[<p>As of Ubuntu 16.04 (maybe earlier) the Gnome Terminal has built in support for <a href="http://ethanschoonover.com/solarized">Solarized</a> Dark and Light themes.  I also run <a href="http://jonls.dk/redshift/">Redshift</a> on my machine to reduce the blue light that can interfere with sleep. (<a href="https://justgetflux.com/">f.lux</a> is another popular app for the same purpose).</p>

<p>I typically use Solarized Dark during the day.  However, when Redshift starts working in the evening, the screen gets very difficult to see.  I had been using a <a href="https://gist.github.com/codeforkjeff/1397104#file-solarize-sh">bash script</a> in combination with <code class="language-plaintext highlighter-rouge">.bashrc</code> to change the colors of the default profile.  This stopped working when I updated to Ubuntu 16.04.  So it was back to roughing it, and making the change manually until I found another <a href="https://github.com/Anthony25/gnome-terminal-colors-solarized">Gnome terminal solarized script</a> to script this change.</p>

<p>However, I ran into another problem with this script.  It would not run correctly from cron since it uses <code class="language-plaintext highlighter-rouge">dconf</code> (on Ubuntu 16.04) and the <code class="language-plaintext highlighter-rouge">$DBUS_SESSION_BUS_ADDRESS</code> is not available in the limited cron environment.</p>

<p>I finally found this great <a href="http://stackoverflow.com/questions/10374520/gsettings-with-cron/19666729#19666729">answer on stackoverflow</a> that explain how to get a correct <code class="language-plaintext highlighter-rouge">$DBUS_SESSION_BUS_ADDRESS</code> with cron enviroment.  I then created the following short script to change the only three parameters that I care about, <code class="language-plaintext highlighter-rouge">background-color</code>, <code class="language-plaintext highlighter-rouge">foreground-color</code>, and <code class="language-plaintext highlighter-rouge">bold-color</code> in my Default profile.</p>

<p>The first three lines are the important part for getting the script to run from cron.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
<span class="c">#!/bin/bash</span>
<span class="c"># inspired by https://github.com/Anthony25/gnome-terminal-colors-solarized</span>
<span class="c"># cron script to switch terminal colors in the evening</span>

<span class="c"># Set up environment if necessary</span>
<span class="nb">export </span><span class="nv">DISPLAY</span><span class="o">=</span>:0
<span class="c"># -z True if the length of string is zero.</span>
<span class="k">if</span> <span class="o">[</span> <span class="nt">-z</span> <span class="nv">$DBUS_SESSION_BUS_ADDRESS</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
  <span class="c"># http://stackoverflow.com/questions/10374520/gsettings-with-cron</span>
  <span class="nv">PID</span><span class="o">=</span><span class="si">$(</span>pgrep gnome-session<span class="si">)</span>
  <span class="nb">export </span><span class="nv">DBUS_SESSION_BUS_ADDRESS</span><span class="o">=</span><span class="si">$(</span><span class="nb">grep</span> <span class="nt">-z</span> DBUS_SESSION_BUS_ADDRESS /proc/<span class="nv">$PID</span>/environ|cut <span class="nt">-d</span><span class="o">=</span> <span class="nt">-f2-</span><span class="si">)</span>
<span class="k">fi</span>
<span class="o">[</span> <span class="nt">-z</span> <span class="nv">$DBUS_SESSION_BUS_ADDRESS</span> <span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="nb">exit</span>

<span class="c"># http://ethanschoonover.com/solarized</span>
<span class="c"># light</span>
<span class="nv">base3</span><span class="o">=</span><span class="s1">'#fdfdf6f6e3e3'</span>  <span class="c"># background</span>
<span class="nv">base00</span><span class="o">=</span><span class="s1">'#65657b7b8383'</span> <span class="c"># body text/default code/primary content</span>
<span class="nv">base01</span><span class="o">=</span><span class="s1">'#58586e6e7575'</span> <span class="c"># optional emphasized content</span>
<span class="c"># dark</span>
<span class="nv">base03</span><span class="o">=</span><span class="s1">'#00002b2b3636'</span> <span class="c"># background</span>
<span class="nv">base0</span><span class="o">=</span><span class="s1">'#838394949696'</span>  <span class="c"># body text/default code/primary content</span>
<span class="nv">base1</span><span class="o">=</span><span class="s1">'#9393a1a1a1a1'</span>  <span class="c"># optional emphasized content</span>

<span class="nv">profile_id</span><span class="o">=</span><span class="s2">"</span><span class="si">$(</span>dconf <span class="nb">read</span> /org/gnome/terminal/legacy/profiles:/default|sed s/<span class="se">\'</span>//g<span class="si">)</span><span class="s2">"</span>
<span class="c"># echo $profile_id &gt;&gt; /home/antonios/terminal-color.log</span>
<span class="c"># http://www.tldp.org/LDP/abs/html/functions.html</span>
set_dark<span class="o">()</span> <span class="o">{</span>
  dconf write /org/gnome/terminal/legacy/profiles:/:<span class="nv">$profile_id</span>/background-color <span class="s2">"'</span><span class="nv">$base03</span><span class="s2">'"</span>
  dconf write /org/gnome/terminal/legacy/profiles:/:<span class="nv">$profile_id</span>/foreground-color <span class="s2">"'</span><span class="nv">$base0</span><span class="s2">'"</span>
  dconf write /org/gnome/terminal/legacy/profiles:/:<span class="nv">$profile_id</span>/bold-color <span class="s2">"'</span><span class="nv">$base1</span><span class="s2">'"</span>
<span class="o">}</span>

set_light<span class="o">()</span> <span class="o">{</span>
  dconf write /org/gnome/terminal/legacy/profiles:/:<span class="nv">$profile_id</span>/background-color <span class="s2">"'</span><span class="nv">$base3</span><span class="s2">'"</span>
  dconf write /org/gnome/terminal/legacy/profiles:/:<span class="nv">$profile_id</span>/foreground-color <span class="s2">"'</span><span class="nv">$base00</span><span class="s2">'"</span>
  dconf write /org/gnome/terminal/legacy/profiles:/:<span class="nv">$profile_id</span>/bold-color <span class="s2">"'</span><span class="nv">$base01</span><span class="s2">'"</span>
<span class="o">}</span>

<span class="c"># http://www.tldp.org/LDP/abs/html/comparison-ops.html</span>
<span class="c"># quotes needed here, otherwise error when no arguments</span>
<span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"light"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
  </span>set_light
<span class="k">elif</span> <span class="o">[</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"dark"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
  </span>set_dark
<span class="k">else</span>
  <span class="c"># http://www.tldp.org/LDP/abs/html/quotingvar.html</span>
  <span class="c"># quotes not needed in this case, because value will always be single word (number)</span>
  <span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="si">$(</span><span class="nb">date</span> +%H<span class="si">)</span><span class="s2">"</span> <span class="nt">-ge</span> 17 <span class="o">]</span><span class="p">;</span> <span class="k">then
    </span>set_light
  <span class="k">else
    </span>set_dark
  <span class="k">fi
fi</span>
</code></pre></div></div>
<p><a href="https://github.com/AntoniosHadji/dotfiles/blob/master/term-color.sh">This file on Github</a></p>

<p>I then added the following line via <code class="language-plaintext highlighter-rouge">crontab -e</code></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>0 17 <span class="k">*</span> <span class="k">*</span> <span class="k">*</span> ~/dotfiles/term-color.sh light
</code></pre></div></div>

<p>This setup switches all open terminals from dark to light at 5 pm.  This has the added benefit of being a reminder to wrap up my work day when the screen turns to the light color scheme.  This only works while I am logged in.  That is perfectly OK since I only need the switch when I am on my computer.  I also run this script when I login to make sure that the terminal is the correct color for the time of day.  That part is set up in the graphical Startup Applications app in Ubuntu.</p>

<p>One more step is required for this to work correctly in Vim solarized colorscheme.  Both Neovim and Vim8 support timers so this code will work for either.
I added these lines to my <code class="language-plaintext highlighter-rouge">.vimrc</code>:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">colorscheme</span> solarized

<span class="k">let</span> hour <span class="p">=</span> <span class="nb">strftime</span><span class="p">(</span><span class="s2">"%H"</span><span class="p">)</span>
<span class="k">if</span> hour <span class="p">&gt;=</span> <span class="m">17</span>
  <span class="k">set</span> <span class="nb">background</span><span class="p">=</span><span class="nb">light</span>
<span class="k">else</span>
  <span class="k">set</span> <span class="nb">background</span><span class="p">=</span><span class="nb">dark</span>
<span class="k">endif</span>

<span class="k">if</span> hour <span class="p">&lt;</span> <span class="m">17</span>
  <span class="k">let</span> minute <span class="p">=</span> <span class="nb">strftime</span><span class="p">(</span><span class="s2">"%M"</span><span class="p">)</span>
  <span class="k">let</span> second <span class="p">=</span> <span class="nb">strftime</span><span class="p">(</span><span class="s2">"%S"</span><span class="p">)</span>
  func ColorHandler<span class="p">(</span>timer<span class="p">)</span>
    <span class="k">set</span> <span class="nb">background</span><span class="p">=</span><span class="nb">light</span>
  <span class="k">endfunction</span>
  <span class="k">let</span> <span class="k">t</span> <span class="p">=</span> <span class="nb">timer_start</span><span class="p">(((</span><span class="m">17</span><span class="p">-</span>hour<span class="p">)</span>*<span class="m">60</span>*<span class="m">60</span><span class="p">-</span>minute*<span class="m">60</span><span class="p">-</span>second<span class="p">)</span>*<span class="m">1000</span><span class="p">,</span> <span class="s1">'ColorHandler'</span><span class="p">)</span>
<span class="k">endif</span>
</code></pre></div></div>

<p>You may be thinking that running a timer is too much overhead for this.  I did not notice any performance hit.</p>

<p>If this post was interesting or useful to you I would love to hear your comments below.</p>]]></content><author><name></name></author><category term="technology" /><category term="linux," /><category term="terminal," /><category term="cron" /><summary type="html"><![CDATA[As of Ubuntu 16.04 (maybe earlier) the Gnome Terminal has built in support for Solarized Dark and Light themes. I also run Redshift on my machine to reduce the blue light that can interfere with sleep. (f.lux is another popular app for the same purpose).]]></summary></entry><entry><title type="html">Welcome to Jekyll!</title><link href="https://www.hadji.co/welcome-to-jekyll/" rel="alternate" type="text/html" title="Welcome to Jekyll!" /><published>2016-01-12T01:00:24+00:00</published><updated>2016-01-12T01:00:24+00:00</updated><id>https://www.hadji.co/welcome-to-jekyll</id><content type="html" xml:base="https://www.hadji.co/welcome-to-jekyll/"><![CDATA[<p>This is the first post on my new jekyll-github powered site.  I’ve been using <a href="https://help.github.com/articles/github-flavored-markdown/">markdown</a> for a variety of writing tasks in the past few years.  It is a very natural way to write and it allows me to do all my writing in <a href="http://www.vim.org/">vim</a>, the same text editor I use for coding.</p>

<p>I learned to touch type in 2015.  So as I’m building muscle memory for typing it makes sense to me to use the same software for all my writing.  Jekyll lets me quickly write down my thoughts in markdown format, push to github, and I’m done sharing my thoughts with the whole world.</p>

<p>Another nice feature:<br />
Jekyll also offers powerful support for code snippets:</p>

<figure class="highlight"><pre><code class="language-python" data-lang="python"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="n">name</span><span class="p">):</span>
  <span class="k">print</span><span class="p">(</span><span class="s">"Hi, "</span> <span class="o">+</span> <span class="n">name</span><span class="p">)</span>

<span class="n">print_hi</span><span class="p">(</span><span class="s">'Antonios'</span><span class="p">)</span>

<span class="n">prints</span> <span class="s">'Hi, Antonios'</span> <span class="n">to</span> <span class="n">STDOUT</span><span class="p">.</span></code></pre></figure>

<h2 id="setting-up-jekyll">Setting up Jekyll</h2>
<p>The first step was following the instructions at these two links:</p>

<ul>
  <li><a href="https://pages.github.com">Github Pages</a></li>
  <li><a href="https://jekyllrb.com/docs/quickstart/">Jekyl Quick Start</a></li>
</ul>

<p>The initial install was easy enough.  However, the urls were not setup as is commonly considered best practice for SEO purposes.  Wordpress does the same thing.  Why is the default not set up for best practices?</p>

<p>To make the urls match the titles without any categories or dates, what is commonly referred to as ‘pretty urls’ I added the following line to the <code class="language-plaintext highlighter-rouge">_config.yml</code> file.</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="na">permalink</span><span class="pi">:</span> <span class="s">:title/</span></code></pre></figure>

<h2 id="comments">Comments</h2>
<p>Jekyll does not come with commenting capabilities built in.  Many people use Disqus and I decided to do the same.  I found the documentation lacking in clarity as to how to set it up best.  Disqus site has code you can copy and paste.  There are two variables that you will need to set in this code.</p>

<figure class="highlight"><pre><code class="language-liquid" data-lang="liquid">this.page.url = "<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}{{</span><span class="w"> </span><span class="nv">page</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>";
this.page.identifier = "<span class="p">{{</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">disqusid</span><span class="w"> </span><span class="p">}}{{</span><span class="w"> </span><span class="nv">page</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">}}</span>";</code></pre></figure>

<p>I set my disqus site id up in my <code class="language-plaintext highlighter-rouge">_config.yml</code> file</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="na">disqusid</span><span class="pi">:</span> <span class="s">replacethistextwithyourdisqusid</span></code></pre></figure>

<h2 id="collections">Collections</h2>
<p>The next addition to this site was my collection of book notes.  Since Jekyll has <a href="https://jekyllrb.com/docs/collections/">collections</a> that seemed like a great mechanism for creating a new series of related information like book notes.  I have to thank Ben Balter for his excellent post <a href="http://ben.balter.com/2015/02/20/jekyll-collections/">Explain like I’m five: Jekyll Collections</a>. His description was instrumental in my implementation of collections.</p>

<p>The main benefit in using collections like this is that I get to keep all related writing in a subdirectory separate from regular posts or other types of writing that I might want to share.  Another benefit for readers of my site is that I can set it up so that they can easily look through related information that is available on the site.</p>

<h3 id="what-does-it-take-to-create-and-display-collections-in-jekyll">What does it take to create and display collections in Jekyll?</h3>

<p>The first step is to add the collection to your <code class="language-plaintext highlighter-rouge">_config.yaml</code> file. Below is the configuration to create a <code class="language-plaintext highlighter-rouge">books</code> collection.</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="na">collections</span><span class="pi">:</span>
  <span class="na">books</span><span class="pi">:</span>
    <span class="na">output</span><span class="pi">:</span> <span class="no">true</span></code></pre></figure>

<p>Now throughout Jekyll I can refer to <code class="language-plaintext highlighter-rouge">books</code> just as I would <code class="language-plaintext highlighter-rouge">posts</code> and get the same result.</p>

<p>The next thing to do is to create a listing page that will show all the book notes.  For this blog I simply copied the default <code class="language-plaintext highlighter-rouge">index.html</code> to <code class="language-plaintext highlighter-rouge">books.html</code> and made a few minor modifications:</p>

<p>Here’s what my edited <code class="language-plaintext highlighter-rouge">books.html</code> looks like:</p>

<figure class="highlight"><pre><code class="language-liquid" data-lang="liquid">---
layout: default
title: Books
---

&lt;div class="home"&gt;
  &lt;h1 class="page-heading"&gt;Book Notes&lt;/h1&gt;
  &lt;ul class="post-list"&gt;
    <span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span><span class="nv">book</span><span class="w"> </span><span class="nt">in</span><span class="w"> </span><span class="nv">site.books</span><span class="w"> </span><span class="na">reversed</span><span class="w"> </span><span class="p">%}</span>
      &lt;li&gt;
        &lt;span class="post-meta"&gt;<span class="p">{{</span><span class="w"> </span><span class="nv">book</span><span class="p">.</span><span class="nv">date</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">date</span><span class="p">:</span><span class="w"> </span><span class="s2">"%b %-d, %Y"</span><span class="w"> </span><span class="p">}}</span>&lt;/span&gt;
        &lt;h2&gt;
          &lt;a class="post-link" href="<span class="p">{{</span><span class="w"> </span><span class="nv">book</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">prepend</span><span class="p">:</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}</span>"&gt;<span class="p">{{</span><span class="w"> </span><span class="nv">book</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="p">}}</span>&lt;/a&gt;
        &lt;/h2&gt;
      &lt;/li&gt;
    <span class="p">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="p">%}</span>
  &lt;/ul&gt;

  &lt;p class="rss-subscribe"&gt;subscribe &lt;a href="<span class="p">{{</span><span class="w"> </span><span class="s2">"/feed.xml"</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">prepend</span><span class="p">:</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">baseurl</span><span class="w"> </span><span class="p">}}</span>"&gt;via RSS&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</code></pre></figure>

<ol>
  <li>Add a title to the yaml front matter <code class="language-plaintext highlighter-rouge">title: Books</code></li>
  <li>Change the <strong>h1</strong> from ‘Posts’ to ‘Book Notes’</li>
  <li>Change references to <code class="language-plaintext highlighter-rouge">post</code> to <code class="language-plaintext highlighter-rouge">book</code> except for css class names.  I did not choose to change the css to look different than the posts.</li>
  <li>Change the for loop to:</li>
</ol>

<figure class="highlight"><pre><code class="language-liquid" data-lang="liquid"><span class="p">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span><span class="nv">book</span><span class="w"> </span><span class="nt">in</span><span class="w"> </span><span class="nv">site.books</span><span class="w"> </span><span class="na">reversed</span><span class="w"> </span><span class="p">%}</span></code></pre></figure>

<p>Using <code class="language-plaintext highlighter-rouge">reversed</code> shows the most recent book notes at the top of the page.</p>

<p>An added benefit to adding the <code class="language-plaintext highlighter-rouge">books.html</code> file next to the default <code class="language-plaintext highlighter-rouge">index.html</code> file in the root directory is that Jekyll automatically creates a menu item for each file there.  So this creates a ‘Books’ menu item for free!</p>

<h2 id="about-page">About page</h2>

<p>To create an about page on my site and have it accessible via the menu, all I had to do was add an <code class="language-plaintext highlighter-rouge">about.md</code> markdown file in the root directory and Jekyll did everything else.</p>

<h2 id="custom-url">Custom Url</h2>

<p><strong>UPDATE 2018:</strong> Github now has support for https on custom domains.  Just include a file named ‘CNAME’ with your custom domain and <a href="https://help.github.com/articles/setting-up-a-www-subdomain/">update your DNS</a>.</p>

<p>Currently my Jekyll site is reachable from <code class="language-plaintext highlighter-rouge">hadji.co</code> or <code class="language-plaintext highlighter-rouge">www.hadji.co</code> via URL forwarding set up in my DNS. On <a href="https://pages.github.com/">Github Pages</a> I can have the site show up with my custom url by including a <code class="language-plaintext highlighter-rouge">CNAME</code> file in my github repository.  I’ve been debating the merits of that since I lose the https functionality that is available for free with my github account</p>

<p>In other words, I can have my url show up as:<br />
<code class="language-plaintext highlighter-rouge">https://antonioshadji.github.io/</code><br />
or<br />
<code class="language-plaintext highlighter-rouge">http://www.hadji.co/</code></p>

<p>Currently, Github does not offer <code class="language-plaintext highlighter-rouge">https</code> on custom domains.  I’m assuming that it is only a matter of time before they do. There are people writing about how to use cloudflare to make the site appear on <code class="language-plaintext highlighter-rouge">https</code> urls.  My understanding is that this isn’t the same as having the domain secured with ssl.  Since it’s not the same, I prefer to not make it appear so to visitors.</p>

<p>I’m choosing to continue using my <code class="language-plaintext highlighter-rouge">github.io</code> address.  I recently found some information on <a href="https://moz.com/blog/subdomains-vs-subfolders-rel-canonical-vs-301-how-to-structure-links-optimally-for-seo-whiteboard-friday">Moz.com</a> that helped me make the decision.</p>

<blockquote class="imgur-embed-pub" lang="en" data-id="3oFVArO"><a href="//imgur.com/3oFVArO"></a></blockquote>
<script async="" src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

<p>What caught my attention is the distinction between what happens when I use a 301 redirect vs. what happens with <code class="language-plaintext highlighter-rouge">&lt;link rel=canonical ...</code> meta data.</p>

<p>If I add a canonical url to my content in Jekyll on Github Pages the search engines will get the same redirection information that they would get with a 301 redirect.  The only difference is that users will always see Github Pages site even if the content is living elsewhere on the net someday. I’m only concerned about controlling my SEO score and this gives me that ability.  If you think I’m missing something here please let me know in the comments.</p>

<p>This was also confirmed by <a href="https://yoast.com/rel-canonical/#301-redirect-vs-canonical">Yoast</a>.</p>

<p>If you have read all the way to here, I hope that you found this information useful.  I have many plans for this site and all my Jekyll modifications will be documented in this post.  For your enjoyment and so that I can remember what I have done to modify my site from the default install.</p>]]></content><author><name></name></author><category term="technology" /><category term="jekyll" /><summary type="html"><![CDATA[This is the first post on my new jekyll-github powered site. I’ve been using markdown for a variety of writing tasks in the past few years. It is a very natural way to write and it allows me to do all my writing in vim, the same text editor I use for coding.]]></summary></entry></feed>