<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sardorbek Imomaliev</title>
    <description>The latest articles on Forem by Sardorbek Imomaliev (@imomaliev).</description>
    <link>https://forem.com/imomaliev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F271195%2Ff169e622-b6d4-4d68-9497-164fe4113ceb.JPG</url>
      <title>Forem: Sardorbek Imomaliev</title>
      <link>https://forem.com/imomaliev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/imomaliev"/>
    <language>en</language>
    <item>
      <title>Tailwind in Your Buns</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Mon, 16 Mar 2026 18:48:56 +0000</pubDate>
      <link>https://forem.com/imomaliev/tailwind-in-your-buns-2fdf</link>
      <guid>https://forem.com/imomaliev/tailwind-in-your-buns-2fdf</guid>
      <description>&lt;p&gt;My background is mostly in backend development; frontend is not my forte, but when I tried &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt; in one of my previous projects, I really liked it. I decided to use it in my blog as well.&lt;/p&gt;

&lt;p&gt;Like before, I will start by going through the &lt;a href="https://gohugo.io/functions/css/tailwindcss/" rel="noopener noreferrer"&gt;official guide&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installing TailwindCSS
&lt;/h2&gt;

&lt;p&gt;The guide says to install TailwindCSS via npm but I am going to use &lt;a href="https://bun.sh/" rel="noopener noreferrer"&gt;Bun&lt;/a&gt; instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;bun &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--dev&lt;/span&gt; tailwindcss @tailwindcss/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update site's .gitignore
&lt;/h2&gt;

&lt;p&gt;Because the site folder will also contain files for Bun, I need to ensure that &lt;code&gt;.gitignore&lt;/code&gt; includes configuration for it as well. If you are creating a new project via &lt;code&gt;bun init&lt;/code&gt;, you get &lt;a href="https://github.com/oven-sh/bun/blob/main/src/cli/init/gitignore.default" rel="noopener noreferrer"&gt;gitignore&lt;/a&gt; added as your &lt;code&gt;.gitignore&lt;/code&gt;. But in our case, because we are using &lt;code&gt;bun install&lt;/code&gt; it won't be added. So I will be adding it manually.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/site/.gitignore b/site/.gitignore
index a6e26ad..517d145 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/site/.gitignore
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/site/.gitignore
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,3 +1,4 @@&lt;/span&gt;
&lt;span class="gi"&gt;+# Hugo
&lt;/span&gt; # Copied from: https://github.com/github/gitignore/blob/main/community/Golang/Hugo.gitignore
 # License: CC0 1.0 Universal
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;@@ -14,3 +15,42 @@&lt;/span&gt; hugo.linux
&lt;span class="err"&gt;
&lt;/span&gt; # Temporary lock file while building
 /.hugo_build.lock
&lt;span class="gi"&gt;+
+# Bun
+# Copied from: https://github.com/oven-sh/bun/blob/main/src/cli/init/gitignore.default
+# License: MIT
+
+# dependencies (bun install)
+node_modules
+
+# output
+out
+dist
+*.tgz
+
+# code coverage
+coverage
+*.lcov
+
+# logs
+logs
+_.log
+report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
+
+# dotenv environment variable files
+.env
+.env.development.local
+.env.test.local
+.env.production.local
+.env.local
+
+# caches
+.eslintcache
+.cache
+*.tsbuildinfo
+
+# IntelliJ based IDEs
+.idea
+
+# Finder (MacOS) folder config
+.DS_Store
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update site's configuration
&lt;/h2&gt;

&lt;p&gt;Paste the code provided in Step 2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/site/hugo.toml b/site/hugo.toml
index 1087dd9..8e24de2 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/site/hugo.toml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/site/hugo.toml
&lt;/span&gt;&lt;span class="p"&gt;@@ -7,6 +7,23 @@&lt;/span&gt; title = 'Blog'
&lt;span class="err"&gt;
&lt;/span&gt;   [[module.imports]]
     path = 'github.com/imomaliev/blog/theme'
&lt;span class="gi"&gt;+  [[module.mounts]]
+    source = 'assets'
+    target = 'assets'
+  [[module.mounts]]
+    disableWatch = true
+    source = 'hugo_stats.json'
+    target = 'assets/notwatching/hugo_stats.json'
+
+[build]
+  [build.buildStats]
+    enable = true
+  [[build.cachebusters]]
+    source = 'assets/notwatching/hugo_stats\.json'
+    target = 'css'
+  [[build.cachebusters]]
+    source = '(postcss|tailwind)\.config\.js'
+    target = 'css'
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt; [caches]
   [caches.images]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update CSS entry file
&lt;/h2&gt;

