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

Add rss-listing and link in help page #93

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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