<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>theme on nocturne</title><link>https://tiennm99.github.io/nocturne/tags/theme/</link><description>Recent content in theme on nocturne</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 21 May 2026 08:30:00 +0700</lastBuildDate><atom:link href="https://tiennm99.github.io/nocturne/tags/theme/index.xml" rel="self" type="application/rss+xml"/><item><title>A Markdown tour</title><link>https://tiennm99.github.io/nocturne/2026/05/07/sample/</link><pubDate>Thu, 07 May 2026 19:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/05/07/sample/</guid><description>&lt;p&gt;This post is a short walk through Markdown: each section uses one piece of syntax and shows how nocturne renders it. To compare with the source, follow the edit link at the end of the page — it opens this very &lt;code&gt;index.en.md&lt;/code&gt; on GitHub.&lt;/p&gt;
&lt;p&gt;The post is long enough to get a table of contents. On a wide screen it sits beside the text and highlights the section you are reading; on a phone it tucks in above the content.&lt;/p&gt;
&lt;h2 id="text-and-links"&gt;Text and links&lt;/h2&gt;&lt;p&gt;A plain sentence can hold &lt;strong&gt;bold&lt;/strong&gt;, &lt;em&gt;italics&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;both at once&lt;/strong&gt;&lt;/em&gt;, &lt;del&gt;a dropped idea&lt;/del&gt; and &lt;code&gt;inline code&lt;/code&gt; such as &lt;code&gt;hugo server --buildDrafts&lt;/code&gt;. Keyboard shortcuts use an HTML tag: &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;C&lt;/kbd&gt;.&lt;/p&gt;
&lt;p class="lead"&gt;This paragraph carries a &lt;code&gt;lead&lt;/code&gt; class, added by a Markdown attribute on the line right below it. The theme does not style that class, but it is in the HTML for your own CSS to pick up.&lt;/p&gt;
&lt;p&gt;External links such as &lt;a href="https://gohugo.io/documentation/" rel="noopener noreferrer"&gt;Hugo&amp;rsquo;s documentation&lt;/a&gt; get &lt;code&gt;rel=&amp;quot;noopener noreferrer&amp;quot;&lt;/code&gt; added. Internal links can point straight at a Markdown file: &lt;a href="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/"&gt;the post about images&lt;/a&gt; turns into that post&amp;rsquo;s real URL, and &lt;a href="https://tiennm99.github.io/nocturne/2026/07/03/khoi-code/#line-numbers"&gt;the line numbers section of the code post&lt;/a&gt; keeps its &lt;code&gt;#line-numbers&lt;/code&gt; fragment. Change your URL scheme later and these links still work.&lt;/p&gt;
&lt;h3 id="a-heading-with-its-own-class" class="special"&gt;A heading with its own class&lt;/h3&gt;&lt;p&gt;The heading above has a &lt;code&gt;{.special}&lt;/code&gt; attribute. The class is kept and the &lt;code&gt;id&lt;/code&gt; is still generated, so the table of contents and the &lt;code&gt;#&lt;/code&gt; that shows on hover keep working.&lt;/p&gt;
&lt;h2 id="lists-and-to-dos"&gt;Lists and to-dos&lt;/h2&gt;&lt;p&gt;An unordered list, nested:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Content
&lt;ul&gt;
&lt;li&gt;Posts&lt;/li&gt;
&lt;li&gt;About page&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Look and feel
&lt;ul&gt;
&lt;li&gt;Light and dark modes&lt;/li&gt;
&lt;li&gt;A typeface that handles Vietnamese well&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An ordered list, numbered per level:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a folder for the post.&lt;/li&gt;
&lt;li&gt;Write &lt;code&gt;index.md&lt;/code&gt;, then add the &lt;code&gt;index.en.md&lt;/code&gt; translation next to it.
&lt;ol&gt;
&lt;li&gt;Keep the date, category and tags the same.&lt;/li&gt;
&lt;li&gt;Translate the title, description and body.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;hugo server&lt;/code&gt; and read it through once.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A task list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; Write a draft&lt;/li&gt;
&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; Add images to the bundle&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; Ask a friend to proofread&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; Publish&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="definition-lists"&gt;Definition lists&lt;/h3&gt;&lt;dl&gt;
&lt;dt&gt;Bundle&lt;/dt&gt;
&lt;dd&gt;A folder holding &lt;code&gt;index.md&lt;/code&gt; together with the post&amp;rsquo;s images and other files.&lt;/dd&gt;
&lt;dt&gt;Front matter&lt;/dt&gt;
&lt;dd&gt;The YAML block at the top of the file, where the title, date, tags and categories live.&lt;/dd&gt;
&lt;dt&gt;Render hook&lt;/dt&gt;
&lt;dd&gt;A small template that decides how Hugo outputs images, links, headings, tables and blockquotes.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id="tables"&gt;Tables&lt;/h2&gt;&lt;p&gt;Colons in the separator row set each column&amp;rsquo;s alignment:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th style="text-align: left"&gt;Syntax (left)&lt;/th&gt;
 &lt;th style="text-align: center"&gt;Result (centre)&lt;/th&gt;
 &lt;th style="text-align: right"&gt;Characters (right)&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;**bold**&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: center"&gt;&lt;strong&gt;bold&lt;/strong&gt;&lt;/td&gt;
 &lt;td style="text-align: right"&gt;8&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;*italic*&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: center"&gt;&lt;em&gt;italic&lt;/em&gt;&lt;/td&gt;
 &lt;td style="text-align: right"&gt;8&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;~~struck~~&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: center"&gt;&lt;del&gt;struck&lt;/del&gt;&lt;/td&gt;
 &lt;td style="text-align: right"&gt;10&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;`code`&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: center"&gt;&lt;code&gt;code&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: right"&gt;6&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;&lt;h3 id="a-wide-table"&gt;A wide table&lt;/h3&gt;&lt;p&gt;A table with many columns sits in a horizontally scrolling region, so it never stretches the page on a phone. The region takes focus, so keyboard users can scroll it with the arrow keys.&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th style="text-align: left"&gt;Format&lt;/th&gt;
 &lt;th style="text-align: left"&gt;Extension&lt;/th&gt;
 &lt;th style="text-align: left"&gt;Theme handling&lt;/th&gt;
 &lt;th style="text-align: center"&gt;WebP &lt;code&gt;srcset&lt;/code&gt;&lt;/th&gt;
 &lt;th style="text-align: center"&gt;&lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt;&lt;/th&gt;
 &lt;th style="text-align: center"&gt;Animation&lt;/th&gt;
 &lt;th style="text-align: center"&gt;Transparency&lt;/th&gt;
 &lt;th style="text-align: left"&gt;Good for&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;JPEG&lt;/td&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;.jpg&lt;/code&gt;, &lt;code&gt;.jpeg&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Resized&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Photos and detailed pictures&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;PNG&lt;/td&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;.png&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Resized&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Screenshots and flat artwork&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;WebP&lt;/td&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;.webp&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Resized&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Possible&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Most things on today&amp;rsquo;s web&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;SVG&lt;/td&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;.svg&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Served as is&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Possible&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Icons, diagrams, logos&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;GIF&lt;/td&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;.gif&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Served as is&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: center"&gt;No&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: center"&gt;Yes&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Short loops with few colours&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;&lt;h4 id="when-to-reach-for-a-table"&gt;When to reach for a table&lt;/h4&gt;&lt;p&gt;Tables suit data you compare across rows and columns. For steps done one after another, an ordered list reads better on a narrow screen.&lt;/p&gt;
