<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <id>https://thatcat.space/tags/hugo/</id>
    <title>Hugo - Tag - that cat space</title>
    <link href="https://thatcat.space/tags/hugo/index.xml" rel="self" type="application/atom+xml" />
    <link href="https://thatcat.space/tags/hugo/" />
    <subtitle>Hugo - Tag - that cat space</subtitle>
    <generator uri="https://gohugo.io/" version="0.135.0">Hugo</generator><updated>2024-05-27T15:35:01+03:00</updated><entry>
            <title type="html"><![CDATA[]]></title>
            <link href="https://thatcat.space/notes/5/" rel="alternate" type="text/html" /><link href="https://thatcat.space/ru/notes/5/" rel="alternate" type="text/html" hreflang="ru" />
            <published>2024-05-27T15:35:01+03:00</published>
            <updated>2024-05-27T15:35:01+03:00</updated>
            <author>
                <name>Author</name>
            </author>
            <id>https://thatcat.space/notes/5/</id>
            <content type="html"><![CDATA[<p>I haven&rsquo;t touched the site for pretty long time, but recently after re-installing Linux I&rsquo;ve decided to update Hugo to latest version, and&hellip; found out that my site was broken in serveral places.</p>
<ol>
<li>I had to move most of the params in language sections to <code>params</code> sub-section. Actually, <code>hugo serve</code> warns about wrongly placed parameters, so it&rsquo;s not a big problem.</li>
<li>I&rsquo;ve removed <code>taxonomyTerm</code> from the <code>outputs</code> section in config. As I understood, it&rsquo;s all merged with <code>taxonomy</code> now, so separate parameter doesn&rsquo;t make sense.</li>
<li>I had to make category keys in theme to lower case. 0.123.3 has added the <a href="https://gohugo.io/getting-started/configuration/#capitalizelisttitles" target="_blank" rel="noopener noreffer">capitalizeListTitles</a>
 option (i.e. <code>font-patching</code> became <code>Font-Patching</code>). For some people it&rsquo;s conveinent, but for me it broke localization, since it was based on lowercased keys. In truth, making keys lowercased was a rushed decision, because I could just disable an option, but at some point there could be a problem when something somewhere will be in wrong case, and will break everything, so it&rsquo;s for the better.</li>
</ol>
<p>But now everything is generated with fresh Hugo 0.126.1, and works as expected. I think I&rsquo;ll write a theme for Hugo sometime, but I think it won&rsquo;t happen soon.</p>
]]></content>
        </entry>
<entry>
            <title type="html"><![CDATA[]]></title>
            <link href="https://thatcat.space/notes/2/" rel="alternate" type="text/html" /><link href="https://thatcat.space/ru/notes/2/" rel="alternate" type="text/html" hreflang="ru" />
            <published>2023-03-10T05:24:45+03:00</published>
            <updated>2024-02-04T09:28:46+03:00</updated>
            <author>
                <name>Author</name>
            </author>
            <id>https://thatcat.space/notes/2/</id>
            <content type="html"><![CDATA[<p>Since I&rsquo;ve started localization talk, this note will be devoted to localization. To be honest, I&rsquo;m not sure since what version this happened, but localization in Hugo has greatly stepped forward.</p>
<p>First, Hugo now natively supports plurals for many languages. All thanks to <a href="https://github.com/gohugoio/go-i18n" target="_blank" rel="noopener noreffer">https://github.com/gohugoio/go-i18n</a>
 module (fork of <a href="https://github.com/nicksnyder/go-i18n" target="_blank" rel="noopener noreffer">https://github.com/nicksnyder/go-i18n</a>
 ). Usage is very simple: create reqired keys in localization file and translate them. Here&rsquo;s current list for reference (with two-letter language codes): <a href="https://github.com/gohugoio/go-i18n/blob/main/v2/internal/plural/codegen/plurals.xml" target="_blank" rel="noopener noreffer">https://github.com/gohugoio/go-i18n/blob/main/v2/internal/plural/codegen/plurals.xml</a>
</p>
<p>Second, Hugo can now localize dates through <code>time.Format DATE_FORMAT DATE</code>. I&rsquo;ve rewritten templates a little, and now places with dates from these:</p>
<pre>{{- with .Site.Params.dateformat | default &#34;2006-01-02&#34; | .PublishDate.Format -}}</pre><p>became these:</p>
<pre>{{- with time.Format (.Site.Params.dateformat | default &#34;2006-01-02&#34;) .PublishDate -}}</pre><p>Category and meta tags localization I had to done on my own. They may not fully work with new section though, but I&rsquo;ll fix it sometime.</p>
]]></content>
        </entry>
</feed>
