{"record":{"id":"e5f1c71d3ddb3272","repo":"squidfunk/mkdocs-material","slug":"couldn-t-find-author-id","errorCode":null,"errorMessage":"Couldn't find author '{id}'","messagePattern":"Couldn't find author '(.+?)'","errorType":"exception","errorClass":"PluginError","httpStatus":null,"severity":"error","filePath":"src/plugins/blog/plugin.py","lineNumber":276,"sourceCode":"                if view in self._resolve_views(self.blog):\n\n                    # If the current view is paginated, use the rendered title\n                    # of the original view in case the author set the title in\n                    # the page's contents, or it would be overridden with the\n                    # one set in mkdocs.yml, leading to inconsistent headings\n                    assert isinstance(view, View)\n                    if view != page:\n                        name = view._title_from_render or view.title\n                        return f\"# {name}\"\n\n            # Nothing more to be done for views\n            return\n\n        # Extract and assign authors to post, if enabled\n        if self.config.authors:\n            for id in page.config.authors:\n                if id not in self.authors:\n                    raise PluginError(f\"Couldn't find author '{id}'\")\n\n                # Append to list of authors\n                page.authors.append(self.authors[id])\n\n        # Extract settings for excerpts\n        separator      = self.config.post_excerpt_separator\n        max_authors    = self.config.post_excerpt_max_authors\n        max_categories = self.config.post_excerpt_max_categories\n\n        # Ensure presence of separator and throw, if its absent and required -\n        # we append the separator to the end of the contents of the post, if it\n        # is not already present, so we can remove footnotes or other content\n        # from the excerpt without affecting the content of the excerpt\n        if separator not in page.markdown:\n            if self.config.post_excerpt == \"required\":\n                docs = os.path.relpath(config.docs_dir)\n                path = os.path.relpath(page.file.abs_src_path, docs)\n                raise PluginError(","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/squidfunk/mkdocs-material/blob/e2136532f40aed98af1f6497c0cc6a3cff9f759b/src/plugins/blog/plugin.py#L258-L294","documentation":"The blog plugin's on_page_markdown assigns authors referenced by a post's metadata to the post. Each author id in page.config.authors must exist in the plugin's authors registry (built from the authors file); otherwise it raises PluginError(f\"Couldn't find author '{id}'\"). The plugin throws because silent omission would produce posts with missing attribution.","triggerScenarios":"A post's front matter lists authors: [jane] but no entry with key jane exists in the configured authors file (e.g. docs/blog/authors.yml); author keys were renamed or removed; authors feature enabled with stale metadata.","commonSituations":"Renaming an author's key in authors.yml without updating posts; typo'd author handles in front matter; copying posts between blogs with different authors files; enabling `authors: true` on a repo where the authors file lacks entries.","solutions":["Add the missing author definition (with all required fields) to the authors file configured for the blog plugin.","Fix the author id in the post's front matter to match an existing key in the authors file.","Search posts for authors: entries and cross-check every id against the authors file keys."],"exampleFix":"# before (authors.yml has no 'jane')\n# post.md front matter\nauthors:\n  - jane\n\n# after (docs/blog/authors.yml)\nauthors:\n  jane:\n    name: Jane Doe\n    description: Maintainer","handlingStrategy":"validation","validationCode":"import yaml, pathlib\nauthors = yaml.safe_load(pathlib.Path(\"docs/blog/authors.yml\").read_text()) or {}\nused = set()\nfor post in pathlib.Path(\"docs/blog/posts\").rglob(\"*.md\"):\n    fm = post.read_text().split(\"---\")[1]\n    used |= set(yaml.safe_load(fm).get(\"authors\", []))\nmissing = used - set(authors)\nassert not missing, f\"Author ids missing from authors.yml: {missing}\"","typeGuard":"def all_authors_defined(ids: list[str], authors: dict) -> bool:\n    return all(i in authors for i in ids)","tryCatchPattern":"try:\n    mkdocs.commands.build.build(config)\nexcept PluginError as e:\n    if str(e).startswith(\"Couldn't find author\"):\n        print(\"Add the author to docs/blog/authors.yml or fix front matter:\", e)\n    else:\n        raise","preventionTips":["Treat authors.yml as the single source of truth; add new authors there before referencing them.","Cross-check post front matter ids against authors.yml in a pre-commit hook.","Rename keys atomically: authors.yml and all posts in one commit.","Enable the authors feature only with a populated authors file."],"tags":["python","mkdocs","blog-plugin","configuration"],"backgroundTag":"missing-referenced-entity","analyzedSha":"e2136532f40aed98af1f6497c0cc6a3cff9f759b","analyzedAt":"2026-08-29T11:20:04.299Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}