&lt;h2 id="quotes"&gt;Quotes&lt;/h2&gt;&lt;p&gt;A plain blockquote, no alert styling:&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;A day&amp;rsquo;s travel brings a basketful of wisdom.&lt;/p&gt;
&lt;p&gt;— Vietnamese proverb&lt;/p&gt;

&lt;/blockquote&gt;&lt;h2 id="alerts"&gt;Alerts&lt;/h2&gt;&lt;p&gt;All five GitHub alert types are here. Their default titles follow the page language.&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;Background a reader should know, even when skimming.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;Run &lt;code&gt;hugo server --navigateToChanged&lt;/code&gt; and the browser jumps to the page you just edited.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;A translation lives next to the original in the same bundle, named &lt;code&gt;index.en.md&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;Hugo does not merge &lt;code&gt;markup&lt;/code&gt; from a theme, so copy the required config block into your site&amp;rsquo;s &lt;code&gt;hugo.yaml&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Caution&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;&lt;code&gt;draft: true&lt;/code&gt; keeps a post out of the build, but the file is still in your repository. If the repository is public, anyone can read it.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;Right after &lt;code&gt;[!TIP]&lt;/code&gt; you can write your own title in place of the default one:&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Keep it short&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;An alert works best with a sentence or two. Any longer and it probably wants a section of its own.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="footnotes"&gt;Footnotes&lt;/h2&gt;&lt;p&gt;Hugo turns Markdown into HTML with Goldmark&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. A footnote can have a name instead of a number&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;, and its text always gathers at the end of the post, with an arrow back to where you were reading.&lt;/p&gt;
&lt;h2 id="collapsible-content"&gt;Collapsible content&lt;/h2&gt;&lt;p&gt;The site turns on &lt;code&gt;markup.goldmark.renderer.unsafe&lt;/code&gt;, so hand-written HTML goes straight to the page. A &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; tag makes a block that opens and closes without any JavaScript:&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt;Why does every post have two files?&lt;/summary&gt;
&lt;p&gt;Each post is a bundle. &lt;code&gt;index.md&lt;/code&gt; is the Vietnamese version, the site&amp;rsquo;s default language; &lt;code&gt;index.en.md&lt;/code&gt; is the English one. Hugo pairs the two files as translations, and the language picker jumps straight to the matching post.&lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;Hugo also has a &lt;code&gt;details&lt;/code&gt; shortcode that does the same job; see &lt;a href="https://tiennm99.github.io/nocturne/2026/08/20/shortcodes/"&gt;the shortcode post&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;The rule above is three dashes, &lt;code&gt;---&lt;/code&gt;, on a line of their own between blank lines. This post was edited after it went out, so an updated date shows under the title.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Goldmark is a Markdown parser written in Go that follows the CommonMark spec.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;The name only exists in the source; on the page, footnotes are still numbered in the order they appear.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Writing your own Hugo theme</title><link>https://tiennm99.github.io/nocturne/2026/02/14/tu-viet-theme/</link><pubDate>Sat, 14 Feb 2026 21:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/02/14/tu-viet-theme/</guid><description>&lt;p&gt;A month after &lt;a href="https://tiennm99.github.io/nocturne/2026/01/10/ke-hoach-dau-nam/"&gt;the new-year plan&lt;/a&gt;, &lt;code&gt;nocturne&lt;/code&gt; is good enough to write about on itself. This post records the decisions that shaped the theme, so that when I want to add something later, I remember why I left it out in the first place.&lt;/p&gt;
&lt;h2 id="why-build-your-own"&gt;Why build your own&lt;/h2&gt;&lt;p&gt;Using a ready-made theme is like renting a furnished flat: you can move in today, but moving a shelf means asking the landlord. Every time Hugo changed something, I had to read someone else&amp;rsquo;s code to find out whether the theme still worked.&lt;/p&gt;
&lt;p&gt;Writing your own is slower at first, but afterwards everything has an owner. When a page renders wrong, I know which file to open. When a new Hugo release lands, the list of things that might break is short enough to read in one evening.&lt;/p&gt;
&lt;p&gt;There is one more reason: writing a theme makes you actually learn Hugo. Lookup order, page bundles, render hooks, how multilingual sites fit together; you have to touch each of them at least once.&lt;/p&gt;
&lt;h2 id="keep-it-small"&gt;Keep it small&lt;/h2&gt;&lt;p&gt;The rule of thumb: everything added must answer &amp;ldquo;what does the reader get?&amp;rdquo;. If the answer is &amp;ldquo;it looks a bit fancier&amp;rdquo;, the answer is usually no.&lt;/p&gt;
&lt;h3 id="no-build-step"&gt;No build step&lt;/h3&gt;&lt;p&gt;No Node, no bundler, no PostCSS. The CSS is a handful of plain files that Hugo joins, minifies and fingerprints. The JavaScript is small ES modules, one job each: the theme toggle, the copy button on code blocks, the table of contents that tracks your scroll. All of it together is under ten kilobytes before compression.&lt;/p&gt;
&lt;h3 id="data-not-params"&gt;Data, not params&lt;/h3&gt;&lt;p&gt;The home page is a portfolio, but the personal details are not in &lt;code&gt;hugo.yaml&lt;/code&gt;. The bio and links live in &lt;code&gt;data/profile.yaml&lt;/code&gt;, the featured projects in &lt;code&gt;data/projects.yaml&lt;/code&gt;. The config file is left with the switches that turn features on and off, and it reads at a glance.&lt;/p&gt;
&lt;h3 id="no-shortcodes-of-its-own"&gt;No shortcodes of its own&lt;/h3&gt;&lt;p&gt;The theme ships no shortcodes. A shortcode is Hugo-only syntax; once it is in a post, the post is tied to the theme. Whatever Markdown can express, such as captioned images or callout boxes, the theme handles with render hooks, so the content stays plain Markdown.&lt;/p&gt;
&lt;h2 id="dark-by-default"&gt;Dark by default&lt;/h2&gt;&lt;p&gt;I mostly write and read at night, so the dark look is the default, not an afterthought. The moon and sun button in the top corner switches to light, and the choice is remembered for next time.&lt;/p&gt;
&lt;h3 id="no-white-flash"&gt;No white flash&lt;/h3&gt;&lt;p&gt;The hard part of a dark theme is the moment before the CSS applies: the page flashes white, then goes dark. The cure is a tiny script that runs right in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, before the browser paints anything:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-js" data-lang="js"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;theme&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;light&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;data-theme&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;light&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Because dark is the default, the script only has work to do when the reader has picked light. With JavaScript off, the page is still dark and still readable.&lt;/p&gt;
&lt;h3 id="colours-are-tokens"&gt;Colours are tokens&lt;/h3&gt;&lt;p&gt;Every colour is a CSS variable in a single file: dark values on &lt;code&gt;:root&lt;/code&gt;, light values on &lt;code&gt;:root[data-theme=&amp;quot;light&amp;quot;]&lt;/code&gt;. To change the accent colour in both modes, a site overrides a few variables and never touches the theme.&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;When picking colours for a dark background, avoid pure white for text. A warm, moderately bright grey is far easier on the eyes over a long read.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="vietnamese-typography"&gt;Vietnamese typography&lt;/h2&gt;&lt;p&gt;The theme puts Vietnamese first, so the text got the most care.&lt;/p&gt;
&lt;h3 id="fonts-with-every-diacritic"&gt;Fonts with every diacritic&lt;/h3&gt;&lt;p&gt;The font stack starts with Inter and Be Vietnam Pro, then falls back to system fonts. Both cover the full Vietnamese alphabet; when neither is installed, modern system fonts render it well too. What you want to avoid is a font missing a few glyphs like &amp;ldquo;ữ&amp;rdquo; or &amp;ldquo;ặ&amp;rdquo;, leaving a single word set in two typefaces.&lt;/p&gt;
&lt;h3 id="line-height"&gt;Line height&lt;/h3&gt;&lt;p&gt;Vietnamese stacks diacritics above and below the letters. A body line height of 1.7 keeps one line&amp;rsquo;s marks from touching the next. Headings use tighter spacing, since the type is larger and the lines are few.&lt;/p&gt;
&lt;h3 id="anchors-and-dates"&gt;Anchors and dates&lt;/h3&gt;&lt;p&gt;Heading IDs come out as ASCII, so on the Vietnamese page the section &amp;ldquo;Chữ tiếng Việt&amp;rdquo; is &lt;code&gt;#chu-tieng-viet&lt;/code&gt;: short and easy to share. The letter &amp;ldquo;đ&amp;rdquo; is dropped rather than turned into &amp;ldquo;d&amp;rdquo;, so the Vietnamese headings that contain it get a hand-written ID, as in &lt;code&gt;## Nền tối là mặc định {#nen-toi-la-mac-dinh}&lt;/code&gt;. Dates follow each language&amp;rsquo;s format, so a Vietnamese post shows the date the Vietnamese way rather than &amp;ldquo;February 14, 2026&amp;rdquo;.&lt;/p&gt;
&lt;h2 id="whats-left"&gt;What&amp;rsquo;s left&lt;/h2&gt;&lt;p&gt;There is plenty still to do: the archive page, search, a second language. But the core is solid and, more importantly, I understand every line of it. The rest can wait for later posts.&lt;/p&gt;</description></item><item><title>Planning the new year</title><link>https://tiennm99.github.io/nocturne/2026/01/10/ke-hoach-dau-nam/</link><pubDate>Sat, 10 Jan 2026 08:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/01/10/ke-hoach-dau-nam/</guid><description>&lt;p&gt;At the start of each year I write down three things I want done by the end of June. Never more, because a long list never gets finished. This year one of the three is the Hugo theme I mentioned in &lt;a href="https://tiennm99.github.io/nocturne/2025/08/15/ghi-chu-hugo/"&gt;my notes from August&lt;/a&gt;: &lt;code&gt;nocturne&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="why-write-my-own"&gt;Why write my own&lt;/h2&gt;&lt;p&gt;The theme I use works, but it is heavy. It has a slider, animations, and a whole folder of JavaScript I have never opened. Writing my own is the only way to know why each line is there.&lt;/p&gt;
&lt;h2 id="goals"&gt;Goals&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;No build step for CSS or JS: just Hugo and the ES modules browsers already understand.&lt;/li&gt;
&lt;li&gt;Vietnamese first. Other languages are a bonus, not a requirement.&lt;/li&gt;
&lt;li&gt;The home page is a portfolio; the posts are everything else.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="how-ill-know"&gt;How I&amp;rsquo;ll know&lt;/h2&gt;&lt;p&gt;A goal you cannot check is only a wish, so each one gets a simple test:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; The site runs with &lt;code&gt;hugo server&lt;/code&gt; and no &lt;code&gt;npm install&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; A long post reads comfortably on a phone, even with JavaScript off.&lt;/li&gt;
&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; One post in Vietnamese plus an English version, and switching between them never loses your place.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="not-doing"&gt;Not doing&lt;/h2&gt;&lt;p&gt;This list matters as much as the one above: no self-hosted comments, no icon library, no CSS framework. When something is needed, write exactly that part.&lt;/p&gt;
&lt;p&gt;More once the theme has taken shape.&lt;/p&gt;</description></item></channel></rss>