Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 3, 2023
1 parent 2ea4bc8 commit 0686966
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mkdocs_rss_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
# ########## Libraries #############
# ##################################

import logging

# standard library
import os
import logging
from copy import deepcopy
from datetime import datetime
from email.utils import formatdate
Expand Down Expand Up @@ -60,7 +61,7 @@ class GitRssPlugin(BasePlugin):
("pretty_print", config_options.Type(bool, default=False)),
("url_parameters", config_options.Type(dict, default=None)),
("category_feeds", config_options.Type(bool, default=False)),
("category_feeds_dir", config_options.Type(str, default="rss"))
("category_feeds_dir", config_options.Type(str, default="rss")),
)

def __init__(self):
Expand Down Expand Up @@ -370,7 +371,7 @@ def on_post_build(self, config: config_options.Config) -> dict:
for category in page.categories:
feeds.setdefault(category, []).append(page)

# Ensure target directory exists
# Ensure target directory exists
path = Path(config.get("site_dir")) / self.category_feeds_dir
os.makedirs(path, exist_ok=True)

Expand All @@ -379,11 +380,10 @@ def on_post_build(self, config: config_options.Config) -> dict:
filename = f"{category}.xml"
feed = deepcopy(self.category_feed)
feed.get("entries").extend(
self.util.filter_pages(
pages=pages,
length = self.config.get("length", 20),
attribute = "created"
)
)
self.util.filter_pages(
pages=pages,
length=self.config.get("length", 20),
attribute="created",
)
)
self.render_feed(pretty_print, path / filename, feed)

0 comments on commit 0686966

Please sign in to comment.