I'm using the Mkdocs option edit_uri_template, which is mutually exclusive with edit_uri.
set_edit_path() has no effect in my setup (the page.edit_url remains empty). It's caused by this section:
|
def on_page_content(self, html, page: Page, config: Config, files: Files): |
|
repo_url = config.get("repo_url", None) |
|
edit_uri = config.get("edit_uri", None) |
|
|
|
src_path = pathlib.PurePath(page.file.src_path).as_posix() |
|
if src_path in self._edit_paths: |
|
path = self._edit_paths.pop(src_path) |
|
if repo_url and edit_uri: |
|
# Ensure urljoin behavior is correct |
With mkdocs 1.6, it is possible to set file.edit_uri:
Enabling true generated files and expanding the File API
I'm not sure what version of mkdocs you are targeting. For now I'm working around it with this hook:
def on_files(files: Files, config: MkDocsConfig, **kwargs) -> Files:
edit_paths = config.plugins['gen-files']._edit_paths
for src_uri in list(edit_paths.keys()):
edit_uri = edit_paths.pop(src_uri)
files.get_file_from_path(src_uri).edit_uri = edit_uri
return files
I'm using the Mkdocs option
edit_uri_template, which is mutually exclusive withedit_uri.set_edit_path()has no effect in my setup (thepage.edit_urlremains empty). It's caused by this section:mkdocs-gen-files/mkdocs_gen_files/plugin.py
Lines 47 to 55 in b02016c
With mkdocs 1.6, it is possible to set
file.edit_uri:Enabling true generated files and expanding the
FileAPII'm not sure what version of mkdocs you are targeting. For now I'm working around it with this hook: