When the GitHub Pages has a Custom domain configured, and you run
mkdocs gh-deploy,
the "Custom domain" is removed
As a reminder, the documentation states regarding gh-deploy:
You should never edit files in your gh-pages branch by hand if you're using the
gh-deploycommand because you will lose your work.
That behavior is determined by the underlying third-party tool we use (and how it interacts with Git), so there's not any reasonable way to change that behavior.
However, if you include the CNAME file (required by GitHub for custom domains) in your docs_dir, then MkDocs will copy it to the site_dir. In fact, this is what MkDocs does for its own documentation.
Thanks @waylan!
Most helpful comment
As a reminder, the documentation states regarding gh-deploy:
That behavior is determined by the underlying third-party tool we use (and how it interacts with Git), so there's not any reasonable way to change that behavior.
However, if you include the
CNAMEfile (required by GitHub for custom domains) in yourdocs_dir, then MkDocs will copy it to thesite_dir. In fact, this is what MkDocs does for its own documentation.