<?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 My Blog</title><link>https://liu-houliang.github.io/hugo-stack-starter/en/tags/theme/</link><description>Recent content in Theme on My Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 23 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://liu-houliang.github.io/hugo-stack-starter/en/tags/theme/index.xml" rel="self" type="application/rss+xml"/><item><title>Theme Customizations: What I Have Changed</title><link>https://liu-houliang.github.io/hugo-stack-starter/en/post/theme-customization/</link><pubDate>Fri, 10 Apr 2026 00:00:00 +0000</pubDate><guid>https://liu-houliang.github.io/hugo-stack-starter/en/post/theme-customization/</guid><description>&lt;p&gt;This template is developed based on &lt;a class="link" href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener"
 &gt;Hugo Theme Stack v4&lt;/a&gt;. While maintaining the integrity of the original features, a series of visual and interactive enhancements have been made.&lt;/p&gt;
&lt;p&gt;All modifications are implemented using Hugo&amp;rsquo;s override mechanism (by creating files with the same names in &lt;code&gt;assets/&lt;/code&gt; and &lt;code&gt;layouts/&lt;/code&gt;), &lt;strong&gt;without modifying the original theme&amp;rsquo;s source code&lt;/strong&gt;, making it easy to upgrade the theme version at any time.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-global-color-system"&gt;&lt;a href="#1-global-color-system" class="header-anchor"&gt;&lt;/a&gt;1. Global Color System
&lt;/h2&gt;&lt;p&gt;The entire set of color variables has been redefined, adopting a deep blue + warm off-white color scheme:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Light Mode&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Background color: Warm off-white &lt;code&gt;#f8f7f2&lt;/code&gt; (easier on the eyes than pure white)&lt;/li&gt;
&lt;li&gt;Accent color: Deep sea blue &lt;code&gt;#1B365D&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Card background: &lt;code&gt;#fdfdfb&lt;/code&gt; (slightly warm white)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Dark Mode&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Background color: &lt;code&gt;#101214&lt;/code&gt; (dark grayish-black)&lt;/li&gt;
&lt;li&gt;Card background: &lt;code&gt;#1c2128&lt;/code&gt; (GitHub dark style)&lt;/li&gt;
&lt;li&gt;In dark mode, images are automatically dimmed, restoring brightness on hover&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Modification location: &lt;code&gt;:root&lt;/code&gt; variables in &lt;code&gt;assets/scss/custom.scss&lt;/code&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="2-mac-style-code-blocks"&gt;&lt;a href="#2-mac-style-code-blocks" class="header-anchor"&gt;&lt;/a&gt;2. Mac-Style Code Blocks
&lt;/h2&gt;&lt;p&gt;The original theme&amp;rsquo;s code blocks are quite simple, but this template comprehensively beautifies them:&lt;/p&gt;
&lt;h3 id="top-title-bar"&gt;&lt;a href="#top-title-bar" class="header-anchor"&gt;&lt;/a&gt;Top Title Bar
&lt;/h3&gt;&lt;p&gt;A macOS-style three-color dot decoration (red, yellow, green) has been added to every code block, simulating a terminal window appearance.&lt;/p&gt;
&lt;h3 id="redesigned-copy-button"&gt;&lt;a href="#redesigned-copy-button" class="header-anchor"&gt;&lt;/a&gt;Redesigned Copy Button
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Changed from an inconspicuous icon button to a text button floating on the right side of the title bar&lt;/li&gt;
&lt;li&gt;Light mode: Frosted glass style (&lt;code&gt;backdrop-filter: blur&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Dark mode: Dark translucent background&lt;/li&gt;
&lt;li&gt;Clicking the button changes the text to &amp;ldquo;✓ Copied!&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="auto-collapse-long-code-blocks"&gt;&lt;a href="#auto-collapse-long-code-blocks" class="header-anchor"&gt;&lt;/a&gt;Auto-Collapse Long Code Blocks
&lt;/h3&gt;&lt;p&gt;Code blocks taller than 600px automatically collapse, with an &amp;ldquo;Expand Code&amp;rdquo; button at the bottom:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When collapsed, a gradient overlay appears at the bottom&lt;/li&gt;
&lt;li&gt;After expanding, the button text changes to &amp;ldquo;Collapse Code&amp;rdquo;&lt;/li&gt;
&lt;li&gt;When collapsing, it automatically scrolls back to the top of the code block, preventing page layout confusion&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="beautified-scrollbars"&gt;&lt;a href="#beautified-scrollbars" class="header-anchor"&gt;&lt;/a&gt;Beautified Scrollbars
&lt;/h3&gt;&lt;p&gt;The horizontal scrollbar of code blocks is transparent by default and only appears on hover, keeping the interface clean.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="3-homepage-two-column-grid-layout"&gt;&lt;a href="#3-homepage-two-column-grid-layout" class="header-anchor"&gt;&lt;/a&gt;3. Homepage Two-Column Grid Layout
&lt;/h2&gt;&lt;p&gt;On desktop screens (width ≥ 1024px), the homepage article list changes to a 2-column grid display:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each article is presented as a card containing a cover image, title, summary, and meta information&lt;/li&gt;
&lt;li&gt;Cards have a slight floating animation on hover&lt;/li&gt;
&lt;li&gt;Long article titles and summaries are automatically truncated (2 lines)&lt;/li&gt;
&lt;li&gt;Automatically reverts to a single-column list on mobile devices&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To enable: Set it in &lt;code&gt;params.toml&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;homepage&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;grid&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="4-redesigned-mobile-navigation"&gt;&lt;a href="#4-redesigned-mobile-navigation" class="header-anchor"&gt;&lt;/a&gt;4. Redesigned Mobile Navigation
&lt;/h2&gt;&lt;p&gt;The original theme&amp;rsquo;s mobile navigation is relatively basic. This template completely rewrites the mobile experience:&lt;/p&gt;
&lt;h3 id="sticky-top-navigation-bar"&gt;&lt;a href="#sticky-top-navigation-bar" class="header-anchor"&gt;&lt;/a&gt;Sticky Top Navigation Bar
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Fixed to the top (sticky), remaining visible as you scroll down the page&lt;/li&gt;
&lt;li&gt;Left side: Avatar + Site name (click to return home)&lt;/li&gt;
&lt;li&gt;Right side: Dark mode toggle, language switch, search, and hamburger menu&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="hamburger-menu"&gt;&lt;a href="#hamburger-menu" class="header-anchor"&gt;&lt;/a&gt;Hamburger Menu
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Clicking expands the side menu with a fade-in animation&lt;/li&gt;
&lt;li&gt;The top bar title fades out when the menu expands to prevent overlap&lt;/li&gt;
&lt;li&gt;The current page&amp;rsquo;s menu item is highlighted&lt;/li&gt;
&lt;li&gt;Automatically closes when the screen width recovers (e.g., rotating device)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="search-box"&gt;&lt;a href="#search-box" class="header-anchor"&gt;&lt;/a&gt;Search Box
&lt;/h3&gt;&lt;p&gt;The search box in the desktop sidebar has been redesigned to match the card style.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="5-blog-stats-page"&gt;&lt;a href="#5-blog-stats-page" class="header-anchor"&gt;&lt;/a&gt;5. Blog Stats Page
&lt;/h2&gt;&lt;p&gt;A feature-rich &lt;code&gt;/stats/&lt;/code&gt; statistics page has been added, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Summary Cards&lt;/strong&gt;: Total articles, total words, running days (animated scrolling numbers)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Category Distribution&lt;/strong&gt;: Category list with progress bars, clickable to enter category pages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Popular Tags&lt;/strong&gt;: Tag cloud display (top 30 tags)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writing Habits&lt;/strong&gt;: Posting habit analysis by day of the week and time of day (based on Git commit times)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Yearly Heatmap&lt;/strong&gt;: GitHub-style contribution heatmap (publishing record for the past year)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Configuration page entry: Set &lt;code&gt;layout: stats&lt;/code&gt; in &lt;code&gt;content/stats/index.en.md&lt;/code&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="6-footer-runtime"&gt;&lt;a href="#6-footer-runtime" class="header-anchor"&gt;&lt;/a&gt;6. Footer Runtime
&lt;/h2&gt;&lt;p&gt;The footer now displays the blog&amp;rsquo;s runtime, calculating the days, hours, and minutes since the launch date.&lt;/p&gt;
&lt;p&gt;Clicking it navigates to the Stats page.&lt;/p&gt;
&lt;p&gt;Configure launch date:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;footer&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;launchDate&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2024-09-09&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="7-custom-shortcodes"&gt;&lt;a href="#7-custom-shortcodes" class="header-anchor"&gt;&lt;/a&gt;7. Custom Shortcodes
&lt;/h2&gt;&lt;h3 id="timeline"&gt;&lt;a href="#timeline" class="header-anchor"&gt;&lt;/a&gt;Timeline
&lt;/h3&gt;&lt;p&gt;Suitable for displaying growth history, tech stack evolution, etc.:&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; timeline &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; timeline-item date=&amp;#34;2024-01&amp;#34; &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Started learning Hugo
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; /timeline-item &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; timeline-item date=&amp;#34;2024-06&amp;#34; &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Blog officially launched
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; /timeline-item &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{{&amp;lt; /timeline &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="title-divider"&gt;&lt;a href="#title-divider" class="header-anchor"&gt;&lt;/a&gt;Title Divider
&lt;/h3&gt;&lt;p&gt;Suitable for separating content sections like diaries or fitness logs:&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; title &amp;#34;Morning Run&amp;#34; &amp;#34;green&amp;#34; &amp;gt;}}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Supported colors: &lt;code&gt;red&lt;/code&gt;, &lt;code&gt;orange&lt;/code&gt;, &lt;code&gt;yellow&lt;/code&gt;, &lt;code&gt;green&lt;/code&gt;, &lt;code&gt;teal&lt;/code&gt;, &lt;code&gt;blue&lt;/code&gt;, &lt;code&gt;indigo&lt;/code&gt;, &lt;code&gt;purple&lt;/code&gt;, &lt;code&gt;pink&lt;/code&gt;, &lt;code&gt;gray&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="how-to-customize-colors"&gt;&lt;a href="#how-to-customize-colors" class="header-anchor"&gt;&lt;/a&gt;How to Customize Colors
&lt;/h2&gt;&lt;p&gt;Edit &lt;code&gt;assets/scss/custom.scss&lt;/code&gt;, modifying the variables in &lt;code&gt;:root&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-scss" data-lang="scss"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;:root&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="na"&gt;--accent-color&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#1B365D&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/* Accent color (buttons, links, etc.) */&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;--body-background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#f8f7f2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/* Page background */&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="na"&gt;--card-background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#fdfdfb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/* Card background */&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;After saving, Hugo will automatically recompile and refresh the browser in real-time.&lt;/p&gt;</description></item></channel></rss>