<?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://www.newsun.cloud/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://www.newsun.cloud/en/tags/theme/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Theme Customizations: What I Have Changed</title>
            <link>https://www.newsun.cloud/en/post/theme-customization/</link>
            <pubDate>Fri, 10 Apr 2026 00:00:00 +0000</pubDate>
            <guid>https://www.newsun.cloud/en/post/theme-customization/</guid>
            <description>&lt;p&gt;This template is developed based on &lt;a class=&#34;link&#34; href=&#34;https://github.com/CaiJimmy/hugo-theme-stack&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &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;&#xA;&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;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-global-color-system&#34;&gt;&lt;a href=&#34;#1-global-color-system&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;1. Global Color System&#xA;&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;&#xA;&lt;p&gt;&lt;strong&gt;Light Mode&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&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;&#xA;&lt;li&gt;Accent color: Deep sea blue &lt;code&gt;#1B365D&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Card background: &lt;code&gt;#fdfdfb&lt;/code&gt; (slightly warm white)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Dark Mode&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Background color: &lt;code&gt;#101214&lt;/code&gt; (dark grayish-black)&lt;/li&gt;&#xA;&lt;li&gt;Card background: &lt;code&gt;#1c2128&lt;/code&gt; (GitHub dark style)&lt;/li&gt;&#xA;&lt;li&gt;In dark mode, images are automatically dimmed, restoring brightness on hover&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&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;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;2-mac-style-code-blocks&#34;&gt;&lt;a href=&#34;#2-mac-style-code-blocks&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;2. Mac-Style Code Blocks&#xA;&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;&#xA;&lt;h3 id=&#34;top-title-bar&#34;&gt;&lt;a href=&#34;#top-title-bar&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Top Title Bar&#xA;&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;&#xA;&lt;h3 id=&#34;redesigned-copy-button&#34;&gt;&lt;a href=&#34;#redesigned-copy-button&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Redesigned Copy Button&#xA;&lt;/h3&gt;&lt;ul&gt;&#xA;&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;&#xA;&lt;li&gt;Light mode: Frosted glass style (&lt;code&gt;backdrop-filter: blur&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Dark mode: Dark translucent background&lt;/li&gt;&#xA;&lt;li&gt;Clicking the button changes the text to &amp;ldquo;✓ Copied!&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;auto-collapse-long-code-blocks&#34;&gt;&lt;a href=&#34;#auto-collapse-long-code-blocks&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Auto-Collapse Long Code Blocks&#xA;&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;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When collapsed, a gradient overlay appears at the bottom&lt;/li&gt;&#xA;&lt;li&gt;After expanding, the button text changes to &amp;ldquo;Collapse Code&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;When collapsing, it automatically scrolls back to the top of the code block, preventing page layout confusion&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;beautified-scrollbars&#34;&gt;&lt;a href=&#34;#beautified-scrollbars&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Beautified Scrollbars&#xA;&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;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;3-homepage-two-column-grid-layout&#34;&gt;&lt;a href=&#34;#3-homepage-two-column-grid-layout&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;3. Homepage Two-Column Grid Layout&#xA;&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;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each article is presented as a card containing a cover image, title, summary, and meta information&lt;/li&gt;&#xA;&lt;li&gt;Cards have a slight floating animation on hover&lt;/li&gt;&#xA;&lt;li&gt;Long article titles and summaries are automatically truncated (2 lines)&lt;/li&gt;&#xA;&lt;li&gt;Automatically reverts to a single-column list on mobile devices&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To enable: Set it in &lt;code&gt;params.toml&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;homepage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;grid&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;&#xA;&lt;h2 id=&#34;4-redesigned-mobile-navigation&#34;&gt;&lt;a href=&#34;#4-redesigned-mobile-navigation&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;4. Redesigned Mobile Navigation&#xA;&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;&#xA;&lt;h3 id=&#34;sticky-top-navigation-bar&#34;&gt;&lt;a href=&#34;#sticky-top-navigation-bar&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Sticky Top Navigation Bar&#xA;&lt;/h3&gt;&lt;ul&gt;&#xA;&lt;li&gt;Fixed to the top (sticky), remaining visible as you scroll down the page&lt;/li&gt;&#xA;&lt;li&gt;Left side: Avatar + Site name (click to return home)&lt;/li&gt;&#xA;&lt;li&gt;Right side: Dark mode toggle, language switch, search, and hamburger menu&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;hamburger-menu&#34;&gt;&lt;a href=&#34;#hamburger-menu&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Hamburger Menu&#xA;&lt;/h3&gt;&lt;ul&gt;&#xA;&lt;li&gt;Clicking expands the side menu with a fade-in animation&lt;/li&gt;&#xA;&lt;li&gt;The top bar title fades out when the menu expands to prevent overlap&lt;/li&gt;&#xA;&lt;li&gt;The current page&amp;rsquo;s menu item is highlighted&lt;/li&gt;&#xA;&lt;li&gt;Automatically closes when the screen width recovers (e.g., rotating device)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;search-box&#34;&gt;&lt;a href=&#34;#search-box&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Search Box&#xA;&lt;/h3&gt;&lt;p&gt;The search box in the desktop sidebar has been redesigned to match the card style.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;5-blog-stats-page&#34;&gt;&lt;a href=&#34;#5-blog-stats-page&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;5. Blog Stats Page&#xA;&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;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Summary Cards&lt;/strong&gt;: Total articles, total words, running days (animated scrolling numbers)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Category Distribution&lt;/strong&gt;: Category list with progress bars, clickable to enter category pages&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Popular Tags&lt;/strong&gt;: Tag cloud display (top 30 tags)&lt;/li&gt;&#xA;&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;&#xA;&lt;li&gt;&lt;strong&gt;Yearly Heatmap&lt;/strong&gt;: GitHub-style contribution heatmap (publishing record for the past year)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&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;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;6-footer-runtime&#34;&gt;&lt;a href=&#34;#6-footer-runtime&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;6. Footer Runtime&#xA;&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;&#xA;&lt;p&gt;Clicking it navigates to the Stats page.&lt;/p&gt;&#xA;&lt;p&gt;Configure launch date:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;footer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;launchDate&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;2024-09-09&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;&#xA;&lt;h2 id=&#34;7-custom-shortcodes&#34;&gt;&lt;a href=&#34;#7-custom-shortcodes&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;7. Custom Shortcodes&#xA;&lt;/h2&gt;&lt;h3 id=&#34;timeline&#34;&gt;&lt;a href=&#34;#timeline&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Timeline&#xA;&lt;/h3&gt;&lt;p&gt;Suitable for displaying growth history, tech stack evolution, etc.:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; timeline &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; timeline-item date=&amp;#34;2024-01&amp;#34; &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Started learning Hugo&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; /timeline-item &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; timeline-item date=&amp;#34;2024-06&amp;#34; &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Blog officially launched&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; /timeline-item &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; /timeline &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;title-divider&#34;&gt;&lt;a href=&#34;#title-divider&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Title Divider&#xA;&lt;/h3&gt;&lt;p&gt;Suitable for separating content sections like diaries or fitness logs:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;{{&amp;lt; title &amp;#34;Morning Run&amp;#34; &amp;#34;green&amp;#34; &amp;gt;}}&#xA;&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;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;how-to-customize-colors&#34;&gt;&lt;a href=&#34;#how-to-customize-colors&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;How to Customize Colors&#xA;&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;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-scss&#34; data-lang=&#34;scss&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nd&#34;&gt;:root&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;na&#34;&gt;--accent-color&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;#1B365D&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;        &lt;span class=&#34;cm&#34;&gt;/* Accent color (buttons, links, etc.) */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;na&#34;&gt;--body-background&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;#f8f7f2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;     &lt;span class=&#34;cm&#34;&gt;/* Page background */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;na&#34;&gt;--card-background&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;#fdfdfb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;     &lt;span class=&#34;cm&#34;&gt;/* Card background */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&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;&#xA;</description>
        </item></channel>
</rss>
