<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hugo on AngeCI’s Blog</title><link>https://angeci.github.io/blog/tags/hugo/</link><description>Recent content in Hugo on AngeCI’s Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 24 Apr 2026 10:45:25 +0000</lastBuildDate><atom:link href="https://angeci.github.io/blog/tags/hugo/index.xml" rel="self" type="application/rss+xml"/><item><title>RSS Publish Date Adjustment</title><link>https://angeci.github.io/blog/rss-publish-date-adjustment/</link><pubDate>Fri, 24 Apr 2026 10:45:25 +0000</pubDate><guid>https://angeci.github.io/blog/rss-publish-date-adjustment/</guid><description>&lt;blockquote class="alert alert-warning"&gt;
 &lt;div class="alert-header"&gt;
 &lt;span class="alert-icon"&gt;⚠️&lt;/span&gt;
 &lt;span class="alert-title"&gt;Notice&lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="alert-body"&gt;
 &lt;p&gt;This post is a draft translation from &lt;a class="link" href="https://angeci.github.io/blog/zh/rss-publish-date-adjustment/" &gt;the Chinese version&lt;/a&gt; which have not yet been thoroughly proofread.&lt;/p&gt;
 &lt;/div&gt;
 &lt;/blockquote&gt;
&lt;p&gt;After reading about Alex Hsu’s post “&lt;a class="link" href="https://alexhsu.com/en/publish-date" target="_blank" rel="noopener"
 &gt;Your RSS posts might only live half as long as everyone else’s&lt;/a&gt;” today, I immediately checked the information in my RSS feed, and found out that the &lt;code&gt;&amp;lt;pubDate&amp;gt;&lt;/code&gt; field inside the RSS feed takes the &lt;code&gt;date&lt;/code&gt; field instead of the &lt;code&gt;lastmod&lt;/code&gt; field, specified inside the post’s frontmatter. The publishing time I expect to be displayed in RSS feed should be the latter.&lt;/p&gt;
&lt;h1 id="my-current-publishing-process"&gt;&lt;a href="#my-current-publishing-process" class="header-anchor"&gt;&lt;/a&gt;My current publishing process
&lt;/h1&gt;&lt;p&gt;This site is currently built using Hugo and GitHub Pages. When I write a new article, I will look at the current time just before saving the file, then manually fill in the time into the &lt;code&gt;date&lt;/code&gt; field of the frontmatter, and then push it to GitHub as soon as possible. When I update old articles, I don’t edit the &lt;code&gt;date&lt;/code&gt; field but &lt;code&gt;lastmod&lt;/code&gt; instead. Little did I know, that such an update method would actually screw myself up.&lt;/p&gt;
&lt;h1 id="start-working-on-it"&gt;&lt;a href="#start-working-on-it" class="header-anchor"&gt;&lt;/a&gt;Start working on it
&lt;/h1&gt;&lt;p&gt;To modify the publish date inside the RSS feed, we can start with the file &lt;a class="link" href="https://github.com/CaiJimmy/hugo-theme-stack/blob/master/layouts/rss.xml" target="_blank" rel="noopener"
 &gt;&lt;code&gt;layouts/rss.xml&lt;/code&gt;&lt;/a&gt; (at least this is the file for the theme I am using now). There is a line in this file that looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e2e4e5;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff6ac1"&gt;&amp;lt;pubDate&amp;gt;&lt;/span&gt;{{ .PublishDate.Format &amp;#34;Mon, 02 Jan 2006 15:04:05 -0700&amp;#34; | safeHTML }}&lt;span style="color:#ff6ac1"&gt;&amp;lt;/pubDate&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Where &lt;a class="link" href="https://gohugo.io/methods/page/publishdate/" target="_blank" rel="noopener"
 &gt;&lt;code&gt;.PublishDate&lt;/code&gt;&lt;/a&gt; represents the &lt;code&gt;date&lt;/code&gt; field of the frontmatter, and &lt;code&gt;lastmod&lt;/code&gt; is &lt;a class="link" href="https://gohugo.io/methods/page/lastmod/" target="_blank" rel="noopener"
 &gt;&lt;code&gt;.Lastmod&lt;/code&gt;&lt;/a&gt;. Just replace this value and it should be done.&lt;/p&gt;
&lt;p&gt;I don’t know if it is possible to automatically fill in and change the publish date based on my current publishing process. If possible, I might try it when I have time in the future.&lt;/p&gt;
&lt;blockquote class="alert alert-important"&gt;
 &lt;div class="alert-header"&gt;
 &lt;span class="alert-icon"&gt;📌&lt;/span&gt;
 &lt;span class="alert-title"&gt;Update on 2026/04/24&lt;/span&gt;
 &lt;/div&gt;
 &lt;div class="alert-body"&gt;
 &lt;p&gt;Found &lt;a class="link" href="https://gohugo.io/configuration/all/#enablegitinfo" target="_blank" rel="noopener"
 &gt;this Hugo option&lt;/a&gt; to fetch dates from Git. Not sure if it’s useful for me or not.&lt;/p&gt;
 &lt;/div&gt;
 &lt;/blockquote&gt;</description></item></channel></rss>