Skip to content

Commit

Permalink
Add rss listing and the feed link in help page
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-psb committed Oct 23, 2024
1 parent 0704fbd commit dd1f1e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/sections/help/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

---
Expand Down Expand Up @@ -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 %}
17 changes: 17 additions & 0 deletions src/pulp_docs/mkdocs_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit dd1f1e7

Please sign in to comment.