Skip to content

Commit

Permalink
hotfix: bad default_time value type introduced in #300 (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Jun 23, 2024
2 parents 9b88745 + 15bb7b5 commit 980c498
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mkdocs_rss_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,19 @@ def on_config(self, config: MkDocsConfig) -> MkDocsConfig:
self.config.date_from_meta.default_time = datetime.strptime(
self.config.date_from_meta.default_time, "%H:%M"
)
print(
self.config.date_from_meta.default_time,
type(self.config.date_from_meta.default_time),
)
except (TypeError, ValueError) as err:
logger.warning(
"Config error: `date_from_meta.default_time` value "
f"'{self.config.date_from_meta.default_time}' format doesn't match the "
f"expected format %H:%M. Fallback to the default value. Trace: {err}"
)
self.config.date_from_meta.default_time = "00:00"
self.config.date_from_meta.default_time = datetime.strptime(
"00:00", "%H:%M"
)

if self.config.use_git:
logger.debug(
Expand Down

0 comments on commit 980c498

Please sign in to comment.