Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

社交链接里没写RSS,为啥网站会有RSS啊,没找到在哪里删RSS #326

Open
ppue opened this issue Sep 21, 2021 · 2 comments
Open

Comments

@ppue
Copy link

ppue commented Sep 21, 2021

Snipaste_2021-09-21_23-38-22.jpg

111111.jpg

@CyrusYip
Copy link
Contributor

RSS 是自动生成的,用于订阅网站。

@lilPiper
Copy link

lilPiper commented Jun 3, 2023

去掉 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants