You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm deploying my site to GH pages organisation using mkdocs gh-deploy. As documented, you build the organisation site in a separate directory. However, when I set include_dir in the macros config, the build fails, complaining that the include directory could not be found. This seems to be because the macros plugin is looking for the include directory in the build directory rather than the site directory.
A workaround is to create a copy of the mkdocs.yml file specifically for deployment that uses a relative path to the include directory eg: ../site/includes.
The text was updated successfully, but these errors were encountered:
Thanks! I am new with mkdocs gh-deploy so I had to look up what it does, in relations to GitHub Pages (which is a Docs deployment platform not unlike Read The Docs).
This seems to be because the macros plugin is looking for the include directory in the build directory rather than the site directory.
# -------------------# Create the jinja2 environment:# -------------------DOCS_DIR=config.get('docs_dir')
debug("Docs directory:", DOCS_DIR)
# define the include directory:# NOTE: using DOCS_DIR as default is not ideal,# because those files get rendered as well, which is incorrect# since they are partials; but we do not want to break existing installsinclude_dir=self.config['include_dir'] orDOCS_DIRifnotos.path.isdir(include_dir):
raiseFileNotFoundError("MACROS ERROR: Include directory '%s' ""does not exist!"%include_dir)
ifself.config['include_dir']:
trace("Includes directory:", include_dir)
else:
debug("Includes directory:", include_dir)
What you mean by "build directory" is, I suppose the MkDocs project directory, where the original MkDocs config file is?
I suppose you defined the include_dir originally with a relative path? Perhaps mkdocs gh-deploy is getting confused because now the current directory is different. Have you tried to use an absolute path for include_dir?
I'm deploying my site to GH pages organisation using
mkdocs gh-deploy
. As documented, you build the organisation site in a separate directory. However, when I setinclude_dir
in themacros
config, the build fails, complaining that the include directory could not be found. This seems to be because the macros plugin is looking for the include directory in the build directory rather than the site directory.A workaround is to create a copy of the
mkdocs.yml
file specifically for deployment that uses a relative path to the include directory eg:../site/includes
.The text was updated successfully, but these errors were encountered: