Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs_dir not respected(?) #100

Open
jeroendev-one opened this issue Feb 13, 2025 · 1 comment
Open

docs_dir not respected(?) #100

jeroendev-one opened this issue Feb 13, 2025 · 1 comment

Comments

@jeroendev-one
Copy link

Hello,

I have my structure as following:

/usr/src (contains mkdocs.yml
/usr/src/documentation (contains git repo with markdown files)

The serve fails with the following error:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/mkdocs/livereload/__init__.py", line 211, in _build_loop
    self.builder()
    ~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/mkdocs/commands/serve.py", line 67, in builder
    build(config, serve_url=None if is_clean else serve_url, dirty=is_dirty)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/mkdocs/commands/build.py", line 265, in build
    config = config.plugins.on_config(config)
  File "/usr/local/lib/python3.13/site-packages/mkdocs/plugins.py", line 587, in on_config
    return self.run_event('config', config)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/mkdocs/plugins.py", line 566, in run_event
    result = method(item, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/mkdocs_git_authors_plugin/plugin.py", line 60, in on_config
    self._repo = Repo()
                 ~~~~^^
  File "/usr/local/lib/python3.13/site-packages/mkdocs_git_authors_plugin/git/repo.py", line 13, in __init__
    self._root = self.find_repo_root()
                 ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/mkdocs_git_authors_plugin/git/repo.py", line 95, in find_repo_root
    cmd.run()
    ~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/mkdocs_git_authors_plugin/git/command.py", line 79, in run
    raise GitCommandError("\n".join(msg))
mkdocs_git_authors_plugin.git.command.GitCommandError: GitCommand error:
Command "git rev-parse --show-toplevel" failed
Return code: 128
Output:

Error messages:
fatal: not a git repository (or any of the parent directories): .git

ERROR   -  [13:13:11] An error happened during the rebuild. The server will appear stuck until build errors are resolved.

It looks like it tries to execute the git rev-parse --show-toplevel in the /usr/src dir, and not in /usr/src/documentation, any idea how I can fix this?

Thank you in advance!

@timvink
Copy link
Owner

timvink commented Feb 22, 2025

Couple of ideas:

  • first the most obvious.. are you using git inside your project folder (/usr/src)? As in, ran git init and make a first commit?
  • using docs/ instead of documentation/ to store your markdown files?
  • Can you try running git rev-parse --show-toplevel manually instead the documentation/ folder?
  • are you running mkdocs build command instead in the /usr/src directory?
  • Does it work if you disable the plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants