<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.0">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2021-07-12T21:47:14+02:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">Ketch AB</title><subtitle></subtitle><author><name>Janne Hasslöf</name></author><entry><title type="html">A Github Pages Blog With Jekyll Developed On Wsl2</title><link href="http://localhost:4000/blog/2021/07/11/A-github-pages-blog-with-Jekyll-developed-on-WSL2/" rel="alternate" type="text/html" title="A Github Pages Blog With Jekyll Developed On Wsl2" /><published>2021-07-11T00:00:00+02:00</published><updated>2021-07-11T00:00:00+02:00</updated><id>http://localhost:4000/blog/2021/07/11/A-github-pages-blog-with-Jekyll-developed-on-WSL2</id><content type="html" xml:base="http://localhost:4000/blog/2021/07/11/A-github-pages-blog-with-Jekyll-developed-on-WSL2/">&lt;h1 id=&quot;getting-started&quot;&gt;Getting Started&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;https://ketchdigital.com/&quot;&gt;ketchdigital.com&lt;/a&gt; is built using &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; and &lt;a href=&quot;https://pages.github.com/&quot;&gt;GitHub Pages&lt;/a&gt;.&lt;br /&gt;
GitHub has an excellent guide on how to get started&lt;br /&gt;
&lt;a href=&quot;https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll&quot;&gt;Setting up a GitHub Pages site with Jekyll&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post is a shortcut to get you stared with a project website that you can develop and test locally on a PC with WSL2 and host on github pages.&lt;/p&gt;

&lt;h2 id=&quot;install-dependencies&quot;&gt;Install dependencies&lt;/h2&gt;

&lt;p&gt;First make sure you have the pre-requisites on your PC:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/windows/wsl/install-win10&quot;&gt;Install WSL 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.microsoft.com/store/apps/9n6svws3rx71&quot;&gt;Install Ubuntu 20.04&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Install initial Ruby version&lt;/li&gt;
&lt;/ul&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;nb&quot;&gt;cd&lt;/span&gt; ~
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update &lt;span class=&quot;nt&quot;&gt;--fix-missing&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ruby
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Test that you have ruby and gem installed:&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;ruby &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
gem &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/installation/ubuntu/&quot;&gt;Install full Ruby developer edition and the Jekyll bundle&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test Jekyll is installed&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;jekyll &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-git&quot;&gt;Setup Git in WSL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check your git configuration:&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 config &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt;
user.name&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;my name&amp;gt;
user.email&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;my mail&amp;gt;
credential.helper&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/mnt/c/Program&lt;span class=&quot;se&quot;&gt;\ &lt;/span&gt;Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Install VS Code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This code automatically installs code in WSL.&lt;br /&gt;
Reference: &lt;a href=&quot;https://code.visualstudio.com/docs/remote/wsl&quot;&gt;Developing in WSL&lt;/a&gt;&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;nb&quot;&gt;cd&lt;/span&gt; ~
code &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;initialize-the-local-jekyll-site&quot;&gt;Initialize the local Jekyll site&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Fork the repo &lt;a href=&quot;https://github.com/jhasslof/github-pages-example&quot;&gt;github-pages-example&lt;/a&gt; to your account.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Clone your forked project to your dev machine and initialize bundle&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reference: &lt;a href=&quot;https://jekyllrb.com/tutorials/using-jekyll-with-bundler/&quot;&gt;Using Jekyll with Bundler&lt;/a&gt;&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;nb&quot;&gt;cd&lt;/span&gt; ~/&amp;lt;repo-root&amp;gt;
git clone https://github.com/&amp;lt;yourAccount&amp;gt;/github-pages-example.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;github-pages-example
bundle config &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--local&lt;/span&gt; path &lt;span class=&quot;s1&quot;&gt;'vendor/bundle'&lt;/span&gt;
bundle &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;start-your-local-development&quot;&gt;Start your local development&lt;/h2&gt;

&lt;p&gt;Start development server:&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;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll serve &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; _config.yml,_config.dev.yml &lt;span class=&quot;nt&quot;&gt;--livereload&lt;/span&gt; &amp;amp;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Browse to &lt;a href=&quot;http://127.0.0.1:4000/&quot;&gt;http://127.0.0.1:4000/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Edit file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./index.markdown&lt;/code&gt;and see that the UI automatically reload to render your update in the browser&lt;/p&gt;

&lt;h2 id=&quot;configure-website-setup-github-pages-site&quot;&gt;Configure website setup Github Pages site&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Configure site settings in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./_config.yml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-yml 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;na&quot;&gt;baseurl&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/github-pages-example&quot;&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# the subpath of your site&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https://&amp;lt;yourAccount&amp;gt;.github.io&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# the base hostname &amp;amp; protocol for your site&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Reference:  &lt;a href=&quot;https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll#creating-your-site&quot;&gt;Creating a GitHub Pages site with Jekyll&lt;/a&gt;, &lt;a href=&quot;https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll#configuring-jekyll-in-your-github-pages-site&quot;&gt;Configuring Jekyll in your GitHub Pages site&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Commit changes and push commits to github&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source&quot;&gt;Configuring a publishing source for your GitHub Pages site&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To configure continuous deployment (CD) on each update to the main-branch in GitHub, make sure to change the GitHub Pages to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Test your new website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Browse to: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://&amp;lt;yourAccount&amp;gt;.github.io/github-pages-example/&lt;/code&gt;&lt;/p&gt;</content><author><name>Janne Hasslöf</name></author><summary type="html">Getting Started</summary></entry></feed>