<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Journal on nocturne</title><link>https://tiennm99.github.io/nocturne/tags/ghi-chep/</link><description>Recent content in Journal on nocturne</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 25 Mar 2026 09:30:00 +0700</lastBuildDate><atom:link href="https://tiennm99.github.io/nocturne/tags/ghi-chep/index.xml" rel="self" type="application/rss+xml"/><item><title>Reading and noticing</title><link>https://tiennm99.github.io/nocturne/2026/03/22/doc-sach-quan-sat/</link><pubDate>Sun, 22 Mar 2026 15:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/03/22/doc-sach-quan-sat/</guid><description>&lt;p&gt;For a few months now I have been rereading old books. The first time round I skimmed, mostly to find out how they ended. This time I read slowly, with a pencil nearby, and let myself stop on any page.&lt;/p&gt;
&lt;p&gt;The first discovery surprised me: most of my first impressions of a book were wrong. Not because the book had changed, but because I was reading it differently. A character I once found tiresome now seems sad and likeable. A chapter I thought was padding turns out to be the one the whole story turns on.&lt;/p&gt;
&lt;h2 id="reading-slowly"&gt;Reading slowly&lt;/h2&gt;&lt;p&gt;Reading slowly does not mean reading word by word. It means not turning the page before you understand this one. When a sentence makes me pause, I read it again, then the whole paragraph. More often than not, the place where I paused is the part most worth remembering.&lt;/p&gt;
&lt;p&gt;I also dropped the habit of page targets. An evening of ten pages I still remember beats fifty pages that are gone by morning. A book is not a race, and nobody is keeping score.&lt;/p&gt;
&lt;h2 id="writing-short"&gt;Writing short&lt;/h2&gt;&lt;p&gt;After each session I write exactly three lines: one new thing, one sentence I want to keep, one question. No more. The three-line limit forces me to choose, and choosing is when I actually think about what I just read.&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;Long notes are so you don&amp;rsquo;t have to remember. Short notes are so you do.&lt;/p&gt;

