<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Demo on nocturne</title><link>https://tiennm99.github.io/nocturne/categories/demo/</link><description>Recent content in Demo on nocturne</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 20 Aug 2026 19:30:00 +0700</lastBuildDate><atom:link href="https://tiennm99.github.io/nocturne/categories/demo/index.xml" rel="self" type="application/rss+xml"/><item><title>Hugo's built-in shortcodes</title><link>https://tiennm99.github.io/nocturne/2026/08/20/shortcodes/</link><pubDate>Thu, 20 Aug 2026 19:30:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/08/20/shortcodes/</guid><description>&lt;p&gt;A shortcode is a small template you call from the middle of Markdown, written as &lt;code&gt;{{&amp;lt; name params &amp;gt;}}&lt;/code&gt;. Hugo ships a set of them, and this post tries each one in turn. Every section shows the source first and the result right after.&lt;/p&gt;
&lt;p&gt;The shortcodes that embed third-party content (YouTube, Vimeo, X, Instagram) are left out: they pull in code from someone else&amp;rsquo;s servers as soon as the page opens, and a demo site should not push that on its visitors.&lt;/p&gt;
&lt;h2 id="why-nocturne-has-no-shortcodes-of-its-own"&gt;Why nocturne has no shortcodes of its own&lt;/h2&gt;&lt;p&gt;A post that uses a theme&amp;rsquo;s own shortcode is tied to that theme: switch themes and the build fails on that post, and you are left fixing files one by one. nocturne wants your content to stay plain Markdown that reads fine on GitHub, in your editor, and wherever you move it next.&lt;/p&gt;
&lt;p&gt;Everything the theme does to your content goes through render hooks instead: captioned images, GitHub-style alerts, scrolling tables, links to &lt;code&gt;.md&lt;/code&gt; files. You write standard Markdown and the theme handles the presentation. If you really need a shortcode, put it in your site&amp;rsquo;s &lt;code&gt;layouts/_shortcodes/&lt;/code&gt; — it belongs to your content, not to the theme.&lt;/p&gt;
&lt;h2 id="figure"&gt;figure&lt;/h2&gt;&lt;p&gt;An image with a caption and a link, written as a shortcode rather than Markdown image syntax:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; figure
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; src=&amp;#34;https://tiennm99.github.io/nocturne/img/tinh-tu-static.png&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; alt=&amp;#34;A test card with six vertical colour bars&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; caption=&amp;#34;A test card, stored in the static folder.&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; link=&amp;#34;https://en.wikipedia.org/wiki/Test_card&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;figure&gt;&lt;a href="https://en.wikipedia.org/wiki/Test_card"&gt;&lt;img src="https://tiennm99.github.io/nocturne/img/tinh-tu-static.png"
 alt="A broadcast test card: six vertical bars in red, green, yellow, blue, magenta and cyan, crossed by a diagonal rainbow streak"&gt;&lt;/a&gt;&lt;figcaption&gt;
 &lt;p&gt;A test card, stored in the static folder. Click the image to read about test cards.&lt;/p&gt;
 &lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;For an image in the bundle, the Markdown syntax &lt;code&gt;![alt](image.jpg &amp;quot;caption&amp;quot;)&lt;/code&gt; produces the same &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; and adds a &lt;code&gt;srcset&lt;/code&gt; on top; see &lt;a href="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/"&gt;the post about images&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
 &lt;p&gt;&lt;strong&gt;Sites in a subfolder&lt;/strong&gt;&lt;/p&gt;
 &lt;p&gt;&lt;code&gt;figure&lt;/code&gt; looks for &lt;code&gt;src&lt;/code&gt; in the bundle and then in &lt;code&gt;assets/&lt;/code&gt;, but it does not add the base path to files in &lt;code&gt;static/&lt;/code&gt;. The demo lives under &lt;code&gt;/nocturne/&lt;/code&gt;, so &lt;code&gt;src=&amp;quot;/img/tinh-tu-static.png&amp;quot;&lt;/code&gt; would point outside the site; that is why the example above uses a full URL. Markdown image syntax has no such problem, because the theme&amp;rsquo;s render hook adds the base path for you.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h2 id="details"&gt;details&lt;/h2&gt;&lt;p&gt;A collapsible block whose content is still written in Markdown:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; details summary=&amp;#34;Show the top of hugo.yaml&amp;#34; &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; /details &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;details&gt;
 &lt;summary&gt;Show the top of hugo.yaml&lt;/summary&gt;
 &lt;p&gt;The first three lines of &lt;code&gt;hugo.yaml&lt;/code&gt; for an English site using nocturne:&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;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;nocturne&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="nt"&gt;languageCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;en&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="nt"&gt;defaultContentLanguage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;en&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;The full required block is in the &lt;a href="https://github.com/tiennm99/nocturne/blob/main/docs/config.md" rel="noopener noreferrer"&gt;configuration docs&lt;/a&gt;.&lt;/p&gt;
