Skip to content

Commit

Permalink
fix: options type
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Dec 4, 2023
1 parent f31dbd6 commit 267d4a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions mkdocs_rss_plugin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class RssPluginConfig(Config):

abstract_chars_count = config_options.Type(int, default=160)
abstract_delimiter = config_options.Type(str, default="<!-- more -->")
categories = config_options.Type(list, default=None)
comments_path = config_options.Type(str, default=None)
date_from_meta = config_options.Type(dict, default=None)
categories = config_options.ListOfItems(config_options.Type(str), default=[])
comments_path = config_options.Optional(config_options.Type(str))
date_from_meta = config_options.Optional(config_options.Type(dict))
enabled = config_options.Type(bool, default=True)
feed_ttl = config_options.Type(int, default=1440)
image = config_options.Type(str, default=None)
image = config_options.Optional(config_options.Type(str))
length = config_options.Type(int, default=20)
match_path = config_options.Type(str, default=".*")
pretty_print = config_options.Type(bool, default=False)
url_parameters = config_options.Type(dict, default=None)
url_parameters = config_options.Optional(config_options.Type(dict))
use_git = config_options.Type(bool, default=True)
14 changes: 7 additions & 7 deletions mkdocs_rss_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ def on_config(self, config: config_options.Config) -> dict:

# start a feed dictionary using global config vars
base_feed = {
"author": config.get("site_author", None),
"author": config.site_author or None,
"buildDate": formatdate(get_build_timestamp()),
"copyright": config.get("copyright", None),
"description": config.get("site_description", None),
"copyright": config.copyright,
"description": config.site_description,
"entries": [],
"generator": f"{__title__} - v{__version__}",
"html_url": self.util.get_site_url(config),
"language": self.util.guess_locale(config),
"pubDate": formatdate(get_build_timestamp()),
"repo_url": config.get("repo_url", config.get("site_url", None)),
"repo_url": config.repo_url,
"title": config.get("site_name", None),
"ttl": self.config.get("feed_ttl", None),
"ttl": self.config.feed_ttl,
}

# feed image
if self.config.get("image"):
base_feed["logo_url"] = self.config.get("image")
if self.config.image:
base_feed["logo_url"] = self.config.image

# pattern to match pages included in output
self.match_path_pattern = compile(self.config.get("match_path"))
Expand Down

0 comments on commit 267d4a4

Please sign in to comment.