Skip to content

Commit

Permalink
Replace deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Aug 22, 2022
1 parent ad8a187 commit b8135cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mkdocs_redirects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ def on_files(self, files, config, **kwargs):

# SHIM! Produce a warning if the old root-level 'redirects' config is present
if config.get('redirects'):
log.warn(
log.warning(
"The root-level 'redirects:' setting is not valid and has been changed in version 1.0! "
"The plugin-level 'redirect-map' must be used instead. See https://git.io/fjdBN"
)

# Validate user-provided redirect "old files"
for page_old in self.redirects.keys():
if not utils.is_markdown_file(page_old):
log.warn("redirects plugin: '%s' is not a valid markdown file!", page_old)
log.warning("redirects plugin: '%s' is not a valid markdown file!", page_old)

# Build a dict of known document pages to validate against later
self.doc_pages = {}
Expand Down Expand Up @@ -141,7 +141,7 @@ def on_post_build(self, config, **kwargs):
# If the redirect target isn't external or a valid internal page, throw an error
# Note: we use 'warn' here specifically; mkdocs treats warnings specially when in strict mode
else:
log.warn("Redirect target '%s' does not exist!", page_new)
log.warning("Redirect target '%s' does not exist!", page_new)
continue

# DO IT!
Expand Down

0 comments on commit b8135cb

Please sign in to comment.