&lt;/details&gt;

&lt;p&gt;Add &lt;code&gt;open=true&lt;/code&gt; to have the block open when the page loads.&lt;/p&gt;
&lt;h2 id="highlight"&gt;highlight&lt;/h2&gt;&lt;p&gt;The same highlighter as fenced code blocks, with the options passed as shortcode parameters:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; highlight go &amp;#34;linenos=inline,hl_lines=3&amp;#34; &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; /highlight &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="w"&gt; &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="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;	&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &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 hl"&gt;&lt;span class="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;		&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;friend&amp;#34;&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="ln"&gt;4&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;	&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="ln"&gt;5&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;	&lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Hello, &amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;name&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="ln"&gt;6&lt;/span&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;In a post, a fenced block such as &lt;code&gt;```go {hl_lines=3}&lt;/code&gt; is tidier; &lt;code&gt;highlight&lt;/code&gt; earns its keep when the code sits inside a template or another shortcode.&lt;/p&gt;
&lt;h2 id="qr"&gt;qr&lt;/h2&gt;&lt;p&gt;Generates a QR code at build time, as a PNG served with the site:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; qr text=&amp;#34;https://tiennm99.github.io/nocturne/&amp;#34; alt=&amp;#34;...&amp;#34; /&amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;img src="https://tiennm99.github.io/nocturne/qr_bab63491ad8219.png" width="148" height="148" alt="QR code linking to the nocturne demo site"&gt;
&lt;p&gt;Scan it with your phone to open this demo.&lt;/p&gt;
&lt;h2 id="param"&gt;param&lt;/h2&gt;&lt;p&gt;Reads a parameter, looking in the page&amp;rsquo;s front matter first and then in the site&amp;rsquo;s &lt;code&gt;params&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th style="text-align: left"&gt;Source&lt;/th&gt;
 &lt;th style="text-align: left"&gt;Result&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;{{&amp;lt; param &amp;quot;author&amp;quot; &amp;gt;}}&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;Your Name&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;{{&amp;lt; param &amp;quot;toc.minWordCount&amp;quot; &amp;gt;}}&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;400&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td style="text-align: left"&gt;&lt;code&gt;{{&amp;lt; param &amp;quot;description&amp;quot; &amp;gt;}}&lt;/code&gt;&lt;/td&gt;
 &lt;td style="text-align: left"&gt;figure, details, highlight, qr, param, ref and relref — the shortcodes Hugo ships with, all working in nocturne without the theme adding any of its own.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;&lt;p&gt;The last row is a small trap: the site has &lt;code&gt;params.description&lt;/code&gt;, but this post has a &lt;code&gt;description&lt;/code&gt; in its front matter too, so &lt;code&gt;param&lt;/code&gt; returns the post&amp;rsquo;s own. The dot in &lt;code&gt;toc.minWordCount&lt;/code&gt; reaches into a nested parameter.&lt;/p&gt;
&lt;h2 id="ref-and-relref"&gt;ref and relref&lt;/h2&gt;&lt;p&gt;These two look up a page by its path under &lt;code&gt;content/&lt;/code&gt; and return its URL. If the page does not exist the build fails, so a broken link can never go live.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ref&lt;/code&gt; returns the full URL: &lt;code&gt;https://tiennm99.github.io/nocturne/2026/07/03/khoi-code/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;relref&lt;/code&gt; returns the path without the host: &lt;code&gt;/nocturne/2026/07/03/khoi-code/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most of the time they sit inside a Markdown link, optionally with a &lt;code&gt;#&lt;/code&gt; fragment pointing at a heading:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-markdown" data-lang="markdown"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[&lt;span class="nt"&gt;A Markdown tour&lt;/span&gt;](&lt;span class="na"&gt;{{&amp;lt; relref &amp;#34;/post/2026/05/07/sample&amp;#34; &amp;gt;}}&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[&lt;span class="nt"&gt;its Alerts section&lt;/span&gt;](&lt;span class="na"&gt;{{&amp;lt; relref &amp;#34;/post/2026/05/07/sample#alerts&amp;#34; &amp;gt;}}&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The result: &lt;a href="https://tiennm99.github.io/nocturne/2026/08/20/shortcodes//nocturne/2026/05/07/sample/"&gt;A Markdown tour&lt;/a&gt; and &lt;a href="https://tiennm99.github.io/nocturne/2026/08/20/shortcodes//nocturne/2026/05/07/sample/#alerts"&gt;its Alerts section&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In nocturne, a Markdown link straight to the file, such as &lt;code&gt;[post](/post/2026/05/07/sample/index.md)&lt;/code&gt;, gives the same URL without any shortcode; &lt;code&gt;ref&lt;/code&gt; and &lt;code&gt;relref&lt;/code&gt; still pay off when you want the build to stop the moment the target page disappears.&lt;/p&gt;</description></item><item><title>Code blocks</title><link>https://tiennm99.github.io/nocturne/2026/07/03/khoi-code/</link><pubDate>Fri, 03 Jul 2026 21:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/07/03/khoi-code/</guid><description>&lt;p&gt;Hugo highlights code at build time with Chroma, so the page needs no JavaScript library for it. The site sets &lt;code&gt;markup.highlight.noClasses: false&lt;/code&gt;: Chroma only adds CSS classes, and the colours live in the theme&amp;rsquo;s &lt;code&gt;syntax.css&lt;/code&gt;, switching with light and dark mode. Each block has a language label and a &lt;strong&gt;Copy&lt;/strong&gt; button in its top corner.&lt;/p&gt;
&lt;h2 id="seven-languages"&gt;Seven languages&lt;/h2&gt;&lt;h3 id="go"&gt;Go&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;package&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;main&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &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="s"&gt;&amp;#34;fmt&amp;#34;&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="s"&gt;&amp;#34;time&amp;#34;&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="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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &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="nx"&gt;now&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Now&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="nx"&gt;fmt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Hello from nocturne at %s\n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;15:04&amp;#34;&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="p"&gt;}&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;h3 id="python"&gt;Python&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;count_posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;int&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="s2"&gt;&amp;#34;&amp;#34;&amp;#34;Count posts: each post is a folder holding an index.md.&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rglob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;index.md&amp;#34;&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count_posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;content/post&amp;#34;&lt;/span&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;h3 id="bash"&gt;Bash&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/usr/bin/env bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create a bundle for a new post, dated today&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;day&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;date +%Y/%m/%d&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo new content &lt;span class="s2"&gt;&amp;#34;post/&lt;/span&gt;&lt;span class="nv"&gt;$day&lt;/span&gt;&lt;span class="s2"&gt;/new-post/index.md&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo server --buildDrafts
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="yaml"&gt;YAML&lt;/h3&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;highlight&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;noClasses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;# colours live in the theme&amp;#39;s syntax.css&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="nt"&gt;params&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;toc&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;enable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&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;minWordCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;400&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;h3 id="javascript"&gt;JavaScript&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Collapse a burst of calls into one, for example while the user is typing
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;debounce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wait&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;timer&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;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="nx"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;timer&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="nx"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;wait&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;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;h3 id="diff"&gt;Diff&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-diff" data-lang="diff"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; params:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; toc:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gd"&gt;- minWordCount: 400
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gi"&gt;+ minWordCount: 250
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; showWordCount: true
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="json"&gt;JSON&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&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;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;title&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Code blocks&amp;#34;&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="nt"&gt;&amp;#34;tags&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;code&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;markdown&amp;#34;&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="nt"&gt;&amp;#34;draft&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&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="nt"&gt;&amp;#34;readingTime&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&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;h2 id="line-numbers"&gt;Line numbers&lt;/h2&gt;&lt;p&gt;Add attributes after the language name on the opening fence. &lt;code&gt;{linenos=table}&lt;/code&gt; puts the line numbers in a column of their own, fully apart from the code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="w"&gt; &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="nx"&gt;r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="nb"&gt;rune&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&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="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &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="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&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="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="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&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="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;{linenos=inline}&lt;/code&gt; writes the numbers at the start of each line of code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="ln"&gt;1&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;a sky full of stars tonight&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&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="ln"&gt;2&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;longest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;words&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;len&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="ln"&gt;3&lt;/span&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;longest&lt;/span&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;&lt;code&gt;linenostart&lt;/code&gt; picks the first number, handy when quoting a few lines from the middle of a long file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;42
&lt;/span&gt;&lt;span class="lnt"&gt;43
&lt;/span&gt;&lt;span class="lnt"&gt;44
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&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;pagination&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;pagerSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;5&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;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;page&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="highlighted-lines"&gt;Highlighted lines&lt;/h2&gt;&lt;p&gt;&lt;code&gt;{hl_lines=[2,&amp;quot;4-5&amp;quot;]}&lt;/code&gt; highlights line 2 and lines 4 to 5, drawing the reader&amp;rsquo;s eye to what matters:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&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&gt;&lt;/span&gt;&lt;span class="line hl"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;saved&lt;/span&gt; &lt;span class="o"&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="s2"&gt;&amp;#34;theme&amp;#34;&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;saved&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 hl"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;saved&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line hl"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Theme: &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;saved&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&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="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="no-language"&gt;No language&lt;/h2&gt;&lt;p&gt;A fence without a language shows plain monospace text with no colours and no label, but it still gets a copy button:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;nocturne/
├── layouts/
├── assets/
└── exampleSite/
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A block indented by four spaces is Markdown&amp;rsquo;s older code syntax, and it is treated just the same:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hugo version
hugo env
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="the-copy-button"&gt;The copy button&lt;/h2&gt;&lt;p&gt;The &lt;strong&gt;Copy&lt;/strong&gt; button copies the code exactly, keeping the lines as they are in the source. Line numbers are left out, whether they sit in their own column (&lt;code&gt;table&lt;/code&gt;) or inside the code (&lt;code&gt;inline&lt;/code&gt;), so whatever you paste runs as is. After a click the button reads &lt;strong&gt;Copied&lt;/strong&gt; for a moment, and screen readers announce the result too.&lt;/p&gt;
&lt;p&gt;The button only appears when the browser allows writing to the clipboard, which means over HTTPS or on &lt;code&gt;localhost&lt;/code&gt;. When you print the page, copy buttons are hidden.&lt;/p&gt;</description></item><item><title>Images in a post</title><link>https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/</link><pubDate>Fri, 12 Jun 2026 20:00:00 +0700</pubDate><guid>https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/</guid><description>&lt;img src="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/dem-thanh-pho.jpg" alt="A horizontal gradient from near-black navy on the left to pale sky blue on the right, like a city sky at dusk"&gt;&lt;p&gt;That is &lt;code&gt;dem-thanh-pho.jpg&lt;/code&gt; (1600×900), stored in the same folder as the post. As the first image, right at the top, it is likely the largest thing on screen when the page appears, so the theme loads it straight away with &lt;code&gt;loading=&amp;quot;eager&amp;quot;&lt;/code&gt; and &lt;code&gt;fetchpriority=&amp;quot;high&amp;quot;&lt;/code&gt;. Every image after it loads lazily, as the reader scrolls near.&lt;/p&gt;
&lt;p&gt;Hugo knows the image&amp;rsquo;s size, so the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; carries &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt;: the browser reserves the space and the text does not jump when the image arrives. It also gets a &lt;code&gt;srcset&lt;/code&gt; of WebP copies 480, 960, 1440 and 1600 pixels wide, and the browser picks the one that fits the screen. Click the image to open the original file.&lt;/p&gt;
&lt;p&gt;The same image is set as &lt;code&gt;cover.image&lt;/code&gt; in the front matter. The theme does not draw a cover above the post; it uses the image for the Open Graph card shown when someone pastes the post&amp;rsquo;s link into a social network or a chat app.&lt;/p&gt;
&lt;h2 id="images-in-the-bundle"&gt;Images in the bundle&lt;/h2&gt;&lt;p&gt;An image next to &lt;code&gt;index.md&lt;/code&gt; is a page resource, referenced by its file name alone. JPEG, PNG and WebP files get resized copies at build time; SVG and GIF are served as they are.&lt;/p&gt;
&lt;h3 id="a-png-with-attributes"&gt;A PNG with attributes&lt;/h3&gt;&lt;img src="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/hoa-van.png" alt="A 16:9 frame whose background shades from navy through blue to teal, with a charcoal square in the middle" class="wide" id="hoa-van"&gt;&lt;p&gt;&lt;code&gt;hoa-van.png&lt;/code&gt; (1200×675) gets the same treatment as the JPG: a size and a WebP &lt;code&gt;srcset&lt;/code&gt;. The &lt;code&gt;{#hoa-van .wide}&lt;/code&gt; line right below it is a Markdown attribute that puts an &lt;code&gt;id&lt;/code&gt; and a class on the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; itself. That lets you &lt;a href="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/#hoa-van"&gt;link to this exact image&lt;/a&gt; or style the &lt;code&gt;wide&lt;/code&gt; class in your own CSS.&lt;/p&gt;
&lt;h3 id="a-webp-with-a-caption"&gt;A WebP with a caption&lt;/h3&gt;&lt;figure&gt;&lt;img src="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/binh-minh.webp" alt="A diagonal gradient from dark moss green in the bottom-left corner to pale teal in the top right"&gt;&lt;figcaption&gt;Sunrise: this image has a title in quotes, so it is wrapped in a figure and the title becomes this caption.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;An image that stands alone in its paragraph and has a title becomes a &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; with a &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;. The alt text describes what is in the picture for screen reader users, while the caption is a remark everyone sees; the two should complement each other, not repeat each other.&lt;/p&gt;
&lt;h3 id="a-gif-served-as-is"&gt;A GIF served as is&lt;/h3&gt;&lt;img src="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/song.gif" alt="Vertical blue bands, from pale sky blue to near-black, sliding sideways in a loop"&gt;&lt;p&gt;Hugo cannot resize a GIF and keep it moving, so &lt;code&gt;song.gif&lt;/code&gt; is served exactly as stored, with no &lt;code&gt;srcset&lt;/code&gt;, &lt;code&gt;width&lt;/code&gt; or &lt;code&gt;height&lt;/code&gt;. It still loads lazily like every other image.&lt;/p&gt;
&lt;h2 id="an-image-inside-a-link"&gt;An image inside a link&lt;/h2&gt;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Compass" rel="noopener noreferrer"&gt;&lt;img src="https://tiennm99.github.io/nocturne/2026/06/12/hinh-anh/la-ban.svg" alt="A round compass face on a dark background with a blue rim and a blue-and-white diamond needle pointing straight up"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;la-ban.svg&lt;/code&gt; is a vector image, so it stays as is: it is sharp at any size and needs no resized copies. It already sits inside a link to Wikipedia, so the theme does not wrap it in a second link to the original file — an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; inside an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; is invalid HTML.&lt;/p&gt;
&lt;h2 id="an-image-from-the-static-folder"&gt;An image from the static folder&lt;/h2&gt;&lt;img src="https://tiennm99.github.io/nocturne/img/tinh-tu-static.png" alt="A broadcast test card: six vertical bars in red, green, yellow, blue, magenta and cyan, crossed by a diagonal rainbow streak"&gt;&lt;p&gt;This file lives at &lt;code&gt;static/img/tinh-tu-static.png&lt;/code&gt; and is referenced with the root-relative path &lt;code&gt;/img/tinh-tu-static.png&lt;/code&gt;. The demo runs under &lt;code&gt;/nocturne/&lt;/code&gt; on GitHub Pages, so the theme adds the base path and the image loads from &lt;code&gt;/nocturne/img/tinh-tu-static.png&lt;/code&gt;. Change &lt;code&gt;baseURL&lt;/code&gt; and the image still shows up, no edits to the post. Files in &lt;code&gt;static/&lt;/code&gt; are not page resources, so there are no resized copies.&lt;/p&gt;
&lt;h2 id="images-from-another-host"&gt;Images from another host&lt;/h2&gt;&lt;img src="https://tiennm99.github.io/nocturne/img/tinh-tu-static.png" alt="The same six-bar test card, this time loaded from a full URL"&gt;&lt;p&gt;A full URL starting with &lt;code&gt;https://&lt;/code&gt; is left untouched. The theme does not download remote images at build time, so it does not know their size.&lt;/p&gt;
&lt;h3 id="a-gif-that-becomes-a-video"&gt;A GIF that becomes a video&lt;/h3&gt;&lt;img src="https://tiennm99.github.io/nocturne/media/the-gioi-song.gif" alt="Diagonal blue bands, from pale sky blue to almost black, sweeping across the frame in a loop"&gt;&lt;p&gt;To handle remote images, a site can add a &lt;code&gt;layouts/_partials/image/remote.html&lt;/code&gt; partial; the theme calls it for every full URL. The demo&amp;rsquo;s partial knows one case only: a GIF in the &lt;code&gt;/media/&lt;/code&gt; folder that has an MP4 file of the same name. That image is swapped for a muted, looping &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; that loads only when you scroll near it and plays only while it is on screen. The MP4 here weighs about 4 KB against the GIF&amp;rsquo;s 23 KB. With JavaScript turned off, the browser shows the original GIF.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/tiennm99/nocturne/blob/main/docs/customization.md#remote-images" rel="noopener noreferrer"&gt;theme&amp;rsquo;s customization guide&lt;/a&gt; explains how to write this partial.&lt;/p&gt;</description></item><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></channel></rss>