Deploying your documentation site

A basic guide

GitHub Pages

If you host the source code for a project on GitHub, it is straightforward to use GitHub Pages to host the documentation for your project.

There are a couple of options here but the simplest is the so-called Project Pages. In this case, the site files are commited to a branch within the project repository called gh-pages (although this is configurable). The other option (User/Organization Pages) involves committing the files to be deployed to the main branch of a separate repository.

It is possible to configure GitHub Pages to use custom domains.

!!! note “More to come” A better description of the GitHub Pages process will be added here at a later date.

Netlify, Vercel, GitLab, Codeberg …

!!! note “More providers here?” Ideally, there should be instructions here for a few other providers of free static web hosting suitable for documentation.

Other Providers

Any hosting provider which can serve static files can be used to serve documentation generated by WDocs. The details differ but the outline of the process is the same.

When you build your site (using the mkdocs build command), all of the files are written to the output directory (htdocs by default). You will then simply need to copy the contents of that directory to the webroot directory of your hosting provider’s server.

For example, a typical set of commands might look like the following:

wmk b .
rsync -av ./htdocs/ me@myserver.com:/path/to/webroot/

Tags:  deployment

PDF version of this page