&lt;p&gt;Step 3 asks to create a new CSS file, but my theme already has &lt;code&gt;main.css&lt;/code&gt;. So I will be updating it instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/theme/assets/css/main.css b/theme/assets/css/main.css
index 166ade9..cae7ba4 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/theme/assets/css/main.css
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/theme/assets/css/main.css
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,3 +1,6 @@&lt;/span&gt;
&lt;span class="gi"&gt;+@import "tailwindcss";
+@source "hugo_stats.json";
+
&lt;/span&gt; body {
   color: #222;
   font-family: sans-serif;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Process CSS with TailwindCSS CLI
&lt;/h2&gt;

&lt;p&gt;Update &lt;code&gt;theme/layouts/_partials/head/css.html&lt;/code&gt; with code from Step 4.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/theme/layouts/_partials/head/css.html b/theme/layouts/_partials/head/css.html
index d76d23a..075e64e 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/theme/layouts/_partials/head/css.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/theme/layouts/_partials/head/css.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,9 +1,12 @@&lt;/span&gt;
 {{- with resources.Get "css/main.css" }}
&lt;span class="gd"&gt;-  {{- if hugo.IsDevelopment }}
-    &amp;lt;link rel="stylesheet" href="{{ .RelPermalink }}"&amp;gt;
-  {{- else }}
-    {{- with . | minify | fingerprint }}
-      &amp;lt;link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+  {{- $opts := dict "minify" (not hugo.IsDevelopment) }}
+  {{- with . | css.TailwindCSS $opts }}
+    {{- if hugo.IsDevelopment }}
+      &amp;lt;link rel="stylesheet" href="{{ .RelPermalink }}"&amp;gt;
+    {{- else }}
+      {{- with . | fingerprint }}
+        &amp;lt;link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"&amp;gt;
+      {{- end }}
&lt;/span&gt;     {{- end }}
   {{- end }}
 {{- end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update &lt;code&gt;theme/layouts/_partials/head.html&lt;/code&gt; with code from Step 5.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/theme/layouts/_partials/head.html b/theme/layouts/_partials/head.html
index 02c2240..13f1cd6 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/theme/layouts/_partials/head.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/theme/layouts/_partials/head.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,5 +1,7 @@&lt;/span&gt;
 &amp;lt;meta charset="utf-8"&amp;gt;
 &amp;lt;meta name="viewport" content="width=device-width"&amp;gt;
 &amp;lt;title&amp;gt;{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}&amp;lt;/title&amp;gt;
&lt;span class="gd"&gt;-{{ partialCached "head/css.html" . }}
&lt;/span&gt;&lt;span class="gi"&gt;+{{ with (templates.Defer (dict "key" "global")) }}
+  {{ partial "head/css.html" . }}
+{{ end }}
&lt;/span&gt; {{ partialCached "head/js.html" . }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TailwindCSS is installed and configured.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Typography plugin
&lt;/h2&gt;

&lt;p&gt;One of the reasons I prefer using TailwindCSS is its &lt;a href="https://github.com/tailwindlabs/tailwindcss-typography" rel="noopener noreferrer"&gt;typography plugin&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;bun &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--dev&lt;/span&gt; @tailwindcss/typography
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add plugin to &lt;code&gt;theme/assets/css/main.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/theme/assets/css/main.css b/theme/assets/css/main.css
index cae7ba4..66b0f49 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/theme/assets/css/main.css
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/theme/assets/css/main.css
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,5 +1,6 @@&lt;/span&gt;
 @import "tailwindcss";
 @source "hugo_stats.json";
&lt;span class="gi"&gt;+@plugin "@tailwindcss/typography";
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt; body {
   color: #222;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update workflow to use Bun instead of Node
&lt;/h2&gt;

&lt;p&gt;Bun provides an official GitHub Action and the &lt;a href="https://bun.com/docs/guides/runtime/cicd" rel="noopener noreferrer"&gt;guide&lt;/a&gt; how to use it. I've gone through &lt;code&gt;.github/workflows/hugo.yaml&lt;/code&gt; and updated it to use Bun instead of Node.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml
index d8cc26d..a240bb0 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.github/workflows/hugo.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.github/workflows/hugo.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -23,7 +23,7 @@&lt;/span&gt; jobs:
     env:
       GO_VERSION: 1.25.5
       HUGO_VERSION: 0.154.4
&lt;span class="gd"&gt;-      NODE_VERSION: 24.12.0
&lt;/span&gt;&lt;span class="gi"&gt;+      BUN_VERSION: 1.3.7
&lt;/span&gt;       TZ: Europe/Oslo
     steps:
       - name: Checkout
&lt;span class="p"&gt;@@ -36,10 +36,10 @@&lt;/span&gt; jobs:
         with:
           go-version: ${{ env.GO_VERSION }}
           cache: false
&lt;span class="gd"&gt;-      - name: Setup Node.js
-        uses: actions/setup-node@v6
&lt;/span&gt;&lt;span class="gi"&gt;+      - name: Setup Bun
+        uses: oven-sh/setup-bun@v2
&lt;/span&gt;         with:
&lt;span class="gd"&gt;-          node-version: ${{ env.NODE_VERSION }}
&lt;/span&gt;&lt;span class="gi"&gt;+          bun-version: ${{ env.BUN_VERSION }}
&lt;/span&gt;       - name: Setup Pages
         id: pages
         uses: actions/configure-pages@v5
&lt;span class="p"&gt;@@ -57,10 +57,11 @@&lt;/span&gt; jobs:
         run: |
           echo "Go: $(go version)"
           echo "Hugo: $(hugo version)"
&lt;span class="gd"&gt;-          echo "Node.js: $(node --version)"
-      - name: Install Node.js dependencies
&lt;/span&gt;&lt;span class="gi"&gt;+          echo "Bun: $(bun --version)"
+      - name: Install Bun dependencies
&lt;/span&gt;         run: |
&lt;span class="gd"&gt;-          [[ -f package-lock.json || -f npm-shrinkwrap.json ]] &amp;amp;&amp;amp; npm ci || true
&lt;/span&gt;&lt;span class="gi"&gt;+          cd site/
+          [[ -f bun.lock ]] &amp;amp;&amp;amp; bun install --frozen-lockfile || true
&lt;/span&gt;       - name: Configure Git
         run: |
           git config core.quotepath false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The setup is complete; we are ready to style our site.&lt;/p&gt;

</description>
      <category>hugo</category>
      <category>tailwindcss</category>
      <category>bunjs</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Coding in Style</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Sun, 01 Mar 2026 13:10:03 +0000</pubDate>
      <link>https://forem.com/imomaliev/coding-in-style-1ima</link>
      <guid>https://forem.com/imomaliev/coding-in-style-1ima</guid>
      <description>&lt;p&gt;With my blog "going public" I can finally start writing. My next step was going to be adding &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt;, I started working on that and immediately noticed that my editor, neovim, applies the wrong indentation, so we are going to fix that first.&lt;/p&gt;

&lt;p&gt;I can update the indentation configuration in neovim, but I think a much nicer option and better convention would be to set up &lt;a href="https://editorconfig.org/" rel="noopener noreferrer"&gt;&lt;code&gt;.editorconfig&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  EditorConfig
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create &lt;code&gt;.editorconfig&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; .editorconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure EditorConfig for available file types.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.editorconfig b/.editorconfig
&lt;/span&gt;&lt;span class="p"&gt;new file mode 100644
&lt;/span&gt;&lt;span class="gh"&gt;index 0000000..2a0efbf
&lt;/span&gt;&lt;span class="gd"&gt;--- /dev/null
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.editorconfig
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,21 @@&lt;/span&gt;
&lt;span class="gi"&gt;+# EditorConfig is awesome: https://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+# Unix-style newlines with a newline ending every file
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+trim_trailing_whitespace = true
+
+[*.md]
+# Two or more spaces at the end of the line are parsed as hard line break
+trim_trailing_whitespace = false
+indent_style = space
+indent_size = 4
+
+[*.{html,css,js,yaml,yml,toml}]
+indent_style = space
+indent_size = 2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Commit our changes.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add .editorconfig
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'configure EditorConfig'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Neovim supports &lt;code&gt;.editorconfig&lt;/code&gt; out of the box&lt;sup id="fnref1"&gt;1&lt;/sup&gt;, but it doesn't automatically enforce specified coding style. To ensure better code consistency, let's set up &lt;a href="https://pre-commit.com/" rel="noopener noreferrer"&gt;pre-commit&lt;/a&gt; with the &lt;a href="https://editorconfig-checker.github.io/" rel="noopener noreferrer"&gt;editorconfig-checker&lt;/a&gt; hook.&lt;/p&gt;

&lt;h2&gt;
  
  
  pre-commit
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create &lt;code&gt;.pre-commit-config.yaml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; .pre-commit-config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add hooks&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
&lt;/span&gt;&lt;span class="p"&gt;new file mode 100644
&lt;/span&gt;&lt;span class="gh"&gt;index 0000000..931910f
&lt;/span&gt;&lt;span class="gd"&gt;--- /dev/null
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.pre-commit-config.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,13 @@&lt;/span&gt;
&lt;span class="gi"&gt;+# See https://pre-commit.com for more information
+# See https://pre-commit.com/hooks.html for more hooks
+repos:
+-   repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v6.0.0
+    hooks:
+    -   id: check-yaml
+    -   id: check-toml
+    -   id: check-added-large-files
+-   repo: https://github.com/editorconfig-checker/editorconfig-checker
+    rev: v3.6.0
+    hooks:
+    -   id: editorconfig-checker
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make sure we are using the latest versions.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;pre-commit autoupdate
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;pre-commit &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'configure pre-commit'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run pre-commit on the whole repo.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;pre-commit run &lt;span class="nt"&gt;--all-files&lt;/span&gt;
&lt;span class="go"&gt;check yaml...............................................................Passed
check toml...............................................................Passed
check for added large files..............................................Passed
run editorconfig-checker.................................................Failed
- hook id: editorconfig-checker
- exit code: 1

site/content/devlog/show-your-work.md:
    19: Wrong amount of left-padding spaces(want multiple of 4)
    23-24: Wrong amount of left-padding spaces(want multiple of 4)
    37-39: Wrong amount of left-padding spaces(want multiple of 4)
    41-43: Wrong amount of left-padding spaces(want multiple of 4)
    45-47: Wrong amount of left-padding spaces(want multiple of 4)
    50-52: Wrong amount of left-padding spaces(want multiple of 4)

6 errors found
site/content/devlog/create-a-site.md:
    64-66: Wrong amount of left-padding spaces(want multiple of 4)

1 errors found
site/content/devlog/dogfooding-a-theme.md:
    45-47: Wrong amount of left-padding spaces(want multiple of 4)
    62: Wrong amount of left-padding spaces(want multiple of 4)
    64: Wrong amount of left-padding spaces(want multiple of 4)
    67: Wrong amount of left-padding spaces(want multiple of 4)

4 errors found
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;These ones I do not consider errors; maybe this is a bug?&lt;/p&gt;

&lt;p&gt;After a bit of digging, it turns out this is &lt;a href="https://github.com/editorconfig-checker/editorconfig-checker/issues/351" rel="noopener noreferrer"&gt;expected behavior&lt;/a&gt;. But I do not like it, so I will disable it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Fixing editorconfig-checker for markdown
&lt;/h2&gt;

&lt;p&gt;editorconfig-checker can't be &lt;a href="https://editorconfig-checker.github.io/#configuration" rel="noopener noreferrer"&gt;configured per filetype&lt;/a&gt;, but luckily for me, I can sidestep this by having two separate editorconfig-checker hooks with different arguments for different filetypes. One for markdown only, another for all other filetypes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 931910f..95b7c80 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.pre-commit-config.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.pre-commit-config.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -11,3 +11,11 @@&lt;/span&gt; repos:
     rev: v3.6.0
     hooks:
     -   id: editorconfig-checker
&lt;span class="gi"&gt;+        name: run editorconfig-checker excluding markdown
+        exclude_types: [markdown]
+    -   id: editorconfig-checker
+        name: run editorconfig-checker for markdown
+        # Disable indent size check for code block
+        # See https://github.com/editorconfig-checker/editorconfig-checker/issues/351
+        args: [-disable-indent-size]
+        types_or: [markdown]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's try it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;pre-commit run &lt;span class="nt"&gt;--all-files&lt;/span&gt;
&lt;span class="go"&gt;check yaml...............................................................Passed
check toml...............................................................Passed
check for added large files..............................................Passed
run editorconfig-checker excluding markdown..............................Passed
run editorconfig-checker for markdown....................................Passed
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All green, perfect! &lt;/p&gt;

&lt;h2&gt;
  
  
  editorconfig-checker does checking only
&lt;/h2&gt;

&lt;p&gt;I purposefully added multiple new lines at the end of &lt;code&gt;site/hugo.toml&lt;/code&gt; to see how editorconfig-checker will autoformat it and found out it does not have autoformatting capabilities (and does not consider multiple new lines as an error 🤦‍♂️). Which is a bummer; I specifically chose this hook in the hope of using it instead of &lt;a href="http://prettier.io" rel="noopener noreferrer"&gt;prettier&lt;/a&gt; for autoformatting, because recent versions of prettier broke integration with pre-commit&lt;sup id="fnref2"&gt;2&lt;/sup&gt;. I think instead of wasting more time on this sidequest I should stop, but I want to add a couple of helper hooks to remediate basic autoformatting issues.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 95b7c80..588ef57 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,9 +4,14 @@ repos:
 -   repo: https://github.com/pre-commit/pre-commit-hooks
     rev: v6.0.0
     hooks:
+    -   id: trailing-whitespace
+        # Two or more spaces at the end of the line are parsed as hard line break
+        exclude_types: [markdown]
+    -   id: end-of-file-fixer
     -   id: check-yaml
     -   id: check-toml
     -   id: check-added-large-files
+    # TODO: replace with autoformating hook
 -   repo: https://github.com/editorconfig-checker/editorconfig-checker
     rev: v3.6.0
     hooks:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Future considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Replace editorconfig-checker with another tool that actually has autoformatting.&lt;/li&gt;
&lt;li&gt;Project Idea: I can write an editorconfig-checker replacement with autoformatting based on &lt;a href="https://tree-sitter.github.io/tree-sitter/" rel="noopener noreferrer"&gt;TreeSitter&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Add a pre-commit workflow for GitHub Actions or use &lt;a href="https://pre-commit.ci" rel="noopener noreferrer"&gt;https://pre-commit.ci&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://neovim.io/doc/user/plugins.html#editorconfig" rel="noopener noreferrer"&gt;https://neovim.io/doc/user/plugins.html#editorconfig&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;&lt;a href="https://github.com/pre-commit/mirrors-prettier/commit/f62a70a3a7114896b062de517d72829ea1c884b6" rel="noopener noreferrer"&gt;https://github.com/pre-commit/mirrors-prettier/commit/f62a70a3a7114896b062de517d72829ea1c884b6&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>editorconfig</category>
      <category>precommit</category>
      <category>styleguide</category>
    </item>
    <item>
      <title>Helping Github and Cloudflare Shake Hands</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Tue, 24 Feb 2026 20:15:36 +0000</pubDate>
      <link>https://forem.com/imomaliev/helping-github-and-cloudflare-shake-hands-9h0</link>
      <guid>https://forem.com/imomaliev/helping-github-and-cloudflare-shake-hands-9h0</guid>
      <description>&lt;p&gt;I am using &lt;a href="https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/#edit-dns-records" rel="noopener noreferrer"&gt;Cloudflare DNS&lt;/a&gt; for my domain, and I did not know that there were additional steps I needed to take for the domain to work properly and have HTTPS enabled.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To pass the DNS check on GitHub's side, disable &lt;a href="https://developers.cloudflare.com/dns/proxy-status/" rel="noopener noreferrer"&gt;proxying through Cloudflare&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;From this:&lt;/p&gt;





&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb101c82ufudjywhe6kqv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb101c82ufudjywhe6kqv.png" alt="proxied record" width="800" height="85"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0grwz8r1qhqxtcqr622y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0grwz8r1qhqxtcqr622y.png" alt="dns only record" width="800" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you not do this GitHub will yell at you with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Domain's DNS record could not be retrieved. For more information, see documentation (InvalidDNSError).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;code&gt;CNAME&lt;/code&gt; for &lt;code&gt;www&lt;/code&gt; record.&lt;/p&gt;

&lt;p&gt;Otherwise, you will see this error:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6rokw1fe1c2i5r3k3gl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6rokw1fe1c2i5r3k3gl.png" alt="www dns error" width="800" height="120"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wait until GitHub Pages's settings see new DNS records.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the &lt;a href="https://docs.github.com/en/pages/getting-started-with-github-pages/securing-your-github-pages-site-with-https?versionId=free-pro-team%40latest&amp;amp;productId=pages&amp;amp;restPage=configuring-a-custom-domain-for-your-github-pages-site%2Cmanaging-a-custom-domain-for-your-github-pages-site" rel="noopener noreferrer"&gt;"Enforce HTTPS"&lt;/a&gt; setting.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub's interface is very finicky so after you are sure everything looks good, close it and do not touch it anymore.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;[!warning]&lt;br&gt;
Re-enabling Claudlfare proxying will cause certificate renewal to fail, so keep these DNS records "DNS Only".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;If after all this GitHub still is not happy, try switching Cloudflare's TLS config from "Automatic" to "Full".&lt;/p&gt;

</description>
      <category>githubpages</category>
      <category>cloudflare</category>
      <category>dns</category>
      <category>cloudflaredns</category>
    </item>
    <item>
      <title>Show Your Work</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Sun, 15 Feb 2026 18:08:04 +0000</pubDate>
      <link>https://forem.com/imomaliev/show-your-work-mi9</link>
      <guid>https://forem.com/imomaliev/show-your-work-mi9</guid>
      <description>&lt;p&gt;Our blog is a &lt;a href="https://gohugo.io/getting-started/quick-start/#configure-the-site" rel="noopener noreferrer"&gt;few steps&lt;/a&gt; away from being ready to see the world&lt;sup id="fnref1"&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Configure the site&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/site/hugo.toml b/site/hugo.toml
index 4dba0ec..7d59855 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/site/hugo.toml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/site/hugo.toml
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,6 +1,6 @@&lt;/span&gt;
&lt;span class="gd"&gt;-baseURL = 'https://example.org/'
&lt;/span&gt;&lt;span class="gi"&gt;+baseURL = 'https://imomaliev.com/'
&lt;/span&gt; languageCode = 'en-us'
&lt;span class="gd"&gt;-title = 'My New Hugo Site'
&lt;/span&gt;&lt;span class="gi"&gt;+title = 'Blog'
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt; [module]
   replacements = 'github.com/imomaliev/blog/theme -&amp;gt; ../../theme'
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow all the steps in the &lt;a href="https://gohugo.io/host-and-deploy/host-on-github-pages/" rel="noopener noreferrer"&gt;Host on GitHub Pages&lt;/a&gt; guide.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update workflow to build in and publish from site directory.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml
index 20e1d20..d8cc26d 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.github/workflows/hugo.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.github/workflows/hugo.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -74,6 +74,7 @@&lt;/span&gt; jobs:
             hugo-
       - name: Build the site
         run: |
&lt;span class="gi"&gt;+          cd site/
&lt;/span&gt;           hugo \
             --gc \
             --minify \
&lt;span class="p"&gt;@@ -88,7 +89,7 @@&lt;/span&gt; jobs:
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v4
         with:
&lt;span class="gd"&gt;-          path: ./public
&lt;/span&gt;&lt;span class="gi"&gt;+          path: ./site/public
&lt;/span&gt;   deploy:
     environment:
       name: github-pages
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure a &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain" rel="noopener noreferrer"&gt;custom domain apex domain&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We are going to publish our site via GitHub Actions, so we can skip setting &lt;code&gt;CNAME&lt;/code&gt; in step 4. And on step 5 we will set &lt;code&gt;AAAA&lt;/code&gt; records.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages" rel="noopener noreferrer"&gt;Verify the domain with GitHub&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And we are live!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Title is inspired by the &lt;a href="https://www.amazon.com/Show-Your-Work-Austin-Kleon/dp/076117897X" rel="noopener noreferrer"&gt;book of the same name&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>hugo</category>
      <category>github</category>
      <category>githubpages</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Almost Ready to Write</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Sun, 08 Feb 2026 12:09:29 +0000</pubDate>
      <link>https://forem.com/imomaliev/almost-ready-to-write-1lfi</link>
      <guid>https://forem.com/imomaliev/almost-ready-to-write-1lfi</guid>
      <description>&lt;p&gt;We have the site, we have the theme, and according to &lt;a href="https://gohugo.io/getting-started/quick-start/" rel="noopener noreferrer"&gt;the quickstart guide&lt;/a&gt;, we are ready to add content. But in actuality, not quite yet.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Start by deleting skeleton posts that were added with the theme.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; theme/content/posts
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'delete skeleton posts'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Default Hugo site and theme skeletons use TOML front matter, but I prefer using YAML, mainly because &lt;a href="https://docs.github.com/en/contributing/writing-for-github-docs/using-yaml-frontmatter" rel="noopener noreferrer"&gt;GitHub does not support TOML and JSON rendering in front matter&lt;/a&gt;&lt;sup id="fnref1"&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;Hugo has a handy tool to automatically convert between front matter styles.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;site/
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo convert toYAML &lt;span class="nt"&gt;--unsafe&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;We need to run with the &lt;code&gt;--unsafe&lt;/code&gt; flag; otherwise, it gives an error:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;ERROR command error: Unsafe operation not allowed, use --unsafe or set a different output path
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update archetypes to use YAML front matter in the site and theme; example below.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/theme/archetypes/default.md b/theme/archetypes/default.md
index 25b6752..c84c25b 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/theme/archetypes/default.md
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/theme/archetypes/default.md
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,5 +1,5 @@&lt;/span&gt;
&lt;span class="gd"&gt;-+++
-date = '{{ .Date }}'
-draft = true
-title = '{{ replace .File.ContentBaseName "-" " " | title }}'
-+++
&lt;/span&gt;&lt;span class="gi"&gt;+---
+title: "{{ replace .File.ContentBaseName `-` ` ` | title }}"
+date: "{{ .Date }}"
+draft: true
+---
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add our first &lt;a href="https://gohugo.io/content-management/sections/#article" rel="noopener noreferrer"&gt;section&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I will call it &lt;code&gt;Devlog&lt;/code&gt; and here I will write my blog development journey.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;theme/content/devlog
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;theme/content/devlog/_index.md
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Add section's front matter to &lt;code&gt;theme/content/devlog/_index.md&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Devlog"&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;And show it in menu&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/theme/hugo.toml b/theme/hugo.toml
index 5c26950..dccaed7 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/theme/hugo.toml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/theme/hugo.toml
&lt;/span&gt;&lt;span class="p"&gt;@@ -9,8 +9,8 @@&lt;/span&gt; title = 'My New Hugo Site'
     weight = 10
&lt;span class="err"&gt;
&lt;/span&gt;   [[menus.main]]
&lt;span class="gd"&gt;-    name = 'Posts'
-    pageRef = '/posts'
&lt;/span&gt;&lt;span class="gi"&gt;+    name = 'Devlog'
+    pageRef = '/devlog'
&lt;/span&gt;     weight = 20
&lt;span class="err"&gt;
&lt;/span&gt;   [[menus.main]]
&lt;span class="err"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Final touch.&lt;/p&gt;

&lt;p&gt;Cleanup &lt;code&gt;site/content/_index.md&lt;/code&gt; which contains content for the home page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We are ready to write and ready to publish.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://github.com/gohugoio/hugo/issues/5241#issuecomment-423469803" rel="noopener noreferrer"&gt;Comment in "consistency: hugo new site uses config.toml, but YAML for content" issue&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>hugo</category>
      <category>yaml</category>
    </item>
    <item>
      <title>Dogfooding a Theme</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Sun, 01 Feb 2026 14:50:46 +0000</pubDate>
      <link>https://forem.com/imomaliev/dogfooding-a-theme-pon</link>
      <guid>https://forem.com/imomaliev/dogfooding-a-theme-pon</guid>
      <description>&lt;p&gt;We've already created the Hugo site and pushed it to GitHub. Now is the time to set up our theme.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gohugo.io/getting-started/quick-start/" rel="noopener noreferrer"&gt;Quickstart&lt;/a&gt; suggests using an existing theme, but I want to create a custom one. I will store it in the same git repo because I do not have current plans of sharing it but still want it to be in a separate folder from the site.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;a href="https://gohugo.io/getting-started/directory-structure/#theme-skeleton" rel="noopener noreferrer"&gt;theme skeleton&lt;/a&gt; in the project root.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo new theme &lt;span class="nt"&gt;--themesDir&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; theme
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add theme
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'hugo new theme --themesDir . theme'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Instead of setting the theme via &lt;code&gt;theme&lt;/code&gt; config in &lt;code&gt;hugo.toml&lt;/code&gt; I will be importing it as a Hugo module. But first we need to &lt;a href="https://gohugo.io/hugo-modules/use-modules/#initialize-a-new-module" rel="noopener noreferrer"&gt;initialize the theme as a Go module&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;theme
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo mod init github.com/imomaliev/blog/theme
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'intitialize theme as a module'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we are ready to &lt;a href="https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme" rel="noopener noreferrer"&gt;initialize the site's module system&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;site
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo mod init github.com/imomaliev/blog
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'initialize the hugo module system'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add module imports.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/site/hugo.toml b/site/hugo.toml
index 7e568b8..f106f4e 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/site/hugo.toml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/site/hugo.toml
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,3 +1,7 @@&lt;/span&gt;
 baseURL = 'https://example.org/'
 languageCode = 'en-us'
 title = 'My New Hugo Site'
&lt;span class="gi"&gt;+
+[module]
+  [[module.imports]]
+    path = 'github.com/imomaliev/blog/theme'
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, because our theme is in the same repo, we can just use &lt;a href="https://gohugo.io/hugo-modules/use-modules/#make-and-test-changes-in-a-module" rel="noopener noreferrer"&gt;&lt;code&gt;replacements&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/site/hugo.toml b/site/hugo.toml
index f106f4e..4dba0ec 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/site/hugo.toml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/site/hugo.toml
&lt;/span&gt;&lt;span class="p"&gt;@@ -3,5 +3,7 @@&lt;/span&gt; languageCode = 'en-us'
 title = 'My New Hugo Site'
&lt;span class="err"&gt;
&lt;/span&gt; [module]
&lt;span class="gi"&gt;+  replacements = 'github.com/imomaliev/blog/theme -&amp;gt; ../../theme'
+
&lt;/span&gt;   [[module.imports]]
        path = 'github.com/imomaliev/blog/theme'
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Commit changes.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'import local theme'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we can run the dev server.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo server &lt;span class="nt"&gt;-D&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>hugo</category>
      <category>hugotheme</category>
      <category>hugomodules</category>
    </item>
    <item>
      <title>Create a Site</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Wed, 28 Jan 2026 22:26:43 +0000</pubDate>
      <link>https://forem.com/imomaliev/create-a-site-17hc</link>
      <guid>https://forem.com/imomaliev/create-a-site-17hc</guid>
      <description>&lt;p&gt;I will start at the very "beginning" and go through the &lt;a href="https://gohugo.io/getting-started/quick-start/" rel="noopener noreferrer"&gt;official quickstart guide&lt;/a&gt;. My goal is to achieve the same results so I can start blogging ASAP but I will be doing it a bit differently than how it is outlined in the guide. I will explain my decisions along the way. So let's create the Hugo site.&lt;/p&gt;

&lt;p&gt;The quickstart docs suggest creating a new site skeleton and initializing git in the created site's root.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo new site quickstart
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;quickstart
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my opinion, this is not as good as having a separate folder that will contain the site. Modern blogs have pretty complex folder structures and require additional folders that store CI configs, helper scripts, and other stuff that is part of the blog project but not part of the blog's site.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;I start by creating an empty repo first.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git init blog
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;blog
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then add an empty initial commit.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;--allow-empty&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'empty initial commit'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Why? It is just better convention in case you want to rewrite history from the beginning. &lt;sup id="fnref1"&gt;1&lt;/sup&gt;&lt;sup id="fnref2"&gt;2&lt;/sup&gt;&lt;sup id="fnref3"&gt;3&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Yes, in most cases you can do &lt;code&gt;git rebase -i --root&lt;/code&gt;, but this won't work if you need to split the initial commit into separate ones.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we are ready to create a site skeleton.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo new site site
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hugo add site
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'hugo new site site'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set up &lt;code&gt;.gitingore&lt;/code&gt; for &lt;code&gt;site&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you didn't know, GitHub stores common &lt;code&gt;.gitignore&lt;/code&gt; files at &lt;a href="https://github.com/github/gitignore" rel="noopener noreferrer"&gt;https://github.com/github/gitignore&lt;/a&gt;. It is a good practice to set it up right away to avoid accidentally adding junk to the repo.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;curl &lt;span class="nt"&gt;-o&lt;/span&gt; site/.gitignore https://raw.githubusercontent.com/github/gitignore/refs/heads/main/community/Golang/Hugo.gitignore
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add site/.gitignore
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;I also add the link to the source and license at the top.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/site/.gitignore b/site/.gitignore
index 86c95ef..b1f826c 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/site/.gitignore
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/site/.gitignore
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,6 +1,3 @@&lt;/span&gt;
&lt;span class="gi"&gt;+# Copied from: https://github.com/github/gitignore/blob/main/community/Golang/Hugo.gitignore
+# License: CC0 1.0 Universal
+
&lt;/span&gt; # Generated files by hugo
 /public/
 /resources/_gen/
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Commit changes.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git add &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'add .gitignore for site'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository" rel="noopener noreferrer"&gt;Create an empty GitHub repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Call it &lt;code&gt;blog&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Push the code&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git remote add origin git@github.com:imomaliev/blog.git
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://www.garfieldtech.com/blog/git-empty-commit" rel="noopener noreferrer"&gt;https://www.garfieldtech.com/blog/git-empty-commit&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/a/14630424/3627387" rel="noopener noreferrer"&gt;https://stackoverflow.com/a/14630424/3627387&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn3"&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/a/23000315/3627387" rel="noopener noreferrer"&gt;https://stackoverflow.com/a/23000315/3627387&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>hugo</category>
      <category>github</category>
      <category>git</category>
    </item>
    <item>
      <title>Fresh Start</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Wed, 28 Jan 2026 22:23:44 +0000</pubDate>
      <link>https://forem.com/imomaliev/fresh-start-2b2p</link>
      <guid>https://forem.com/imomaliev/fresh-start-2b2p</guid>
      <description>&lt;p&gt;I tend to be overly obsessive and pedantic when it comes to finding answers, especially when I'm looking for a "better" way to do something. I sometimes spend hours falling deeper into the rabbit hole of a perfectionist's spiral: a quick web search for one question can lead to dozens of open tabs. I constantly get sidetracked by the cascade of follow-up questions that appear one after another, steering me further and further from my original goal. I'd describe it as an unshakeable belief that there must be a better option, which causes intense frustration when you can't find it—or worse, when you know it's just out of reach.&lt;/p&gt;

&lt;p&gt;I've learned to work through this feeling and keep it at bay, especially at work, but sometimes it's so strong that it cripples my productivity and creativity. I'm pretty sure many people would relate: instead of actually doing something, I spend more time thinking about and researching how to do it more efficiently or correctly. Some may call it procrastination or even a clinical issue, but after years of fighting it I decided to embrace it by creating a safe space for these obsessive tendencies to run wild. I cautiously believe this approach may actually improve my long-term productivity.&lt;/p&gt;

&lt;p&gt;However, going full &lt;del&gt;manic&lt;/del&gt; perfectionist from the start proved to be too much. I tried to restart my blog in October 2025, but after two weeks I became overwhelmed trying to address every little detail. There are so many decisions to make in any project, so I will start simple and use familiar technologies and approaches just to get things moving. Last time I struggled with consistency mostly because I tried to do everything perfectly, which ultimately drowned me.&lt;/p&gt;

&lt;p&gt;My plan is to start with these decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;a href="https://gohugo.io/" rel="noopener noreferrer"&gt;Hugo&lt;/a&gt; SSG&lt;/li&gt;
&lt;li&gt;Host the source code on &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Publish the blog via &lt;a href="https://docs.github.com/en/pages" rel="noopener noreferrer"&gt;GitHub Pages&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'll record the progress of &lt;a href="https://www.youtube.com/watch?v=L2zqTYgcpfg" rel="noopener noreferrer"&gt;"Building the plane while flying it"&lt;/a&gt; as a Devlog section in my blog.&lt;/p&gt;

</description>
      <category>hugo</category>
      <category>github</category>
      <category>githubpages</category>
    </item>
    <item>
      <title>The strongest principle of the blog's growth lies in the human choice to deploy it</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Sat, 03 Sep 2022 11:21:53 +0000</pubDate>
      <link>https://forem.com/imomaliev/the-strongest-principle-of-the-blogs-growth-lies-in-the-human-choice-to-deploy-it-3ed9</link>
      <guid>https://forem.com/imomaliev/the-strongest-principle-of-the-blogs-growth-lies-in-the-human-choice-to-deploy-it-3ed9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The strongest principle of growth lies in the human choice&lt;/em&gt;&lt;sup id="fnref1"&gt;1&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Build Hugo With GitHub Action
&lt;/h2&gt;

&lt;p&gt;It is time to put our blog on the internet. &lt;a href="https://github.com/imomaliev/blog" rel="noopener noreferrer"&gt;Source code&lt;/a&gt; is stored on GitHub, so hosting it on the &lt;a href="https://pages.github.com" rel="noopener noreferrer"&gt;GitHub Pages&lt;/a&gt; seems like the easiest way to achieve that. A good starting point will be just using &lt;a href="https://gohugo.io/hosting-and-deployment/hosting-on-github" rel="noopener noreferrer"&gt;official Hugo docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We will need to configure our workflow to properly build TailwindCSS which is used in this project, and also I would like to use my own domain name instead of provided one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Workflow from example
&lt;/h3&gt;

&lt;p&gt;Documentation provides an example workflow file that uses &lt;a href="https://github.com/marketplace/actions/hugo-setup" rel="noopener noreferrer"&gt;GitHub Actions for Hugo&lt;/a&gt; action in the "Build Hugo With GitHub Action" section. It is ok to use it, but I will use combination of 2 examples (&lt;a href="https://github.com/peaceiris/actions-hugo#%EF%B8%8F-create-your-workflow" rel="noopener noreferrer"&gt;1&lt;/a&gt;, &lt;a href="https://github.com/peaceiris/actions-hugo#%EF%B8%8F-workflow-for-autoprefixer-and-postcss-cli" rel="noopener noreferrer"&gt;2&lt;/a&gt;) from GitHub Actions for Hugo's README because it has one for projects using PostCSS.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GitHub Pages&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt; &lt;span class="c1"&gt;# Set a branch to deploy&lt;/span&gt;
    &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-20.04&lt;/span&gt;
        &lt;span class="na"&gt;concurrency&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.workflow }}-${{ github.ref }}&lt;/span&gt;
        &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;
              &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;submodules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# Fetch Hugo themes (true OR recursive)&lt;/span&gt;
                  &lt;span class="na"&gt;fetch-depth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="c1"&gt;# Fetch all history for .GitInfo and .Lastmod&lt;/span&gt;

            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup Hugo&lt;/span&gt;
              &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;peaceiris/actions-hugo@v2&lt;/span&gt;
              &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;hugo-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0.91.2'&lt;/span&gt;
                  &lt;span class="c1"&gt;# extended: true&lt;/span&gt;

            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup Node&lt;/span&gt;
              &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v3&lt;/span&gt;
              &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;14'&lt;/span&gt;

            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Cache dependencies&lt;/span&gt;
              &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/cache@v2&lt;/span&gt;
              &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;~/.npm&lt;/span&gt;
                  &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}&lt;/span&gt;
                  &lt;span class="na"&gt;restore-keys&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                      &lt;span class="s"&gt;${{ runner.os }}-node-&lt;/span&gt;

            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;

            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
              &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;hugo --minify&lt;/span&gt;

            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
              &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;peaceiris/actions-gh-pages@v3&lt;/span&gt;
              &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref == 'refs/heads/main' }}&lt;/span&gt;
              &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;github_token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
                  &lt;span class="na"&gt;publish_dir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./public&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will save it as &lt;code&gt;.github/workflows/gh-pages.yaml&lt;/code&gt;. &lt;strong&gt;NOTE:&lt;/strong&gt; I prefer using &lt;code&gt;yaml&lt;/code&gt; extension instead of &lt;code&gt;yml&lt;/code&gt;&lt;sup id="fnref2"&gt;2&lt;/sup&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Updating workflow to make it work in our project
&lt;/h3&gt;

&lt;p&gt;The workflow file I copied from GitHub Actions for Hugo action wouldn't work for our project structure. Additionally, I would like to make some improvements. Mainly&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Add comments for the parts that are new to me or may be confusing in the future&lt;/li&gt;
&lt;li&gt;  Add links to documentation for used actions&lt;/li&gt;
&lt;li&gt;  Update and freeze actions' and packages' versions. I decided to use the same versions that I am using locally.&lt;/li&gt;
&lt;li&gt;  Add &lt;code&gt;working-directory: ./blog&lt;/code&gt; &lt;a href="https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun" rel="noopener noreferrer"&gt;option&lt;/a&gt; to jobs because actual blog source files not located in the root of the project, but in the &lt;code&gt;blog/&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;  Remove unused parts of the workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;but some changes may not be so obvious, so let's discuss them&lt;/p&gt;

&lt;h4&gt;
  
  
  Using setup-node action's cache option
&lt;/h4&gt;

&lt;p&gt;In the copied example, npm caching is done via &lt;a href="https://github.com/actions/cache" rel="noopener noreferrer"&gt;&lt;code&gt;actions/cache@v2&lt;/code&gt;&lt;/a&gt; action. But we can simplify our workflow by dropping this step and using &lt;a href="https://github.com/actions/setup-node#caching-global-packages-data" rel="noopener noreferrer"&gt;built-in functionality for caching&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml
index 401fd33..3ddf6dd 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.github/workflows/gh-pages.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.github/workflows/gh-pages.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -26,18 +26,17 @@&lt;/span&gt; jobs:
                   hugo-version: '0.91.2'
                   # extended: true
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+            # https://github.com/actions/setup-node
&lt;/span&gt;             - name: Setup Node
               uses: actions/setup-node@v3
               with:
&lt;span class="gd"&gt;-                  node-version: '14'
-
-            - name: Cache dependencies
-              uses: actions/cache@v2
-              with:
-                  path: ~/.npm
-                  key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
-                  restore-keys: |
-                      ${{ runner.os }}-node-
&lt;/span&gt;&lt;span class="gi"&gt;+                  node-version: '18.7.0'
+                  cache: npm
+                  # The action defaults to search for the dependency file (package-lock.json,
+                  # npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
+                  # hash as a part of the cache key.
+                  # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
+                  cache-dependency-path: ./blog/package-lock.json
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I thought that this change will be useful for all "Setup Hugo" users, so I've created &lt;a href="https://github.com/peaceiris/actions-hugo/pull/602" rel="noopener noreferrer"&gt;PR with these changes&lt;/a&gt; to update action's example. PR was accepted right away.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qtleo4hvf50bda7ijwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qtleo4hvf50bda7ijwi.png" alt="setup hugo PR" width="800" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;so if you follow the same steps as I did, you will not have to do this manually 😎.&lt;/p&gt;

&lt;h4&gt;
  
  
  Building blog in node environment
&lt;/h4&gt;

&lt;p&gt;For some reason, when the blog built normally via &lt;code&gt;hugo --minify&lt;/code&gt; PostCSS does not pick up TailwindCSS's styles. I solve this by running &lt;code&gt;hugo server&lt;/code&gt; and build from NPM's environment via custom &lt;code&gt;npm run build&lt;/code&gt; script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml
index 401fd33..3ddf6dd 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.github/workflows/gh-pages.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.github/workflows/gh-pages.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -39,10 +39,13 @@&lt;/span&gt; jobs:
                   restore-keys: |
                       ${{ runner.os }}-node-
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gd"&gt;-            - run: npm ci
&lt;/span&gt;&lt;span class="gi"&gt;+            - name: Install npm dependencies
+              working-directory: ./blog/
+              run: npm ci
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;             - name: Build
&lt;span class="gd"&gt;-              run: hugo --minify
&lt;/span&gt;&lt;span class="gi"&gt;+              working-directory: ./blog/
+              run: npm run build
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;             - name: Deploy
               uses: peaceiris/actions-gh-pages@v3
