Skip to content

Commit 1a6b687

Browse files
committed
Add rss listing and the feed link in help page
1 parent 0704fbd commit 1a6b687

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/sections/help/index.md

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Understaning the docs will help you find what you need more quickly.
1111

1212
For some human help, you should visit the [Get Involved](site:help/community/get-involved/) section.
1313
There you'll learn about how to can reach out to the Pulp Community.
14+
1415
Don't hesitate to contact us!
1516

1617
---
@@ -57,3 +58,11 @@ Repo | Version | Links |  
5758
{% for repo in get_repos("other") -%}
5859
{{ repo.title }} | `{{ repo.version }}` | {{ repo.codebase_link }} | {{ repo.changes_link }}
5960
{% endfor %}
61+
62+
## Changes RSS Feed
63+
64+
Check our recent releases with this [RSS changelog feed](https://himdel.eu/feed/pulp-changes.json).
65+
66+
{% for item in rss_items() %}
67+
- [{{ item.title }}]({{ item.url }})
68+
{% endfor %}

src/pulp_docs/mkdocs_macros.py

+17
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,23 @@ def get_repos(repo_type="content"):
449449
]
450450
return repos_data
451451

452+
@env.macro
453+
def rss_items():
454+
# that's Himdel's rss feed: https://github.com/himdel
455+
response = httpx.get("https://himdel.eu/feed/pulp-changes.json")
456+
if response.is_error:
457+
return {
458+
"items": [
459+
{
460+
"url": "#",
461+
"title": "Couldnt fetch the feed. Please, open an issue in https://github.com/pulp/pulp-docs/.",
462+
}
463+
]
464+
}
465+
466+
rss_feed = json.loads(response.content)
467+
return rss_feed["items"][:20]
468+
452469

453470
def on_pre_page_macros(env):
454471
"""The mkdocs-macros hook just before an inidvidual page render."""

0 commit comments

Comments
 (0)