4
4
# ########## Libraries #############
5
5
# ##################################
6
6
7
+ import logging
8
+
7
9
# standard library
8
10
import os
9
- import logging
10
11
from copy import deepcopy
11
12
from datetime import datetime
12
13
from email .utils import formatdate
@@ -60,7 +61,7 @@ class GitRssPlugin(BasePlugin):
60
61
("pretty_print" , config_options .Type (bool , default = False )),
61
62
("url_parameters" , config_options .Type (dict , default = None )),
62
63
("category_feeds" , config_options .Type (bool , default = False )),
63
- ("category_feeds_dir" , config_options .Type (str , default = "rss" ))
64
+ ("category_feeds_dir" , config_options .Type (str , default = "rss" )),
64
65
)
65
66
66
67
def __init__ (self ):
@@ -370,7 +371,7 @@ def on_post_build(self, config: config_options.Config) -> dict:
370
371
for category in page .categories :
371
372
feeds .setdefault (category , []).append (page )
372
373
373
- # Ensure target directory exists
374
+ # Ensure target directory exists
374
375
path = Path (config .get ("site_dir" )) / self .category_feeds_dir
375
376
os .makedirs (path , exist_ok = True )
376
377
@@ -379,11 +380,10 @@ def on_post_build(self, config: config_options.Config) -> dict:
379
380
filename = f"{ category } .xml"
380
381
feed = deepcopy (self .category_feed )
381
382
feed .get ("entries" ).extend (
382
- self .util .filter_pages (
383
- pages = pages ,
384
- length = self .config .get ("length" , 20 ),
385
- attribute = "created"
386
- )
387
- )
383
+ self .util .filter_pages (
384
+ pages = pages ,
385
+ length = self .config .get ("length" , 20 ),
386
+ attribute = "created" ,
387
+ )
388
+ )
388
389
self .render_feed (pretty_print , path / filename , feed )
389
-
0 commit comments