&lt;/blockquote&gt;&lt;p&gt;That line is mine, written one night when I had finished reading and had no energy left for anything longer. Reading it back, I think it holds.&lt;/p&gt;
&lt;h2 id="noticing"&gt;Noticing&lt;/h2&gt;&lt;p&gt;The habit of reading slowly crept into other things without my noticing. On walks, I see that the tree at the end of the lane has new leaves. In conversation, I hear the other person out before thinking about my reply. Small things, but they make a day feel longer in a good way.&lt;/p&gt;
&lt;p&gt;Noticing is a skill you practise, just like reading. At first you see very little; the longer you look, the more there is. And as with reading, the point is not to see everything but to see a few things clearly.&lt;/p&gt;
&lt;h2 id="the-next-book"&gt;The next book&lt;/h2&gt;&lt;p&gt;The reread list is still long, but there is no hurry. Next up is a short story collection that has sat on the shelf for almost ten years. Last time I gave up halfway. This time I will read one story a week and see whether it feels different.&lt;/p&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>Year-end thoughts</title><link>https://tiennm99.github.io/nocturne/2025/12/01/cuoi-nam/</link><pubDate>Mon, 01 Dec 2025 20:30:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2025/12/01/cuoi-nam/</guid><description>&lt;p&gt;The end of the year is a good time to pause. Not to sum things up, just to notice.&lt;/p&gt;
&lt;p&gt;Some things I did better this year than last: going to bed earlier, writing more regularly, not reaching for my phone the moment I wake up. Other things stayed exactly the same. Both are fine. A year does not have to be a growth report.&lt;/p&gt;
&lt;p&gt;What stands out most is that the changes that stuck were all small. Ten minutes of reading before bed, one line in a notebook each evening, a walk after lunch. The big plans, for the most part, are still sitting in the notebook.&lt;/p&gt;
&lt;p&gt;So next year&amp;rsquo;s plan will be small too. Three things, no more.&lt;/p&gt;</description></item><item><title>Notes on Hugo and static sites</title><link>https://tiennm99.github.io/nocturne/2025/08/15/ghi-chu-hugo/</link><pubDate>Fri, 15 Aug 2025 09:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2025/08/15/ghi-chu-hugo/</guid><description>&lt;p&gt;Hugo is a static site generator written in Go. Coming back to it after a long break, I found a fair amount had changed. These are personal notes, not a tutorial: the things I want to remember before starting on something bigger.&lt;/p&gt;
&lt;h2 id="the-new-layout-convention"&gt;The new layout convention&lt;/h2&gt;&lt;p&gt;Since 0.146, the special folders inside &lt;code&gt;layouts/&lt;/code&gt; start with an underscore: &lt;code&gt;_partials&lt;/code&gt;, &lt;code&gt;_markup&lt;/code&gt;, &lt;code&gt;_shortcodes&lt;/code&gt;. The underscore keeps them apart from section names, so a section called &lt;code&gt;partials&lt;/code&gt; can no longer be mistaken for the folder of partials.&lt;/p&gt;
&lt;h3 id="the-_partials-folder"&gt;The &lt;code&gt;_partials&lt;/code&gt; folder&lt;/h3&gt;&lt;p&gt;Reusable template pieces live here: the header, the footer, a post card. A section is a kind of content; a partial is just a piece of the page.&lt;/p&gt;
&lt;h3 id="the-_markup-folder"&gt;The &lt;code&gt;_markup&lt;/code&gt; folder&lt;/h3&gt;&lt;p&gt;Render hooks for Markdown: headings, links, images, code blocks, tables, blockquotes. Hugo finds them on its own while rendering content; nothing needs registering.&lt;/p&gt;
&lt;h3 id="the-_shortcodes-folder"&gt;The &lt;code&gt;_shortcodes&lt;/code&gt; folder&lt;/h3&gt;&lt;p&gt;Exactly what it says. A shortcode placed here in your site overrides the theme&amp;rsquo;s shortcode of the same name.&lt;/p&gt;
&lt;h2 id="the-asset-pipeline"&gt;The asset pipeline&lt;/h2&gt;&lt;p&gt;Hugo needs no external build tool. &lt;code&gt;resources.Get&lt;/code&gt; picks up a file from &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;resources.Concat&lt;/code&gt; joins files, &lt;code&gt;minify&lt;/code&gt; compresses them and &lt;code&gt;fingerprint&lt;/code&gt; puts a hash in the file name. For a small to medium site, that is the whole pipeline.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;markup&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;goldmark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;autoHeadingIDType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;github-ascii&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This one setting solves a big problem for anyone writing in Vietnamese: heading IDs come out as plain ASCII, stable and URL-safe. &amp;ldquo;Thư mục&amp;rdquo; becomes &lt;code&gt;#thu-muc&lt;/code&gt; instead of a long run of percent-encoded bytes. Only &amp;ldquo;đ&amp;rdquo; is dropped rather than turned into &amp;ldquo;d&amp;rdquo;; when it matters, write the ID by hand right after the heading text, as the Vietnamese version of this post does with &lt;code&gt;{#di-tiep}&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="render-hooks"&gt;Render hooks&lt;/h2&gt;&lt;p&gt;Render hooks let you step into Markdown rendering without writing a Goldmark extension. A small template in &lt;code&gt;_markup/&lt;/code&gt; is enough.&lt;/p&gt;
&lt;p&gt;A few things I reach for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a &lt;code&gt;#&lt;/code&gt; anchor link next to each heading;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rel=&amp;quot;noopener&amp;quot;&lt;/code&gt; on outbound links;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;srcset&lt;/code&gt;, dimensions and &lt;code&gt;loading=&amp;quot;lazy&amp;quot;&lt;/code&gt; on images, so the page does not jump while it loads.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="things-worth-keeping"&gt;Things worth keeping&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Plain Markdown is a long-term asset. Any generator can read it.&lt;/li&gt;
&lt;li&gt;Hugo is rarely what makes a build slow. When it is slow, the culprit is usually image processing or an over-eager resource pipeline.&lt;/li&gt;
&lt;li&gt;A light theme makes a light site. Every byte of CSS and JS travels over the network to the reader.&lt;/li&gt;
&lt;li&gt;Writing your own theme is how you get to understand every line. Ready-made themes are convenient, but they bring a lot you never needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="whats-next"&gt;What&amp;rsquo;s next&lt;/h2&gt;&lt;p&gt;The project for the coming months: a Hugo theme of my own, small, with no build step and Vietnamese first. It is called &lt;code&gt;nocturne&lt;/code&gt;. I will write it and keep notes along the way in this series.&lt;/p&gt;
&lt;p&gt;The next entry will probably be the actual plan, then the CSS and how to do dark mode without a white flash on first load.&lt;/p&gt;</description></item></channel></rss>