<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>gitlab on
A Scripter's Notes</title><link>https://scripter.co/categories/gitlab/</link><description>Recent content in gitlab
on A Scripter's Notes</description><language>en-us</language><managingEditor>kaushal.modi@gmail.com (Kaushal Modi)</managingEditor><webMaster>kaushal.modi@gmail.com (Kaushal Modi)</webMaster><lastBuildDate>Wed, 22 Apr 2026 08:24:58 -0400</lastBuildDate><generator>Hugo -- gohugo.io</generator><docs>https://validator.w3.org/feed/docs/rss2.html</docs><atom:link href="https://scripter.co/categories/gitlab/index.xml" rel="self" type="application/rss+xml"/><item><title>How I Created this Blog</title><link>https://scripter.co/how-i-created-this-blog/</link><description>&lt;p>I have been toying with the idea to use &lt;a href="https://gohugo.io/">&lt;code>hugo&lt;/code>&lt;/a> as my static web site generator for few weeks now. And then the news of its version 0.17 release are &lt;a href="http://spf13.com/post/hugo-goes-global/">announced&lt;/a>, and &lt;code>hugo&lt;/code> shows up on &lt;a href="https://news.ycombinator.com/item?id=12672394">Hacker News once again&lt;/a>.&lt;/p>
&lt;p>Somehow while browsing through the comments on HN, I end up on &lt;a href="https://pages.gitlab.io/">Gitlab Pages&lt;/a>, and there I read:&lt;/p>
&lt;blockquote>
&lt;p>While you can create a project from scratch, let&amp;rsquo;s keep it simple and fork one of your favorite example projects to get a quick start. GitLab Pages works with &lt;strong>any&lt;/strong> &lt;em>(emphasis mine)&lt;/em> static site generator.&lt;/p>
&lt;/blockquote>
&lt;p>From there I navigate to the &lt;a href="https://gitlab.com/groups/pages">Example projects for various static site generators&lt;/a> and Hugo is one of them!&lt;/p>
&lt;p>&lt;img src="https://scripter.co/images/gitlab_pages_examples_hugo.png" alt="Gitlab Pages Examples - Hugo">&lt;/p>
&lt;p>So then I proceed to the &lt;a href="https://gitlab.com/pages/hugo">&lt;code>hugo&lt;/code> example&lt;/a>, and then proceed through the following steps to get my own &lt;em>Gitlab Page&lt;/em> running!&lt;/p>
&lt;ol>
&lt;li>&lt;em>Fork&lt;/em> the &lt;a href="https://gitlab.com/pages/hugo">&lt;code>hugo&lt;/code> example&lt;/a>&lt;/li>
&lt;li>In the fork&amp;rsquo;s &lt;em>Settings (Gear icon) &amp;gt; Runners&lt;/em>, I ensure that shared runners are enabled. These runners are what rebuild my static web page each time I update the content/site configuration.&lt;/li>
&lt;li>In &lt;em>Settings &amp;gt; Edit Project&lt;/em>,
&lt;ul>
&lt;li>Navigate to &lt;strong>Rename repository&lt;/strong> section and change the fields in &lt;strong>Project name&lt;/strong> and &lt;strong>Path&lt;/strong> to &lt;code>NAMESPACE.gitlab.io&lt;/code> where &lt;em>NAMESPACE&lt;/em> is your gitlab &lt;em>username&lt;/em>.&lt;/li>
&lt;li>Navigate further down in the same page and remove the forking relationship (optional).&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>In &lt;code>config.toml&lt;/code>, change this &lt;code>baseurl&lt;/code> line, from &lt;code>&amp;quot;https://pages.gitlab.io/hugo/&amp;quot;&lt;/code> to &lt;code>&amp;quot;https://NAMESPACE.gitlab.io&amp;quot;&lt;/code> where &lt;em>NAMESPACE&lt;/em> is your gitlab &lt;em>username&lt;/em>. Then &lt;strong>commit and push those changes&lt;/strong>.&lt;/li>
&lt;/ol>
&lt;p>Within few minutes when the shared runner finished building the site, my site was available on &lt;a href="https://kaushalmodi.gitlab.io">&lt;code>https://kaushalmodi.gitlab.io&lt;/code>&lt;/a>.&lt;/p>
&lt;p>The source repo for this site is &lt;a href="https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io">here&lt;/a>.&lt;/p>
&lt;h2 id="port-from-octopress">Port from Octopress&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#port-from-octopress">#&lt;/a>&lt;/h2>
&lt;p>After setting up Gitlab and &lt;code>hugo&lt;/code> CI, it was then pretty straightforward to port in my &lt;em>very old&lt;/em> posts from my Octopress blog.&lt;/p>
&lt;h2 id="tweaking-the-gitlab-ci-configuration-script">Tweaking the Gitlab CI configuration script&amp;nbsp;&lt;a class="headline-hash no-text-decoration" href="#tweaking-the-gitlab-ci-configuration-script">#&lt;/a>&lt;/h2>
&lt;p>I tweaked the Gitlab provided &lt;code>.gitlab-ci.yml&lt;/code> to achieve two things:&lt;/p>
&lt;ol>
&lt;li>Use the latest &lt;code>hugo&lt;/code> release as of today (version 0.17)&lt;/li>
&lt;li>Use &lt;a href="http://pygments.org/">&lt;em>Pygments&lt;/em>&lt;/a> for syntax highlighting.&lt;/li>
&lt;/ol>
&lt;p>So below was the result:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">image&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">alpine:3.4&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">before_script&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">apk update &amp;amp;&amp;amp; apk add openssl&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c"># Install Pygments for syntax highlighting&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c"># https://gitlab.com/gitlab-com/support-forum/issues/1150#note_16763556&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">apk add py-pygments&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">wget https://github.com/spf13/hugo/releases/download/v0.17/hugo_0.17_Linux-64bit.tar.gz&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">echo &amp;#34;6a74626b64434a5ee9fc5ec4fbf22ce6 hugo_0.17_Linux-64bit.tar.gz&amp;#34; | md5sum -c&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">tar xf hugo_0.17_Linux-64bit.tar.gz &amp;amp;&amp;amp; cp ./hugo_0.17_linux_amd64/hugo_0.17_linux_amd64 /usr/bin/hugo&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">hugo version&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">test&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">script&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">hugo&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">except&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">master&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">pages&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">script&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">hugo&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">artifacts&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">paths&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">public&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">only&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">master&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In order to make &lt;code>hugo&lt;/code> use &lt;em>Pygments&lt;/em>, you need to put the below in your &lt;code>config.toml&lt;/code>:&lt;/p>
&lt;pre tabindex="0">&lt;code>pygmentsStyle = &amp;#34;trac&amp;#34; # This is just the Pygments theme I like
pygmentsCodeFences = true
&lt;/code>&lt;/pre></description><category domain="https://scripter.co/categories/hugo">hugo</category><category domain="https://scripter.co/categories/gitlab">gitlab</category><guid>https://scripter.co/how-i-created-this-blog/</guid><pubDate>Mon, 10 Oct 2016 11:27:10 -0400</pubDate></item></channel></rss>