From dd1f1e7454851239023f4977f866a818b27d6985 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Wed, 23 Oct 2024 12:42:19 -0300 Subject: [PATCH] Add rss listing and the feed link in help page --- docs/sections/help/index.md | 9 +++++++++ src/pulp_docs/mkdocs_macros.py | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/docs/sections/help/index.md b/docs/sections/help/index.md index 0bea408..6754d02 100644 --- a/docs/sections/help/index.md +++ b/docs/sections/help/index.md @@ -11,6 +11,7 @@ Understaning the docs will help you find what you need more quickly. For some human help, you should visit the [Get Involved](site:help/community/get-involved/) section. There you'll learn about how to can reach out to the Pulp Community. + Don't hesitate to contact us! --- @@ -57,3 +58,11 @@ Repo | Version | Links |   {% for repo in get_repos("other") -%} {{ repo.title }} | `{{ repo.version }}` | {{ repo.codebase_link }} | {{ repo.changes_link }} {% endfor %} + +## Changes RSS Feed + +Check our recent releases with this [RSS changelog feed](https://himdel.eu/feed/pulp-changes.json). + +{% for item in rss_items() %} +- [{{ item.title }}]({{ item.url }}) +{% endfor %} diff --git a/src/pulp_docs/mkdocs_macros.py b/src/pulp_docs/mkdocs_macros.py index bbff9f0..1fcb3db 100644 --- a/src/pulp_docs/mkdocs_macros.py +++ b/src/pulp_docs/mkdocs_macros.py @@ -449,6 +449,23 @@ def get_repos(repo_type="content"): ] return repos_data + @env.macro + def rss_items(): + # that's Himdel's rss feed: https://github.com/himdel + response = httpx.get("https://himdel.eu/feed/pulp-changes.json") + if response.is_error: + return { + "items": [ + { + "url": "#", + "title": "Couldnt fetch the feed. Please, open an issue in https://github.com/pulp/pulp-docs/.", + } + ] + } + + rss_feed = json.loads(response.content) + return rss_feed["items"][:20] + def on_pre_page_macros(env): """The mkdocs-macros hook just before an inidvidual page render."""