From 369812f77f046b44fc804b5e806158481773efd6 Mon Sep 17 00:00:00 2001 From: Weaxs <459312872@qq.com> Date: Fri, 15 Nov 2024 17:54:44 +0800 Subject: [PATCH] support rssnext/follow to claim feed --- config/_default/params.toml | 4 ++++ exampleSite/config/_default/params.toml | 4 ++++ exampleSite/content/docs/configuration/index.it.md | 7 +++++++ exampleSite/content/docs/configuration/index.ja.md | 7 +++++++ exampleSite/content/docs/configuration/index.md | 8 ++++++++ exampleSite/content/docs/configuration/index.zh-cn.md | 8 ++++++++ layouts/_default/rss.xml | 6 ++++++ 7 files changed, 44 insertions(+) diff --git a/config/_default/params.toml b/config/_default/params.toml index f70384ab4..0803aea5c 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -161,3 +161,7 @@ forgejoDefaultServer = "https://v8.next.forgejo.org" # pinterest = "" # yandex = "" # fediverse = "" + +[rssnext] + # feedId = "" + # userId = "" \ No newline at end of file diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index c83c1dbe1..8069e6b7b 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -156,3 +156,7 @@ smartTOCHideUnfocusedChildren = false # bing = "" # pinterest = "" # yandex = "" + +[rssnext] + # feedId = "" + # userId = "" \ No newline at end of file diff --git a/exampleSite/content/docs/configuration/index.it.md b/exampleSite/content/docs/configuration/index.it.md index ee847c3e0..3e1d12dcb 100644 --- a/exampleSite/content/docs/configuration/index.it.md +++ b/exampleSite/content/docs/configuration/index.it.md @@ -360,6 +360,13 @@ Many of the article defaults here can be overridden on a per article basis by sp | `verification.yandex` | _Not set_ | The site verification string provided by Yandex to be included in the site metadata. | +## RSSNext + +| Name | Default | Description | +| ------------------------ | --------- |--------------------------------------------------------------------------------------------------------------------------------------| +| `rssnext.feedId` | _Not set_ | The rss `feedId` string provided by [RSSNext/Follow](https://follow.is/) to be included in the `rss.xml`, which can helps to claim rss feed as your own. | +| `rssnext.userId` | _Not set_ | The rss `userId` string provided by [RSSNext/Follow](https://follow.is/) to be included in the `rss.xml`, which can helps to claim rss feed as your own. | + ## Other configuration files The theme also includes a `markup.toml` configuration file. This file contains some important parameters that ensure that Hugo is correctly configured to generate sites built with Blowfish. diff --git a/exampleSite/content/docs/configuration/index.ja.md b/exampleSite/content/docs/configuration/index.ja.md index 6d6773112..29578a57c 100644 --- a/exampleSite/content/docs/configuration/index.ja.md +++ b/exampleSite/content/docs/configuration/index.ja.md @@ -358,6 +358,13 @@ Many of the article defaults here can be overridden on a per article basis by sp | `verification.yandex` | _Not set_ | The site verification string provided by Yandex to be included in the site metadata. | +## RSSNext + +| Name | Default | Description | +| ------------------------ | --------- |--------------------------------------------------------------------------------------------------------------------------------------| +| `rssnext.feedId` | _Not set_ | The rss `feedId` string provided by [RSSNext/Follow](https://follow.is/) to be included in the `rss.xml`, which can helps to claim rss feed as your own. | +| `rssnext.userId` | _Not set_ | The rss `userId` string provided by [RSSNext/Follow](https://follow.is/) to be included in the `rss.xml`, which can helps to claim rss feed as your own. | + ## Other configuration files The theme also includes a `markup.toml` configuration file. This file contains some important parameters that ensure that Hugo is correctly configured to generate sites built with Blowfish. diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 59204d609..d67e76c43 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -367,6 +367,14 @@ Many of the article defaults here can be overridden on a per article basis by sp | `verification.fediverse` | _Not set_ | The fediverse handle to include in the site metadata. Include the server domain in the username, e.g. `@you@instanceaddress.tld`. | +## RSSNext + +| Name | Default | Description | +| ------------------------ | --------- |--------------------------------------------------------------------------------------------------------------------------------------| +| `rssnext.feedId` | _Not set_ | The rss `feedId` string provided by [RSSNext/Follow](https://follow.is/) to be included in the `rss.xml`, which can helps to claim rss feed as your own. | +| `rssnext.userId` | _Not set_ | The rss `userId` string provided by [RSSNext/Follow](https://follow.is/) to be included in the `rss.xml`, which can helps to claim rss feed as your own. | + + ## Other configuration files The theme also includes a `markup.toml` configuration file. This file contains some important parameters that ensure that Hugo is correctly configured to generate sites built with Blowfish. diff --git a/exampleSite/content/docs/configuration/index.zh-cn.md b/exampleSite/content/docs/configuration/index.zh-cn.md index 4e8f854cc..6340a6c5e 100644 --- a/exampleSite/content/docs/configuration/index.zh-cn.md +++ b/exampleSite/content/docs/configuration/index.zh-cn.md @@ -356,6 +356,14 @@ Blowfish 提供了大量控制主题功能的配置参数,下面的表格中 | `verification.yandex` | 无 | Yandex 提供的网站验证字符串,用于在网站元数据中包含。 | +## RSSNext + +| Name | Default | Description | +| ------------------------ | --------- |---------------------------------------------------------------------------------------------| +| `rssnext.feedId` | _Not set_ | [RSSNext/Follow](https://follow.is) 提供的 `feeId`,这将被自动添加在 `rss.xml` 中以便完成订阅源所有权验证,证明该源属于你自己。 | +| `rssnext.userId` | _Not set_ | [RSSNext/Follow](https://follow.is) 提供的 `userId`,这将被自动添加在 `rss.xml` 中以便完成订阅源所有权验证,证明该源属于你自己 | + + ## 别的配置文件 Blowfish 主题还包括 `markup.toml` 配置文件。这个文件包含了一些重要参数,来确保 Hugo 正确配置以生成使用 Blowfish 创建的网站。 diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index eab240932..6f046a46b 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -27,6 +27,12 @@ {{- with .OutputFormats.Get "RSS" -}} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} + {{ if and (.Site.Params.rssnext.feedId) (.Site.Params.rssnext.userId) }} + + {{ .Site.Params.rssnext.feedId }} + {{ .Site.Params.rssnext.userId }} + + {{ end }} {{ range $pages }} {{ .Title }}