diff --git a/pelican/contents.py b/pelican/contents.py index 0769f8757..bf7b3c3fb 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -358,8 +358,9 @@ def _find_path(path: str) -> Optional[Content]: origin = joiner(siteurl, Author(path, self.settings).url) else: logger.warning( - "Replacement Indicator '%s' not recognized, skipping replacement", + "Replacement Indicator %r not recognized in %r, skipping replacement", what, + origin, ) # keep all other parts, such as query, fragment, etc. diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 06d1a6901..4defafa46 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1036,7 +1036,7 @@ def test_unknown_link_syntax(self): self.assertEqual(content, html) self.assertLogCountEqual( count=1, - msg="Replacement Indicator 'unknown' not recognized, " + msg="Replacement Indicator 'unknown' not recognized in '{unknown}foo', " "skipping replacement", level=logging.WARNING, )