Skip to content

Commit df59a79

Browse files
committed
docs: working on new version
1 parent 9892f9a commit df59a79

File tree

6 files changed

+118
-48
lines changed

6 files changed

+118
-48
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515
A plugin for [MkDocs](https://www.mkdocs.org), the static site generator, which creates [RSS 2.0](https://wikipedia.org/wiki/RSS) feeds using the creation and modification dates from [git log](https://git-scm.com/docs/git-log) and page metadata ([YAML frontmatter](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data)).
1616

17+
## Installation
18+
19+
```sh
20+
pip install mkdocs-rss-plugin
21+
```
22+
1723
## Usage
1824

1925
Minimal [`mkdocs.yml` configuration](https://www.mkdocs.org/user-guide/configuration/#project-information):

docs/changelog.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
---
2-
title: Changelog for the MkDocs RSS Plugin
3-
description: "Changelog of the RSS plugin for MkDocs."
4-
categories: ["Release notes", "test"]
2+
title: Changelog
3+
description: "Release notes of the RSS plugin for MkDocs."
4+
categories:
5+
- Release notes
6+
search:
7+
exclude: true
8+
tags:
9+
- development
510
---
611

712
--8<-- "CHANGELOG.md"

docs/configuration.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ authors:
44
- "Julien Moura"
55
date: 2020-12-31 14:20
66
description: Configuration steps and settings for MkDocs RSS plugin
7-
image: "https://svgsilh.com/png-512/97849.png"
7+
image: https://svgsilh.com/png-512/97849.png
88
tags:
99
- settings
1010
- options
1111
- plugin
1212
---
1313

14-
# Configuration
15-
1614
To produce a valid RSS feed, the plugin uses:
1715

1816
- some global settings from [MkDocs configuration](#mkdocs-configuration)
@@ -132,7 +130,7 @@ Output:
132130

133131
## Plugin options
134132

135-
For a sample see [homepage](../#usage).
133+
For a sample see [homepage](./index.md#quickstart).
136134

137135
### Disabling the plugin
138136

@@ -426,23 +424,5 @@ Will result in:
426424

427425
Default: `None`.
428426

429-
----
430-
431-
## Integration
432-
433-
### Reference RSS feeds in HTML meta-tags
434-
435-
To facilitate the discovery of RSS feeds, it's recommended to add relevant meta-tags into the pages `<head>`, through template customization in `main.html` :
436-
437-
```html
438-
{% extends "base.html" %}
439-
440-
{% block extrahead %}
441-
<!-- RSS Feed -->
442-
<link rel="alternate" type="application/rss+xml" title="RSS feed of created content" href="{{ config.site_url }}feed_rss_created.xml">
443-
<link rel="alternate" type="application/rss+xml" title="RSS feed of updated content" href="{{ config.site_url }}feed_rss_updated.xml">
444-
{% endblock %}
445-
```
446-
447427
<!-- Hyperlinks reference -->
448428
[page metadata]: https://python-markdown.github.io/extensions/meta_data/

docs/index.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,50 @@
11
---
22
title: The MkDocs RSS Plugin
3-
authors: ["[email protected] (Julien Moura)", "[email protected] (Tim Vink)"]
3+
authors:
4+
- Julien Moura <[email protected]>
5+
- Tim Vink <[email protected]>
46
date: 2020-07-06
5-
description: "MkDocs RSS plugin: generate RSS feeds for your static website using git log."
7+
description: "MkDocs RSS plugin: generate RSS feeds for your static website using git log ad YAML frontmatter (markdown pages'metadata header)."
68
image: "rss_icon.svg"
9+
tags:
10+
- Mkdocs
11+
- plugin
12+
- RSS
713
---
814

9-
--8<-- "README.md"
15+
[![PyPi version badge](https://badgen.net/pypi/v/mkdocs-rss-plugin)](https://pypi.org/project/mkdocs-rss-plugin/)
16+
[![PyPI - Downloads](https://img.shields.io/pypi/dm/mkdocs-rss-plugin)](https://pypi.org/project/mkdocs-rss-plugin/)
17+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mkdocs-rss-plugin)](https://pypi.org/project/mkdocs-rss-plugin/)
18+
19+
[![codecov](https://codecov.io/gh/Guts/mkdocs-rss-plugin/branch/main/graph/badge.svg?token=A0XPLKiwiW)](https://codecov.io/gh/Guts/mkdocs-rss-plugin)
20+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
21+
[![flake8](https://img.shields.io/badge/linter-flake8-green)](https://flake8.pycqa.org/)
22+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
23+
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
24+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Guts/mkdocs-rss-plugin/master.svg)](https://results.pre-commit.ci/latest/github/Guts/mkdocs-rss-plugin/master)
25+
[![📚 Documentation](https://github.com/Guts/mkdocs-rss-plugin/actions/workflows/documentation.yml/badge.svg)](https://github.com/Guts/mkdocs-rss-plugin/actions/workflows/documentation.yml)
26+
27+
A plugin for [MkDocs](https://www.mkdocs.org), the static site generator, which creates [RSS 2.0](https://wikipedia.org/wiki/RSS) feeds using the creation and modification dates from [git log](https://git-scm.com/docs/git-log) and page metadata ([YAML frontmatter](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data)).
1028

1129
## Quickstart
1230

1331
Installation:
1432

15-
```bash
16-
pip install mkdocs-rss-plugin
33+
<!-- termynal: {"prompt_literal_start": [">"], title: Terminal} -->
34+
35+
```sh
36+
> pip install mkdocs-rss-plugin
37+
---> 100%
38+
RSS plugin for Mkdocs installed! Add 'rss' to your 'plugins' section in mkdocs.yml
1739
```
1840
1941
Then in your `mkdocs.yml`:
2042
21-
```yml
43+
```yaml
44+
site_description: required. Used as feed mandatory channel description.
45+
site_name: required. Used as feed mandatory channel title and items source URL label.
46+
site_url: required. Used to build feed items URLs.
47+
2248
plugins:
2349
- rss
2450
```
@@ -33,16 +59,15 @@ As examples, here come the feeds generated for this documentation:
3359
Or it could be displayed as a Feedly follow button:
3460
3561
[![Feedly button](https://s3.feedly.com/img/follows/feedly-follow-rectangle-flat-big_2x.png "Follow us on Feedly"){: width=130 height= 50 loading=lazy }](https://feedly.com/i/subscription/feed%2Fhttps%3A%2F%2Fguts.github.io%2Fmkdocs-rss-plugin%2Ffeed_rss_created.xml)
62+
{: align=middle }
3663
3764
## Credits
3865
3966
![RSS logo](rss_icon.svg "RSS icon - Wikimedia"){: align=right }
4067
41-
Plugin logic is inspired from [Tim Vink git-based plugins](https://github.com/timvink?tab=repositories&q=mkdocs-git&type=&language=) and main parts of Git stuff are nearly copied/pasted.
42-
43-
Using magic from:
44-
45-
- [GitPython](https://gitpython.readthedocs.io/)
46-
- [Jinja2](https://jinja.palletsprojects.com/en/2.11.x/)
47-
48-
Documentation theme [United from mkdocs-bootswatch](https://mkdocs.github.io/mkdocs-bootswatch/#united) as a tribute to the classic RSS color scheme: orange and white.
68+
- Plugin logic is inspired from [Tim Vink git-based plugins](https://github.com/timvink?tab=repositories&q=mkdocs-git&type=&language=) and main parts of Git stuff are nearly copied/pasted.
69+
- Using magic mainly from:
70+
- [GitPython](https://gitpython.readthedocs.io/)
71+
- [Jinja2](https://jinja.palletsprojects.com/)
72+
- Documentation colors are a tribute to the classic RSS color scheme: orange and white.
73+
- Logo generated with DALL·E.

docs/integrations.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Integrations
3+
icon: octicons/plug-16
4+
---
5+
6+
## Reference RSS feeds in HTML meta-tags
7+
8+
To facilitate the discovery of RSS feeds, it's recommended to add relevant meta-tags in `<head>` section in HTML pages.
9+
10+
### Automatically set with Material theme
11+
12+
If you're using the Material theme, everything is automagically set up (see [the related documentation page](https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#rss)) :partying_face:.
13+
14+
### Manually
15+
16+
You need to customize the theme's template. Typically, in `main.html`:
17+
18+
```html
19+
{% extends "base.html" %}
20+
21+
{% block extrahead %}
22+
<!-- RSS Feed -->
23+
<link rel="alternate" type="application/rss+xml" title="RSS feed of created content" href="{{ config.site_url }}feed_rss_created.xml">
24+
<link rel="alternate" type="application/rss+xml" title="RSS feed of updated content" href="{{ config.site_url }}feed_rss_updated.xml">
25+
{% endblock %}
26+
```

mkdocs.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ edit_uri: blob/main/docs/
1414
docs_dir: "docs/"
1515
use_directory_urls: true
1616

17+
extra:
18+
social:
19+
- icon: "fontawesome/brands/mastodon"
20+
link: https://mapstodon.space/@geojulien
21+
name: "Follow me on Mastodon"
22+
- icon: "fontawesome/solid/piggy-bank"
23+
link: /team/sponsoring/
24+
name: "Sponsor development"
25+
1726
# Extensions to enhance markdown
1827
markdown_extensions:
1928
- admonition
@@ -26,10 +35,11 @@ markdown_extensions:
2635
anchor_linenums: true
2736
line_spans: __span
2837
pygments_lang_class: true
29-
use_pygments: true
38+
- pymdownx.inlinehilite
3039
- pymdownx.snippets:
3140
base_path: "."
3241
check_paths: true
42+
- pymdownx.superfences
3343
- pymdownx.tabbed:
3444
alternate_style: true
3545
slugify: !!python/object/apply:pymdownx.slugs.slugify
@@ -39,9 +49,12 @@ markdown_extensions:
3949
permalink: "#"
4050

4151
nav:
42-
- "Home": "index.md"
43-
- "Settings": "configuration.md"
44-
- "Changelog": "changelog.md"
52+
- Home: index.md
53+
- Settings:
54+
- configuration.md
55+
- integrations.md
56+
- Contributing: contributing.md
57+
- Changelog: changelog.md
4558

4659
plugins:
4760
- git-committers:
@@ -68,17 +81,18 @@ plugins:
6881
cache_dir:
6982
!ENV [MKDOCS_PLUGIN_PRIVACY_EXTERNAL_CACHE_DIR, .cache/plugins/privacy]
7083
- rss:
84+
abstract_chars_count: 160
85+
abstract_delimiter: <!-- more -->
7186
date_from_meta:
7287
as_creation: "date"
7388
as_update: false
7489
datetime_format: "%Y-%m-%d %H:%M"
7590
default_timezone: "Europe/Paris"
7691
default_time: "22:00"
77-
abstract_chars_count: 160
78-
abstract_delimiter: <!-- more -->
92+
enabled: !ENV [MKDOCS_ENABLE_PLUGIN_RSS, true]
7993
image: https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Feed-icon.svg/128px-Feed-icon.svg.png
8094
match_path: ".*"
81-
pretty_print: false
95+
pretty_print: true
8296
url_parameters:
8397
utm_source: "documentation"
8498
utm_medium: "RSS"
@@ -88,15 +102,18 @@ plugins:
88102
- social:
89103
enabled: !ENV [MKDOCS_ENABLE_PLUGIN_SOCIAL, true]
90104
cache_dir: !ENV [MKDOCS_PLUGIN_SOCIAL_CACHE_DIR, .cache/plugins/social]
91-
- termynal
105+
- termynal:
106+
title: "Youpi"
107+
prompt_literal_start:
108+
- "$"
109+
- ">"
92110

93111
theme:
94112
name: material
95113
favicon: assets/logo_rss_plugin_mkdocs.svg
96114
features:
97115
- content.action.edit
98116
- content.action.view
99-
- content.code.annotate
100117
- content.code.copy
101118
- content.tabs.link
102119
- content.tooltips
@@ -109,6 +126,7 @@ theme:
109126
- search.share
110127
- search.suggest
111128
- toc.follow
129+
- toc.integrate
112130
font:
113131
code: Ubuntu Mono
114132
text: Ubuntu
@@ -125,6 +143,16 @@ theme:
125143
primary: deep orange
126144
scheme: default
127145

146+
validation:
147+
links:
148+
absolute_links: warn
149+
not_found: warn
150+
unrecognized_links: warn
151+
nav:
152+
absolute_links: warn
153+
not_found: warn
154+
omitted_files: warn
155+
128156
watch:
129157
- CONTRIBUTING.md
130158
- README.md

0 commit comments

Comments
 (0)