Mkdocs_auth

screenshot of Mkdocs_auth

adding basic authentication to mkdocs site

Overview:

MkDocs is a powerful static site generator tailored for creating documentation with ease and efficiency. While it is ideal for sharing information, there are times when you want to restrict access to certain content without making it outright secret. This is where the workaround for basic authentication comes into play, allowing you to add a layer of security to your MkDocs-generated pages.

By using a simple setup process, you can implement basic authentication on the pages generated by MkDocs. This involves some straightforward steps, such as modifying your configuration and templates, enabling you to control access to your documentation effectively.

Features:

  • Easy Authentication Setup: By simply adding credentials to the mkdocs.yml configuration file, you can set up basic authentication without any hassle.
  • Theme Customization: Modify existing themes and incorporate your own PHP code by utilizing the custom_dir variable in the configuration, allowing for tailored security implementations.
  • Flexible Theme Support: While this method works with the Read the Docs theme, it can be applied to any theme as long as the proper base.html template is modified accordingly.
  • Local Testing: Quickly test your authenticated documentation with a local server, making it easy to verify that everything is set up correctly.
  • Documentation Convenience: This solution keeps your documentation accessible to a select group without exposing it to the general public, striking a balance between accessibility and privacy.
  • Comprehensive Guide: The provided Makefile offers clear reference points for commands and scripts, ensuring that the setup process is smooth and understandable even for newcomers.