Documentation for hugo-python-distributions
This webpage is meant to serve the documentation for the hugo-python-distributions project, which aims to provide a distribution
channel for the extended + withdeploy edition of the Hugo static site generator through pip-installable binaries (wheels) hosted on the Python Package Index (PyPI).
Fun fact: this website itself is built with using the hugo package from PyPI, thus serving as a real-world test case for the project!
Quickstart
Create a virtual environment and install the package (or install it globally on your system):
python -m virtualenv venv
source venv/bin/activate
python -m pip install hugoThis example is using virtualenv to create a virtual environment, however, you can use any virtual environment manager of your choice. Some popular ones are the built-in venv module, virtualenvwrapper, pipenv, conda, poetry, pyenv, uv, and so on.
This places a hugo installation with an executable in your virtual environment and adds an entry point to it in your virtual environment’s bin directory.
Then, you can use the hugo CLI commands as you would normally:
hugo version
hugo env --logLevel info
hugo new site my-new-site
hugo mod <...>
hugo --printI18nWarnings --buildDrafts serverand more!
Alternatively, you can install the package globally on your system:
python3.X -m pip install hugopipx install hugo # install Hugo through pipxor
uv tool install hugo # install Hugo through uvThis installs Hugo in a separate location on your system that is isolated from your global Python environment(s).
Please refer to the pipx documentation and documentation on uv’s tools interface for more information.
For more information on using Hugo and its command-line interface, please refer to the Hugo documentation and the Hugo CLI documentation.
What version of hugo do I install?
This project is versioned alongside Hugo releases, aligned with Hugo’s own versioning which uses SemVer — but is likely versioned according to 0ver standards based on their versioning history.
Binaries are available for Hugo versions 0.121.2 and above, through PyPI or through releases on GitHub. If you need an older version that is not available through this package, please consider using the official Hugo binaries.
Owing to the overall size limits on PyPI, only the most recent versions of Hugo are available for download through pip — older wheels will be deleted to make space for newer releases. If you need an older version, use the wheels uploaded to the GitHub releases page or the official Hugo binaries. The former can be done via pip by downloading the .whl file, or through pipx using the URL directly. For example:
pipx install "https://github.com/agriyakhetarpal/hugo-python-distributions/releases/download/v0.122.0/hugo-0.122.0-cp311-cp311-win_amd64.whl"