Jekyll2020-01-12T07:57:46+00:00/ga_blog/feed.xmlnetbob.xyzMy simple website created with the Jekyll static website and Github PagesWelcome to Jekyll and GitHub2020-01-12T02:42:16+00:002020-01-12T02:42:16+00:00/ga_blog/netbob/categories/2020/01/12/welcome-to-jekyll-with-github<p>This is the first experiment in programming websites with Jekyll and GitHub Pages</p>
<p>The procedure used for creating this website is as follows:</p>
<ol>
<li>jekyll new ga_blog (or whatever) Create jekyll site
1.1 bundle exec jekyll serve (to create a localhost jekyll server to test content)
<ul>
<li>http://localhost:4000</li>
<li>ctrl-C to exit server</li>
</ul>
</li>
<li>cd ga_blog</li>
<li>modify _config.yml (nano _config.yml)
<ul>
<li>add to baseurl “ga_blog” (for custom hosting replace this value with your full custom url here)</li>
<li>and save</li>
</ul>
</li>
<li>Create repository on github with the name of your site folder. In this case its ga_blog
<ul>
<li>DON’T iniitialize the site on github. Just create it.</li>
<li>note the url in the github start new repository site:</li>
</ul>
</li>
<li>git init</li>
<li>git checkout -b gh-pages</li>
<li>git status (to list the files to be pushed up to gh-pages branch)</li>
<li>git add . (period means all files)</li>
<li>git commit -m “initial commit”</li>
<li>git remote add origin https://github.com/netbob/ga_blog.git (from the github repository create page)</li>
<li>git push origin gh-pages (note for me, it asked for my username and password. I am using 2fa so I had to create a new token (an app password aws it were for this to work)</li>
<li>Confirm on github gh-pages branch has the files you just pushed up.</li>
<li>go to the gh-pages branch and click on settings and scroll down to
<ul>
<li>GitHub Pages</li>
<li>GitHub Pages is designed to host your personal, organization, or project pages from a GitHub repository.</li>
<li>Your site is published at https://netbob.github.io/ga_blog/</li>
<li>Confirm website is active on github under your username. Cool.</li>
</ul>
</li>
<li>After making website changes:
<ul>
<li>git add . (or got add <specific pages=""></specific></li>
<li>git commit -m “optional comment”</li>
<li>git push origin gh-pages</li>
</ul>
</li>
</ol>This is the first experiment in programming websites with Jekyll and GitHub PagesWelcome to Jekyll!2020-01-12T02:42:16+00:002020-01-12T02:42:16+00:00/ga_blog/jekyll/update/2020/01/12/welcome-to-jekyll<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> 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 <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>
<p>Jekyll requires blog post files to be named according to the following format:</p>
<p><code class="language-plaintext highlighter-rouge">YEAR-MONTH-DAY-title.MARKUP</code></p>
<p>Where <code class="language-plaintext highlighter-rouge">YEAR</code> is a four-digit number, <code class="language-plaintext highlighter-rouge">MONTH</code> and <code class="language-plaintext highlighter-rouge">DAY</code> are both two-digit numbers, and <code class="language-plaintext highlighter-rouge">MARKUP</code> is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>
<p>Jekyll also offers powerful support for code snippets:</p>
<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=> prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>
<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>You’ll find 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 jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.