&lt;span class="gh"&gt;diff --git a/blog/package.json b/blog/package.json
index 4a4876d..49334d7 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/package.json
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/package.json
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,6 +1,7 @@&lt;/span&gt;
 {
   "scripts": {
&lt;span class="gd"&gt;-    "start": "hugo --source src server --baseURL http://localhost/"
&lt;/span&gt;&lt;span class="gi"&gt;+    "start": "hugo --source src server --baseURL http://localhost/",
+    "build": "hugo --source src --minify"
&lt;/span&gt;   },
   "devDependencies": {
     "@tailwindcss/typography": "^0.5.4",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Use Ubuntu 22.04
&lt;/h4&gt;

&lt;p&gt;You also may have noticed that we are using Ubuntu 22.04. On August 9, 2022 this version become &lt;a href="https://github.blog/changelog/2022-08-09-github-actions-ubuntu-22-04-is-now-generally-available-on-github-hosted-runners/" rel="noopener noreferrer"&gt;generally available&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I started by using &lt;code&gt;runs-on: ubuntu-22.04&lt;/code&gt; in this workflow to check if everything works ok. It run without any issues. After that I created PRs to add support for &lt;code&gt;ubuntu-22.04&lt;/code&gt; and &lt;code&gt;ubuntu-latest&lt;/code&gt; version to &lt;a href="https://github.com/peaceiris/actions-hugo/pull/603" rel="noopener noreferrer"&gt;GitHub Actions for Hugo&lt;/a&gt; and &lt;a href="https://github.com/peaceiris/actions-gh-pages/pull/776" rel="noopener noreferrer"&gt;GitHub Pages Action&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Final diff of changes
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml
index 401fd33..3ddf6dd 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.github/workflows/gh-pages.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.github/workflows/gh-pages.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -11,42 +11,48 @@&lt;/span&gt; on:
&lt;span class="err"&gt;
&lt;/span&gt; jobs:
     deploy:
&lt;span class="gd"&gt;-        runs-on: ubuntu-20.04
&lt;/span&gt;&lt;span class="gi"&gt;+        runs-on: ubuntu-22.04
+        # Ensure that only a single job or workflow
+        # https://docs.github.com/en/actions/using-jobs/using-concurrency
&lt;/span&gt;         concurrency:
&lt;span class="gi"&gt;+            # workflow - The name of the workflow.
+            # ref - The branch or tag ref that triggered the workflow run.
&lt;/span&gt;             group: ${{ github.workflow }}-${{ github.ref }}
         steps:
             - uses: actions/checkout@v3
               with:
&lt;span class="gd"&gt;-                  submodules: true # Fetch Hugo themes (true OR recursive)
&lt;/span&gt;                   fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+            # https://github.com/peaceiris/actions-hugo
&lt;/span&gt;             - name: Setup Hugo
               uses: peaceiris/actions-hugo@v2
               with:
&lt;span class="gd"&gt;-                  hugo-version: '0.91.2'
-                  # extended: true
&lt;/span&gt;&lt;span class="gi"&gt;+                  hugo-version: '0.101.0'
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+            # https://github.com/actions/setup-node
&lt;/span&gt;             - name: Setup Node
               uses: actions/setup-node@v3
               with:
&lt;span class="gd"&gt;-                  node-version: '14'
-
-            - name: Cache dependencies
-              uses: actions/cache@v2
-              with:
-                  path: ~/.npm
-                  key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
-                  restore-keys: |
-                      ${{ runner.os }}-node-
-
-            - run: npm ci
&lt;/span&gt;&lt;span class="gi"&gt;+                  node-version: '18.7.0'
+                  cache: npm
+                  # The action defaults to search for the dependency file (package-lock.json,
+                  # npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
+                  # hash as a part of the cache key.
+                  # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
+                  cache-dependency-path: ./blog/package-lock.json
+
+            - name: Install npm dependencies
+              working-directory: ./blog/
+              run: npm ci
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;             - name: Build
&lt;span class="gd"&gt;-              run: hugo --minify
&lt;/span&gt;&lt;span class="gi"&gt;+              working-directory: ./blog/
+              run: npm run build
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+            # https://github.com/peaceiris/actions-gh-pages
&lt;/span&gt;             - name: Deploy
               uses: peaceiris/actions-gh-pages@v3
               if: ${{ github.ref == 'refs/heads/main' }}
               with:
                   github_token: ${{ secrets.GITHUB_TOKEN }}
&lt;span class="gd"&gt;-                  publish_dir: ./public
&lt;/span&gt;&lt;span class="gi"&gt;+                  publish_dir: ./blog/src/public
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deploy to GitHub Pages
&lt;/h2&gt;

&lt;p&gt;The workflow we added will create &lt;code&gt;gh-pages&lt;/code&gt; branch in our repo automatically after the first run. All that left to do is to update repository configuration to use this branch for &lt;a href="https://pages.github.com" rel="noopener noreferrer"&gt;GitHub Pages&lt;/a&gt;. By default, Pages should pick up and deploy files from the &lt;code&gt;gh-pages&lt;/code&gt; branch, but due to &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; limitation we need to set Pages's branch manually. Read more in the &lt;a href="https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-first-deployment-with-github_token" rel="noopener noreferrer"&gt;GitHub Pages Action's docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I wanted to configure GitHub Pages using terraform because this project already uses it to configure this repository. But currently, due to how GitHub provider for terraform is written, configuring Pages &lt;a href="https://github.com/integrations/terraform-provider-github/issues/782" rel="noopener noreferrer"&gt;requires some fiddling&lt;/a&gt; and will not work on the first run. During my research into how I could achieve declarative configuration for Pages, I found out that &lt;a href="https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/" rel="noopener noreferrer"&gt;GitHub recently added&lt;/a&gt; actions that allow deploying to Pages without additional branch. I like this &lt;a href="https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml" rel="noopener noreferrer"&gt;new approach&lt;/a&gt; better and in the future I will switch to it, but for now I decided to configure Pages manually as suggested by GitHub Pages Action that we are using.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bugs
&lt;/h2&gt;

&lt;p&gt;There are few bugs that I stumbled upon while applying these changes to my blog and writing about them&lt;/p&gt;

&lt;h3&gt;
  
  
  YAML multistring rendering
&lt;/h3&gt;

&lt;p&gt;While I was re-reading this article to find issues in my spelling. I noticed something weird&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbcct0v8a384xluouck5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbcct0v8a384xluouck5.png" alt="chroma-bug" width="800" height="209"&gt;&lt;/a&gt;&lt;br&gt;
this is definitely a bug. I started looking into it. At first, I thought the issue is in Hugo itself, but after trying to &lt;a href="https://en.wikipedia.org/wiki/Minimal_reproducible_example" rel="noopener noreferrer"&gt;make minimal reproducible example&lt;/a&gt; I was falling deeper and deeper in the rabbithole of dependencies. Turns out the issue was 4 layers deep.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gohugoio/hugo" rel="noopener noreferrer"&gt;Hugo&lt;/a&gt; -&amp;gt; &lt;a href="https://github.com/yuin/goldmark" rel="noopener noreferrer"&gt;goldmark&lt;/a&gt; -&amp;gt; &lt;a href="https://github.com/yuin/goldmark-highlighting" rel="noopener noreferrer"&gt;goldmark-highlighting&lt;/a&gt; -&amp;gt; &lt;a href="https://github.com/alecthomas/chroma" rel="noopener noreferrer"&gt;chroma&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there is already a &lt;a href="https://github.com/alecthomas/chroma/issues/475" rel="noopener noreferrer"&gt;bug report&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I may have tried to fix it, but I think it may take way too much time because I do not have any experience with Go. So, I will leave this issue as is for now. Maybe in the future it will be a fun project to practice Go development.&lt;/p&gt;

&lt;h3&gt;
  
  
  baseURL causing images with leading &lt;code&gt;/&lt;/code&gt; render incorrectly
&lt;/h3&gt;

&lt;p&gt;I noticed that after deployment images were broken after further research it became clear that this happens because we are using &lt;code&gt;baseURL&lt;/code&gt; with path - &lt;a href="https://imomaliev.github.io/blog/" rel="noopener noreferrer"&gt;https://imomaliev.github.io/blog/&lt;/a&gt;. This is &lt;a href="https://github.com/gohugoio/hugo/issues/8078" rel="noopener noreferrer"&gt;known behavior&lt;/a&gt;. It does look like a bug to me, but maintainers decided to close this issue as &lt;a href="https://github.com/gohugoio/hugo/issues/8078#issuecomment-748561750" rel="noopener noreferrer"&gt;"wontfix"&lt;/a&gt; for now. In the future, I am planning to host this blog on my domain without additional path in &lt;code&gt;baseURL&lt;/code&gt;, but for now I fixed it by using relative paths instead ones starting with leading &lt;code&gt;/&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-![setup hugo PR](/building-the-blog-while-flying-it/07-the-strongest-principle-of-the-blogs-growth-lies-in-the-human-choice-to-deploy-it/setup-hugo-pr.png)
&lt;/span&gt;&lt;span class="gi"&gt;+![setup hugo PR](./setup-hugo-pr.png)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, another future exercise for myself will be to bring this issue to proper resolution in Hugo itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  No custom domain for now
&lt;/h2&gt;

&lt;p&gt;This article is already becoming pretty big, I think we will switch this blog to use custom domain in some other time. My plan is to do this via terraform as well, so stay tuned for this series.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/imomaliev/blog" rel="noopener noreferrer"&gt;https://github.com/imomaliev/blog&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/hosting-and-deployment/hosting-on-github/" rel="noopener noreferrer"&gt;https://gohugo.io/hosting-and-deployment/hosting-on-github/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://pages.github.com" rel="noopener noreferrer"&gt;https://pages.github.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/marketplace/actions/hugo-setup" rel="noopener noreferrer"&gt;https://github.com/marketplace/actions/hugo-setup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/peaceiris/actions-hugo#%EF%B8%8F-create-your-workflow" rel="noopener noreferrer"&gt;https://github.com/peaceiris/actions-hugo#%EF%B8%8F-create-your-workflow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/peaceiris/actions-hugo#%EF%B8%8F-workflow-for-autoprefixer-and-postcss-cli" rel="noopener noreferrer"&gt;https://github.com/peaceiris/actions-hugo#%EF%B8%8F-workflow-for-autoprefixer-and-postcss-cli&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun" rel="noopener noreferrer"&gt;https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/actions/cache" rel="noopener noreferrer"&gt;https://github.com/actions/cache&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/actions/setup-node#caching-global-packages-data" rel="noopener noreferrer"&gt;https://github.com/actions/setup-node#caching-global-packages-data&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/peaceiris/actions-hugo/pull/602" rel="noopener noreferrer"&gt;https://github.com/peaceiris/actions-hugo/pull/602&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.blog/changelog/2022-08-09-github-actions-ubuntu-22-04-is-now-generally-available-on-github-hosted-runners/" rel="noopener noreferrer"&gt;https://github.blog/changelog/2022-08-09-github-actions-ubuntu-22-04-is-now-generally-available-on-github-hosted-runners/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/peaceiris/actions-hugo/pull/603" rel="noopener noreferrer"&gt;https://github.com/peaceiris/actions-hugo/pull/603&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/peaceiris/actions-gh-pages/pull/776" rel="noopener noreferrer"&gt;https://github.com/peaceiris/actions-gh-pages/pull/776&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://en.wikipedia.org/wiki/Minimal_reproducible_example" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Minimal_reproducible_example&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/gohugoio/hugo" rel="noopener noreferrer"&gt;https://github.com/gohugoio/hugo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/yuin/goldmark" rel="noopener noreferrer"&gt;https://github.com/yuin/goldmark&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/yuin/goldmark-highlighting" rel="noopener noreferrer"&gt;https://github.com/yuin/goldmark-highlighting&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/alecthomas/chroma/issues/475" rel="noopener noreferrer"&gt;https://github.com/alecthomas/chroma/issues/475&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://pages.github.com" rel="noopener noreferrer"&gt;https://pages.github.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/integrations/terraform-provider-github/issues/782" rel="noopener noreferrer"&gt;https://github.com/integrations/terraform-provider-github/issues/782&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/" rel="noopener noreferrer"&gt;https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml" rel="noopener noreferrer"&gt;https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/gohugoio/hugo/issues/8078" rel="noopener noreferrer"&gt;https://github.com/gohugoio/hugo/issues/8078&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/gohugoio/hugo/issues/8078#issuecomment-748561750" rel="noopener noreferrer"&gt;https://github.com/gohugoio/hugo/issues/8078#issuecomment-748561750&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://www.brainyquote.com/quotes/george_eliot_382778" rel="noopener noreferrer"&gt;Quote by George Eliot&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;&lt;a href="https://yaml.org/faq.html" rel="noopener noreferrer"&gt;Please use ".yaml" when possible.&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>hugo</category>
      <category>terraform</category>
      <category>githubactions</category>
      <category>githubpages</category>
    </item>
    <item>
      <title>If you're going to blog about something, do it with style</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Mon, 08 Aug 2022 07:34:00 +0000</pubDate>
      <link>https://forem.com/imomaliev/if-youre-going-to-blog-about-something-do-it-with-style-idf</link>
      <guid>https://forem.com/imomaliev/if-youre-going-to-blog-about-something-do-it-with-style-idf</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If you're going to do something, do it with style!&lt;/em&gt;&lt;sup id="fnref1"&gt;1&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Where are my styles?
&lt;/h2&gt;

&lt;p&gt;We've just installed TailwindCSS to our project and ready to start adding styles to make it look better, but for some reason it now looks worse than before we installed it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8fr0uabs01oddtr5ffef.png" alt="before" width="800" height="533"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71tgtetq5ogzuae3465t.png" alt="after" width="800" height="533"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="https://tailwindcss.com/docs/preflight" rel="noopener noreferrer"&gt;Preflight configuration&lt;/a&gt; is a culprit who "stole" our styles. I've dealt with it on one of my different series &lt;a href="https://dev.to/imomaliev/vite-vue-ts-tailwind-template-convert-styles-to-tailwindcss-classes-and-configs-part-3-467c"&gt;Vite vue ts tailwind template&lt;/a&gt;. I am going to quote docs here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Built on top of modern-normalize, Preflight is a set of base styles for Tailwind projects that are designed to smooth over cross-browser inconsistencies and make it easier for you to work within the constraints of your design system.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Basically to have consistent styles across all browsers some elements have extra styles, some have disabled styles and some like &lt;a href="https://tailwindcss.com/docs/preflight#headings-are-unstyled" rel="noopener noreferrer"&gt;headings for example&lt;/a&gt; are unstyled completely.&lt;/p&gt;

&lt;p&gt;With that out of the way, let's start styling our blog, and to help us speed things up we are going to use the official TailwindCSS &lt;a href="https://tailwindcss.com/docs/typography-plugin" rel="noopener noreferrer"&gt;typography plugin&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding typography plugin
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install plugin&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; @tailwindcss/typography
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;code&gt;plugins&lt;/code&gt; entry in &lt;code&gt;tailwind.config.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/tailwind.config.js b/blog/tailwind.config.js
index 9d0ca2f..586083d 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/tailwind.config.js
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/tailwind.config.js
&lt;/span&gt;&lt;span class="p"&gt;@@ -4,5 +4,5 @@&lt;/span&gt; module.exports = {
   theme: {
     extend: {},
   },
&lt;span class="gd"&gt;-  plugins: [],
&lt;/span&gt;&lt;span class="gi"&gt;+  plugins: [require('@tailwindcss/typography')],
&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we can add &lt;code&gt;prose&lt;/code&gt; styles to our html.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/_default/single.html b/blog/src/layouts/_default/single.html
index 560541c..6cc083d 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/_default/single.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/_default/single.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,5 +1,5 @@&lt;/span&gt;
 {{ define "main" }}
&lt;span class="gd"&gt;-    &amp;lt;article&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+    &amp;lt;article class="prose"&amp;gt;
&lt;/span&gt;         &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
         {{ .Content }}
     &amp;lt;/article&amp;gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;right away we see improvements&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1vwcgec753x15zrdfy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1vwcgec753x15zrdfy1.png" alt="typography applied" width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We will take it one step further by centering content and adding breakpoint modifiers.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/_default/single.html b/blog/src/layouts/_default/single.html
index 560541c..6cc083d 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/_default/single.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/_default/single.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,5 +1,5 @@&lt;/span&gt;
 {{ define "main" }}
&lt;span class="gd"&gt;-    &amp;lt;article class="prose"&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+    &amp;lt;article class="prose prose-sm prose-table:table-fixed lg:prose-lg xl:prose-xl 2xl:prose-2xl mx-auto"&amp;gt;
&lt;/span&gt;         &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
         {{ .Content }}
     &amp;lt;/article&amp;gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbhuk1sri7rlim9dfyse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbhuk1sri7rlim9dfyse.png" alt="typography-final" width="800" height="508"&gt;&lt;/a&gt;&lt;br&gt;
much better. You may have noted that I also added &lt;a href="https://tailwindcss.com/docs/typography-plugin#element-modifiers" rel="noopener noreferrer"&gt;&lt;code&gt;prose-table:table-fixed&lt;/code&gt;&lt;/a&gt; element modifier. This is to ensure that our tables in articles will be fixed size.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Adding styles to headers
&lt;/h2&gt;

&lt;p&gt;For now, we will just increase header sizes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/index.html b/blog/src/layouts/index.html
index 4fbcad1..9c1cdd3 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/index.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/index.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,8 +1,10 @@&lt;/span&gt;
 {{ define "main" }}
&lt;span class="gd"&gt;-    &amp;lt;h1&amp;gt;{{ .Site.Title }}&amp;lt;/h1&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+    &amp;lt;h1 class="text-5xl font-bold"&amp;gt;{{ .Site.Title }}&amp;lt;/h1&amp;gt;
&lt;/span&gt;     {{ range .Pages }}
         &amp;lt;article&amp;gt;
&lt;span class="gd"&gt;-            &amp;lt;h2&amp;gt;&amp;lt;a href="{{ .Permalink }}"&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+            &amp;lt;h2 class="text-4xl underline"&amp;gt;
+                &amp;lt;a href="{{ .Permalink }}"&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;
+            &amp;lt;/h2&amp;gt;
&lt;/span&gt;         &amp;lt;/article&amp;gt;
     {{ end }}
 {{ end }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and do the same in &lt;code&gt;blog/src/layouts/_default/list.html&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Automatic Class Sorting with Prettier
&lt;/h2&gt;

&lt;p&gt;Having utility css classes in html can be very verbose and cumbersome. It is easy to make our code hard to follow. To help us with that, we can &lt;a href="https://tailwindcss.com/blog/automatic-class-sorting-with-prettier" rel="noopener noreferrer"&gt;automatically sort them&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We are using prettier as pre-commit hook so instead of installing &lt;a href="https://github.com/tailwindlabs/prettier-plugin-tailwindcss" rel="noopener noreferrer"&gt;&lt;code&gt;prettier-plugin-tailwindcss&lt;/code&gt;&lt;/a&gt; as npm dependency we will add it as &lt;code&gt;additional_dependency&lt;/code&gt; for our &lt;code&gt;prettier&lt;/code&gt; hook.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b8b2f7f..0b88113 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/.pre-commit-config.yaml
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/.pre-commit-config.yaml
&lt;/span&gt;&lt;span class="p"&gt;@@ -26,6 +26,7 @@&lt;/span&gt; repos:
             additional_dependencies:
                 - "prettier@2.7.1"
                 - "prettier-plugin-go-template@0.0.13"
&lt;span class="gi"&gt;+                - "prettier-plugin-tailwindcss@0.1.12"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Typography plugin classes not sorted
&lt;/h3&gt;

&lt;p&gt;For some reason, &lt;code&gt;@tailwindcss/typography&lt;/code&gt;'s classes not sorted. I tried different options, but couldn't make it work. I have &lt;a href="https://github.com/tailwindlabs/tailwindcss/discussions/8921" rel="noopener noreferrer"&gt;started discussion&lt;/a&gt;, this looks like a bug to me, but maybe I am missing something.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://tailwindcss.com/docs/preflight" rel="noopener noreferrer"&gt;https://tailwindcss.com/docs/preflight&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://dev.to/imomaliev/vite-vue-ts-tailwind-template-convert-styles-to-tailwindcss-classes-and-configs-part-3-467c"&gt;https://dev.to/imomaliev/vite-vue-ts-tailwind-template-convert-styles-to-tailwindcss-classes-and-configs-part-3-467c&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://tailwindcss.com/docs/preflight#headings-are-unstyled" rel="noopener noreferrer"&gt;https://tailwindcss.com/docs/preflight#headings-are-unstyled&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/tailwindlabs/prettier-plugin-tailwindcss" rel="noopener noreferrer"&gt;https://github.com/tailwindlabs/prettier-plugin-tailwindcss&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://tailwindcss.com/docs/typography-plugin" rel="noopener noreferrer"&gt;https://tailwindcss.com/docs/typography-plugin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/tailwindlabs/tailwindcss/discussions/8921" rel="noopener noreferrer"&gt;https://github.com/tailwindlabs/tailwindcss/discussions/8921&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://www.brainyquote.com/quotes/jason_statham_760998" rel="noopener noreferrer"&gt;Quote by Jason Statham&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>hugo</category>
      <category>tailwindcss</category>
      <category>precommit</category>
      <category>prettier</category>
    </item>
    <item>
      <title>To fly you need a tailwind</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Wed, 20 Jul 2022 15:47:07 +0000</pubDate>
      <link>https://forem.com/imomaliev/to-fly-you-need-a-tailwind-a9l</link>
      <guid>https://forem.com/imomaliev/to-fly-you-need-a-tailwind-a9l</guid>
      <description>&lt;h2&gt;
  
  
  Why TailwindCSS
&lt;/h2&gt;

&lt;p&gt;In one of my previous projects, I fell in love with &lt;a href="https://tailwindcss.com" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt;. I know that this is a very controversial framework for some, but for me, personally, as a backend developer of 11 years, it was the first time I had a fun time adding styles to the frontend. I even created &lt;a href="https://github.com/imomaliev/vue-ts-tailwind" rel="noopener noreferrer"&gt;vue-ts template&lt;/a&gt; with it, as a part of &lt;a href="https://dev.to/imomaliev/series/13950"&gt;another articles' series&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Asset management in Hugo
&lt;/h2&gt;

&lt;p&gt;There are few ways to add CSS library to our blog, because Hugo supports multiple ways to do &lt;a href="https://gohugo.io/categories/asset-management" rel="noopener noreferrer"&gt;asset management&lt;/a&gt;. If you used TailwindCSS before you may know that to better integrate with other build tools, like webpack, Vite etc., it supports &lt;a href="https://postcss.org" rel="noopener noreferrer"&gt;PostCSS&lt;/a&gt; out of the box. Luckily for us, Hugo &lt;a href="https://gohugo.io/hugo-pipes/postcss/" rel="noopener noreferrer"&gt;supports it as well&lt;/a&gt;. We are going to install TailwindCSS as a PostCSS plugin and then use Hugo's &lt;code&gt;PostCSS&lt;/code&gt; pipe to integrate it to our blog. With this plan in mind, let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install TailwindCSS
&lt;/h2&gt;

&lt;p&gt;We start with following &lt;a href="https://tailwindcss.com/docs/installation/using-postcss" rel="noopener noreferrer"&gt;official docs&lt;/a&gt; in a &lt;code&gt;blog/&lt;/code&gt; folder.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install TailwindCSS and PostCSS&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; tailwindcss postcss autoprefixer
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add &lt;code&gt;.gitignore&lt;/code&gt; file for &lt;a href="https://github.com/github/gitignore/blob/main/Node.gitignore" rel="noopener noreferrer"&gt;Node.js projects&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create configuration files.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;npx tailwindcss init &lt;span class="nt"&gt;--postcss&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;added &lt;code&gt;--postcss&lt;/code&gt; option to initialize a &lt;code&gt;postcss.config.js&lt;/code&gt; file as well.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure your template paths. Our only &lt;code&gt;content&lt;/code&gt; files located in &lt;code&gt;blog/src/layouts&lt;/code&gt; folder.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/tailwind.config.js b/blog/tailwind.config.js
index 32e3abd..7b5a700 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/tailwind.config.js
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/tailwind.config.js
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,6 +1,6 @@&lt;/span&gt;
 /** @type {import('tailwindcss').Config} */
 module.exports = {
&lt;span class="gd"&gt;-  content: [],
&lt;/span&gt;&lt;span class="gi"&gt;+  content: ["./src/layouts/**/*.html"],
&lt;/span&gt;   theme: {
     extend: {},
   },
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the Tailwind directives to your CSS&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; blog/src/assets
&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$/&lt;/span&gt;main.css
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;and then update newly created &lt;code&gt;blog/src/assets/main.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/assets/css/main.css b/blog/src/assets/css/main.css
&lt;/span&gt;&lt;span class="p"&gt;new file mode 100644
&lt;/span&gt;&lt;span class="gh"&gt;index 0000000..b5c61c9
&lt;/span&gt;&lt;span class="gd"&gt;--- /dev/null
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/assets/css/main.css
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,3 @@&lt;/span&gt;
&lt;span class="gi"&gt;+@tailwind base;
+@tailwind components;
+@tailwind utilities;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;also, we are going to update &lt;code&gt;.editorconfig&lt;/code&gt;, &lt;code&gt;.pre-commit-config.yaml&lt;/code&gt; and &lt;code&gt;.prettierrc.yaml&lt;/code&gt; to enable support for &lt;code&gt;css&lt;/code&gt; file type.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Configure Hugo to use PostCSS
&lt;/h2&gt;

&lt;p&gt;Now we have installed TailwindCSS, we are ready to start configuring our blog to use it via &lt;code&gt;PostCSS&lt;/code&gt; pipe.&lt;/p&gt;

&lt;p&gt;From the docs&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hugo Pipe’s PostCSS requires the postcss-cli JavaScript package to be installed in the environment (npm install -g postcss postcss-cli) along with any PostCSS plugin(s) used (e.g., npm install -g autoprefixer).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install &lt;a href="https://github.com/postcss/postcss-cli" rel="noopener noreferrer"&gt;&lt;code&gt;postcss-cli&lt;/code&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; postcss-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;code&gt;link&lt;/code&gt; tag with our processed CSS to &lt;code&gt;blog/src/layouts/partials/head.html&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/partials/head.html b/blog/src/layouts/partials/head.html
index b9f74a6..556a0cf 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/partials/head.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/partials/head.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -3,4 +3,6 @@&lt;/span&gt;
     &amp;lt;link rel="icon" type="image/svg+xml" href="/favicon.svg" /&amp;gt;
     &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
     &amp;lt;title&amp;gt;{{ .Site.Title }}&amp;lt;/title&amp;gt;
&lt;span class="gi"&gt;+    {{ $css := resources.Get "css/main.css" | resources.PostCSS }}
+    &amp;lt;link rel="stylesheet" href="{{ $css.RelPermalink }}" /&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;a href="https://docs.npmjs.com/cli/v6/using-npm/scripts" rel="noopener noreferrer"&gt;&lt;code&gt;scripts&lt;/code&gt;&lt;/a&gt; command to &lt;code&gt;package.json&lt;/code&gt; to run hugo in NPM environment. By default, Hugo will search for &lt;a href="https://gohugo.io/hugo-pipes/js#include-dependencies-in-packagejson--node_modules" rel="noopener noreferrer"&gt;&lt;code&gt;node_modules/&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;From Hugo 0.78.1 the start directory for resolving NPM packages (aka. packages that live inside a node_modules folder) is always the main project folder.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;but because of our project structure we need to run hugo as npm command. We will use &lt;a href="https://docs.npmjs.com/cli/v6/commands/npm-start" rel="noopener noreferrer"&gt;&lt;code&gt;start&lt;/code&gt;&lt;/a&gt; as command name because npm has shorthand for it.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/package.json b/blog/package.json
index 3f40e6d..5b5d864 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/package.json
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/package.json
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,4 +1,7 @@&lt;/span&gt;
 {
&lt;span class="gi"&gt;+    "scripts": {
+        "start": "hugo --source src server --baseURL http://localhost/"
+    },
&lt;/span&gt;     "devDependencies": {
         "autoprefixer": "^10.4.7",
         "postcss": "^8.4.14",
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Profit!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We now have a blog that uses TailwindCSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Asset management in Hugo
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://tailwindcss.com" rel="noopener noreferrer"&gt;https://tailwindcss.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/imomaliev/vue-ts-tailwind" rel="noopener noreferrer"&gt;https://github.com/imomaliev/vue-ts-tailwind&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://dev.to/imomaliev/series/13950"&gt;https://dev.to/imomaliev/series/13950&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/categories/asset-management" rel="noopener noreferrer"&gt;https://gohugo.io/categories/asset-management&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://postcss.org" rel="noopener noreferrer"&gt;https://postcss.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/hugo-pipes/postcss/" rel="noopener noreferrer"&gt;https://gohugo.io/hugo-pipes/postcss/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Install TailwindCSS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://tailwindcss.com/docs/installation/using-postcss" rel="noopener noreferrer"&gt;https://tailwindcss.com/docs/installation/using-postcss&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/github/gitignore/blob/main/Node.gitignore" rel="noopener noreferrer"&gt;https://github.com/github/gitignore/blob/main/Node.gitignore&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configure Hugo to use PostCSS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/postcss/postcss-cli" rel="noopener noreferrer"&gt;https://github.com/postcss/postcss-cli&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.npmjs.com/cli/v6/using-npm/scripts" rel="noopener noreferrer"&gt;https://docs.npmjs.com/cli/v6/using-npm/scripts&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hugo</category>
      <category>tailwindcss</category>
      <category>postcss</category>
      <category>npm</category>
    </item>
    <item>
      <title>Basic content render</title>
      <dc:creator>Sardorbek Imomaliev</dc:creator>
      <pubDate>Tue, 19 Jul 2022 04:48:14 +0000</pubDate>
      <link>https://forem.com/imomaliev/basic-content-render-1pi5</link>
      <guid>https://forem.com/imomaliev/basic-content-render-1pi5</guid>
      <description>&lt;h2&gt;
  
  
  Sane defaults
&lt;/h2&gt;

&lt;p&gt;Previously in this series, we created &lt;a href="https://dev.to/imomaliev/hugo-new-site-3oh1"&gt;a new Hugo site&lt;/a&gt; and &lt;a href="https://dev.to/imomaliev/hugo-no-theme-48pa"&gt;copied scaffold of the default theme to our layout folder&lt;/a&gt;. Now let's update our templates to have great HTML defaults. I would suggest reading the great article &lt;a href="https://www.freecodecamp.org/news/basic-html5-template-boilerplate-code-example/" rel="noopener noreferrer"&gt;Basic HTML5 Template: Use This HTML Boilerplate as a Starter for Any Web Dev Project&lt;/a&gt; which dives a little deeper into this topic. But for our case, we will just base our default template on &lt;a href="https://github.com/vitejs/vite/blob/main/packages/create-vite/template-vue/index.html" rel="noopener noreferrer"&gt;Vite's boilerplate template for Vue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, we will add &lt;code&gt;lang="en"&lt;/code&gt; attribute to &lt;code&gt;html&lt;/code&gt; tag, specifying that content will be in English. I plan to make this blog support multiple languages, my main language is Russian, but my mother tong is Uzbek. And I hope in the future to write articles in these languages as well. As &lt;a href="https://gohugo.io/templates/lookup-order/" rel="noopener noreferrer"&gt;Hugo's Lookup Order&lt;/a&gt; page states (to be honest not directly) all template lookups in Hugo start with &lt;code&gt;layouts/_default/baseof.html&lt;/code&gt; template. This fact also could be deduced by finding a template with &lt;code&gt;html&lt;/code&gt; tag in it in created &lt;code&gt;layouts&lt;/code&gt; folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/_default/baseof.html b/blog/src/layouts/_default/baseof.html
index 7b0d566..94c5dfe 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/_default/baseof.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/_default/baseof.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -1,5 +1,5 @@&lt;/span&gt;
 &amp;lt;!DOCTYPE html&amp;gt;
&lt;span class="gd"&gt;-&amp;lt;html&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+&amp;lt;html lang="en"&amp;gt;
&lt;/span&gt;     {{- partial "head.html" . -}}
     &amp;lt;body&amp;gt;
         {{- partial "header.html" . -}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, we will update &lt;code&gt;head&lt;/code&gt; tag in &lt;code&gt;layouts/_default/head.html&lt;/code&gt; following existing structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/partials/head.html b/blog/src/layouts/partials/head.html
index e69de29..b9f74a6 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/partials/head.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/partials/head.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,6 @@&lt;/span&gt;
&lt;span class="gi"&gt;+&amp;lt;head&amp;gt;
+    &amp;lt;meta charset="UTF-8" /&amp;gt;
+    &amp;lt;link rel="icon" type="image/svg+xml" href="/favicon.svg" /&amp;gt;
+    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
+    &amp;lt;title&amp;gt;{{ .Site.Title }}&amp;lt;/title&amp;gt;
+&amp;lt;/head&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we've&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  added &lt;code&gt;meta&lt;/code&gt; tag to specify default character encoding&lt;/li&gt;
&lt;li&gt;  added &lt;code&gt;link&lt;/code&gt; to our future favicon&lt;/li&gt;
&lt;li&gt;  added another &lt;code&gt;meta&lt;/code&gt; tag for &lt;code&gt;viewport&lt;/code&gt; configuration to render the width of the page to the width of the device's screen&lt;/li&gt;
&lt;li&gt;  added &lt;code&gt;title&lt;/code&gt; tag to set our pages title.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could also check what Hugo's team suggest in their &lt;a href="https://gohugo.io/templates/base/#define-the-base-template" rel="noopener noreferrer"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GoHTML templates
&lt;/h2&gt;

&lt;p&gt;Now we are ready to configure our default &lt;a href="https://gohugo.io/templates/lookup-order/#hugo-layouts-lookup-rules" rel="noopener noreferrer"&gt;&lt;code&gt;Kind&lt;/code&gt;&lt;/a&gt; templates to show content. Let start with our landing page - &lt;code&gt;layouts/index.html&lt;/code&gt;. Default &lt;code&gt;baseof.html&lt;/code&gt; contains usage of &lt;code&gt;block&lt;/code&gt; construct, if you used any other templating language this should pretty familiar. Basically, this allows us to have overridable parts of the base template. Here, for example, we have &lt;code&gt;{{- block "main" . }}{{- end }}&lt;/code&gt;, meaning we could re&lt;code&gt;define&lt;/code&gt; this portion. Read &lt;a href="https://gohugo.io/templates/base/#override-the-base-template" rel="noopener noreferrer"&gt;the docs on Base Templates and Blocks&lt;/a&gt; for better understanding. I will just show the final result:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;index.html&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/blog/src/layouts/index.html b/blog/src/layouts/index.html
index e69de29..728b791 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/index.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/index.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,8 @@&lt;/span&gt;
&lt;span class="gi"&gt;+{{ define "main" }}
+    &amp;lt;h1&amp;gt;{{ .Site.Title }}&amp;lt;/h1&amp;gt;
+    {{ range .Pages }}
+        &amp;lt;article&amp;gt;
+            &amp;lt;h2&amp;gt;&amp;lt;a href="{{ .Permalink }}"&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
+        &amp;lt;/article&amp;gt;
+    {{ end }}
+{{ end }}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our blog now renders its title, from the &lt;code&gt;config.toml&lt;/code&gt; on the landing page and all pages for the current level (only "Building the blog while flying it" series link currently) with a link. "This is not my first rodeo", so personally I find the template above is pretty straight forward. But if you are new to templating I suggest digging into the official docs for &lt;a href="https://gohugo.io/categories/functions" rel="noopener noreferrer"&gt;template functions&lt;/a&gt; and &lt;a href="https://gohugo.io/variables/" rel="noopener noreferrer"&gt;template variables&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;_default/list.html&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Following the same logic, we will update our &lt;code&gt;list&lt;/code&gt; &lt;code&gt;Kind&lt;/code&gt; template. To show current page's &lt;code&gt;Title&lt;/code&gt; and render all child pages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/_default/list.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/_default/list.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,8 @@&lt;/span&gt;
&lt;span class="gi"&gt;+{{ define "main" }}
+    &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
+    {{ range .Pages }}
+        &amp;lt;article&amp;gt;
+            &amp;lt;h2&amp;gt;&amp;lt;a href="{{ .Permalink }}"&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;
+        &amp;lt;/article&amp;gt;
+    {{ end }}
+{{ end }}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;_default/single.html&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;And finally, we will render actual content of our articles in &lt;code&gt;_default/single.html&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;--- a/blog/src/layouts/_default/single.html
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/blog/src/layouts/_default/single.html
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,6 @@&lt;/span&gt;
&lt;span class="gi"&gt;+{{ define "main" }}
+    &amp;lt;article&amp;gt;
+        &amp;lt;h1&amp;gt;{{ .Title }}&amp;lt;/h1&amp;gt;
+        {{ .Content }}
+    &amp;lt;/article&amp;gt;
+{{ end }}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update articles for accessibility
&lt;/h2&gt;

&lt;p&gt;Previously I was using a single hashtag &lt;code&gt;#&lt;/code&gt; in my articles for this blog to denote headings, but from now on I will use two &lt;code&gt;##&lt;/code&gt;, meaning all articles' sections will be rendered with &lt;a href="https://www.markdownguide.org/basic-syntax/#headings" rel="noopener noreferrer"&gt;heading level 2&lt;/a&gt;. This is recommended by &lt;code&gt;dev.to&lt;/code&gt;'s editor for improving accessibility and also this allows us to render our article content properly where the title of the articles will be rendered as &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; and all heading of the sections as &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hooray!
&lt;/h2&gt;

&lt;p&gt;We have an actual working blog that could be hosted somewhere and people would be able to read it. But we will do the actual hosting some other time, for now we will continue building the blog itself and posting about it in &lt;a href="https://dev.to/imomaliev/series/18921"&gt;my series on dev.to&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://www.freecodecamp.org/news/basic-html5-template-boilerplate-code-example/" rel="noopener noreferrer"&gt;https://www.freecodecamp.org/news/basic-html5-template-boilerplate-code-example/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/vitejs/vite/blob/main/packages/create-vite/template-vue/index.html" rel="noopener noreferrer"&gt;https://github.com/vitejs/vite/blob/main/packages/create-vite/template-vue/index.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/templates/lookup-order/" rel="noopener noreferrer"&gt;https://gohugo.io/templates/lookup-order/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/templates/base/#define-the-base-template" rel="noopener noreferrer"&gt;https://gohugo.io/templates/base/#define-the-base-template&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/templates/lookup-order/#hugo-layouts-lookup-rules" rel="noopener noreferrer"&gt;https://gohugo.io/templates/lookup-order/#hugo-layouts-lookup-rules&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/templates/base/#override-the-base-template" rel="noopener noreferrer"&gt;https://gohugo.io/templates/base/#override-the-base-template&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/categories/functions" rel="noopener noreferrer"&gt;https://gohugo.io/categories/functions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://gohugo.io/variables/" rel="noopener noreferrer"&gt;https://gohugo.io/variables/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.markdownguide.org/basic-syntax/#headings" rel="noopener noreferrer"&gt;https://www.markdownguide.org/basic-syntax/#headings&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hugo</category>
      <category>blog</category>
      <category>gohtml</category>
      <category>vue</category>
    </item>
  </channel>
</rss>
