<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Hugo on Cylon&#39;s Collection</title>
    <link>https://www.161616.top/tags/hugo/</link>
    <description>Recent content in Hugo on Cylon&#39;s Collection</description>
    <generator>Hugo -- 0.125.7</generator>
    <language>zh</language>
    <lastBuildDate>Wed, 27 Nov 2024 23:00:36 +0800</lastBuildDate>
    <atom:link href="https://www.161616.top/tags/hugo/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Hugo博客添加标签云</title>
      <link>https://www.161616.top/hugo-add-tag-cloud/</link>
      <pubDate>Wed, 27 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://www.161616.top/hugo-add-tag-cloud/</guid>
      <description>因为 www.sulvblog.cn 域名过期，正好需要查看这个配置，发现搜索引擎已经被删除了特备份一份
1.逻辑控制 定位到layouts/_default/terms.html，把之前的terms-tags标签控制代码注释掉，换成如下代码
html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 &amp;lt;ul class=&amp;#34;terms-tags&amp;#34;&amp;gt; {{- $type := .Type }} {{- range $key, $value := .Data.Terms.Alphabetical }} {{- $name := .Name }} {{- $count := .Count }} {{- with $.Site.GetPage (printf &amp;#34;/%s/%s&amp;#34; $type $name) }} &amp;lt;li&amp;gt; {{ $largestFontSize := 1.5 }} {{ $smallestFontSize := 1 }} {{ $fontSpread := sub $largestFontSize $smallestFontSize }} {{ $max := add (len (index $.</description>
    </item>
    <item>
      <title>Hugo - 为文章页面增加相关阅读区域</title>
      <link>https://www.161616.top/hugo-add-related-content-section/</link>
      <pubDate>Wed, 17 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://www.161616.top/hugo-add-related-content-section/</guid>
      <description>需求 在页面底部增加相关阅读区域：
简单实现与文章相同 tag 的文章列出到文章底部 实验步骤 新增 related 模板 在 layouts/partials/related.html 新创建一个模板，增加如下内容，本文主题为 PaperModX ，不同的主题，文件在不同目录下
html 1 2 3 4 5 6 7 8 9 {{ $related := .Site.RegularPages.Related . | first 3 }} {{ with $related }} &amp;lt;h3&amp;gt;Related Posts&amp;lt;/h3&amp;gt; &amp;lt;ul&amp;gt; {{ range . }} &amp;lt;li&amp;gt;&amp;lt;a href=&amp;#34;{{ .RelPermalink }}&amp;#34;&amp;gt;{{ .Title }}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt; {{ end }} &amp;lt;/ul&amp;gt; {{ end }} 将模板加载到文章列表模板内 然后需要在文章列表页底部包含这个 “模板” _default/single.html 不同主题在不同的目录下
html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 .</description>
    </item>
    <item>
      <title>Hugo - 去除Sitemap中的tags search等页面</title>
      <link>https://www.161616.top/hugo-sitemap-without-tag-page/</link>
      <pubDate>Sat, 13 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://www.161616.top/hugo-sitemap-without-tag-page/</guid>
      <description>需求 在不禁用分类的情况下，关闭对应 sitemap.xml 中的条目以优化 SEO
去除所有tag 去除所有分类 去除 search about me 这类页面 实验步骤 sitemap 是通过 go-template 目标进行的，只要可以使用对应语法过滤了相关路径即可以排除对应的页面
首先在配置文件增加 taxonomiesExcludedFromSitemap 选项，这个选项排除了 “hugo中分类法” 中的所有子类；其次使用 if not 来排除所有对应首页面。如下列所示
本文已 PaperModX 为例，修改文件 layouts\sitemap.xml
xml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 {{ printf &amp;#34;&amp;lt;?</description>
    </item>
  </channel>
</rss>
