xianmin/hugo-theme-jane

cannot remove rss logo

cruvie opened this issue · 1 comments

cruvie commented
iShot_2023-05-23_11 57 51

my config

  [params.social]                                         # 社交链接
    a-email = "http://localhost:1313"
    # b-stack-overflow = "http://localhost:1313"
    # c-twitter = "http://localhost:1313"
    # d-facebook = "http://localhost:1313"
    # e-linkedin = "http://localhost:1313"
    # f-google = "http://localhost:1313"
    g-github = "http://localhost:1313"
    # h-weibo = "http://localhost:1313"
    # i-zhihu = "http://localhost:1313"
    # j-douban = "http://localhost:1313"
    # k-pocket = "http://localhost:1313"
    # l-tumblr = "http://localhost:1313"
    # m-instagram = "http://localhost:1313"
    # n-gitlab = "http://localhost:1313"
    # o-goodreads = "http://localhost:1313"
    # p-coding = "http://localhost:1313"
    # q-bilibili = "http://localhost:1313"
    # r-codeforces = "http://localhost:1313"
    # s-mastodon = "http://localhost:1313"
    # t-youtube = "http://localhost:1313"
    # u-twitch = "http://localhost:1313"

去掉 RSS logo

{{/* RSS icon */}}
{{ with .Site.GetPage "home" -}}
{{- with .OutputFormats.Get "RSS" -}}
<a href="{{ .Permalink }}" rel="noopener {{ .Rel }}" type="{{ .MediaType.Type }}"
class="iconfont" title="rss" target="_blank">
{{ partial "svg/rss.svg" }}
</a>
{{ end -}}
{{- end -}}

由于 RSS icon 是硬编码在 html 里的,所以要注释掉 social_links.html 第十六行到第二十四行。这样就能去掉 RSS logo.

去除 RSS metadata

{{ with .OutputFormats.Get "RSS" }}<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />{{ end }}

除此以外,head.xml 也可注释掉第五十九行。

关闭 RSS 全文输出及调整 RSS 篇数

config.toml 中 rssLimit 及 rssFullContent 参数修改如下:
rssLimit = 1
rssFullContent = false

remove RSS logo

{{/* RSS icon */}}
{{ with .Site.GetPage "home" -}}
{{- with .OutputFormats.Get "RSS" -}}
<a href="{{ .Permalink }}" rel="noopener {{ .Rel }}" type="{{ .MediaType.Type }}"
class="iconfont" title="rss" target="_blank">
{{ partial "svg/rss.svg" }}
</a>
{{ end -}}
{{- end -}}

Since the RSS icon is hard-coded in the html file, remove the sixteenth to twenty-fourth lines of social_links.html. The RSS icon will be removed.

remove RSS metadata

{{ with .OutputFormats.Get "RSS" }}<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />{{ end }}

In addition, head.xml can also be modified. Remove the fifty-ninth line.

Disable RSS full-text output and limit the number of RSS items to 1

The rssLimit and rssFullContent parameters in config.toml could be modified as follows:
rssLimit = 1
rssFullContent = false