<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leron Luo</title>
    <description>The latest articles on DEV Community by Leron Luo (@leronluo).</description>
    <link>https://dev.to/leronluo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1837676%2F00701bad-5257-4987-8754-1740d70cc55c.gif</url>
      <title>DEV Community: Leron Luo</title>
      <link>https://dev.to/leronluo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leronluo"/>
    <language>en</language>
    <item>
      <title>hugo is a cli based tool, does it have a CMS interface? it seems inconvinient using command line than using a cms interface</title>
      <dc:creator>Leron Luo</dc:creator>
      <pubDate>Thu, 25 Jul 2024 09:45:57 +0000</pubDate>
      <link>https://dev.to/leronluo/hugo-is-a-cli-based-tool-does-it-have-a-cms-interface-it-seems-inconvinient-using-command-line-than-using-a-cms-interface-2l21</link>
      <guid>https://dev.to/leronluo/hugo-is-a-cli-based-tool-does-it-have-a-cms-interface-it-seems-inconvinient-using-command-line-than-using-a-cms-interface-2l21</guid>
      <description>&lt;p&gt;You're right to ask about tags and categories! Hugo does support them, but it's a bit different from how traditional CMSs handle them. Here's how it works:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hugo's approach to tags and categories:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Front matter:&lt;/strong&gt; Hugo uses "front matter" in your content files (usually Markdown) to define metadata, including tags and categories. This metadata is written in YAML format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Taxonomies:&lt;/strong&gt; Hugo uses the concept of "taxonomies" to organize content.  Think of taxonomies as a way to group your content based on different criteria.  Tags and categories are examples of taxonomies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Templating:&lt;/strong&gt; Hugo's templating system allows you to display content based on its taxonomies. You can create lists of posts by tag, categories, or even custom taxonomies you define.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's say you have a blog post about "Cooking with Mushrooms" in a file named &lt;code&gt;cooking-with-mushrooms.md&lt;/code&gt;.  You might add the following front matter to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Cooking&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Mushrooms"&lt;/span&gt;
&lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2023-10-26T15:00:00-05:00&lt;/span&gt;
&lt;span class="na"&gt;draft&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;mushrooms&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cooking&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;recipes&lt;/span&gt;
&lt;span class="na"&gt;categories&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;food&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="nn"&gt;...&lt;/span&gt; &lt;span class="s"&gt;(Your blog post content here) ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to use tags and categories in your Hugo website:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Define taxonomies:&lt;/strong&gt; You'll need to define your taxonomies in your &lt;code&gt;config.toml&lt;/code&gt; file.  This tells Hugo how to handle tags and categories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add tags and categories to your content:&lt;/strong&gt; As shown in the example above, you'll add tags and categories to the front matter of your content files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create templates:&lt;/strong&gt;  You'll need to create templates (HTML files) that display your content based on the taxonomies. Hugo's templating system provides tools for this.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Key points:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hugo doesn't have a visual interface for managing tags and categories.  You'll be doing it through your content files and templates.&lt;/li&gt;
&lt;li&gt;Hugo's approach is more flexible and powerful than traditional CMSs, but it requires a bit more technical knowledge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://gohugo.io/" rel="noopener noreferrer"&gt;https://gohugo.io/&lt;/a&gt; - Hugo's official documentation&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://gohugo.io/" rel="noopener noreferrer"&gt;https://gohugo.io/&lt;/a&gt; - A comprehensive guide to Hugo's taxonomies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know if you have any other questions!&lt;/p&gt;

</description>
      <category>查询</category>
      <category>consult</category>
      <category>操作</category>
      <category>operations</category>
    </item>
  </channel>
</rss>
