Skip to content

Commit ac5fdd0

Browse files
🥲 Start moving docs out of README
1 parent ca019df commit ac5fdd0

File tree

1 file changed

+2
-193
lines changed

1 file changed

+2
-193
lines changed

README.md

Lines changed: 2 additions & 193 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This project provides wheels for [Hugo](https://gohugo.io/) so that it can be us
4343

4444
This project, `hugo` is versioned alongside the Hugo releases and is aligned with the versioning of Hugo itself, which uses `SemVer` – but is likely versioned according to [0ver](https://0ver.org/) software standards based on their [versioning history](https://github.com/gohugoio/hugo/releases).
4545

46-
Binaries for `hugo` through these wheels are available for Hugo versions **0.121.2** and above, through PyPI or through releases on GitHubr. If you need an older version of `hugo` that is not available through this package, please consider using the [official Hugo binaries](https://github.com/gohugoio/hugo/releases).
46+
Binaries for `hugo` through these wheels are available for Hugo versions **0.121.2** and above, through PyPI or through releases on GitHub. If you need an older version of `hugo` that is not available through this package, please consider using the [official Hugo binaries](https://github.com/gohugoio/hugo/releases).
4747

4848
Please refer to the section on [Supported platforms](#supported-platforms) for a list of wheels available for supported platforms and architectures. If it does, jump to the [Quickstart](#quickstart) section to get started.
4949

@@ -52,198 +52,7 @@ Please refer to the section on [Supported platforms](#supported-platforms) for a
5252
5353
## Documentation
5454

55-
### Quickstart
56-
57-
Create a virtual environment and install the package (or install it globally on your system):
58-
59-
```bash
60-
python -m virtualenv venv # (or your preferred method of creating virtual environments)
61-
pip install hugo
62-
```
63-
64-
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. You can use the `hugo` command as you would normally:
65-
66-
```bash
67-
hugo version
68-
hugo env --logLevel info
69-
```
70-
71-
Alternatively, you can install the package globally on your system:
72-
73-
```bash
74-
python3.X -m pip install hugo # Unix
75-
py -m pip install hugo # Windows
76-
```
77-
78-
> [!TIP]
79-
> It is a great idea to use [`pipx`](https://github.com/pypa/pipx) to install or use Hugo in an isolated location without having to create a virtual environment, which will allow you to run Hugo as a command-line tool without having to install it globally on your system. i.e.,
80-
```bash
81-
pipx install hugo # install and run Hugo through pipx
82-
```
83-
or
84-
```bash
85-
pipx run hugo==0.121.2 # run a specific version of Hugo through pipx, even if a different version is installed in whatever environment you are in
86-
```
87-
Please refer to the [`pipx` documentation](https://pipx.pypa.io/stable/) for more information.
88-
89-
Then, you can use the `hugo` commands as you would normally:
90-
91-
```bash
92-
hugo version
93-
hugo env --logLevel info
94-
```
95-
96-
and
97-
98-
```bash
99-
hugo new site mysite
100-
hugo --printI18nWarnings server
101-
# and so on
102-
...
103-
```
104-
105-
Standard virtual environments can allow multiple versions of Hugo to be installed and used side-by-side. To use a specific version of Hugo, you can specify the version when installing the package (please refer to the section [_What version of `hugo` do I install?_](#what-version-of-hugo-do-i-install) for more information):
106-
107-
```bash
108-
pip install "hugo==0.X.Y"
109-
```
110-
111-
For more information on using Hugo and its command-line interface, please refer to the [Hugo documentation](https://gohugo.io/documentation/) and [Hugo CLI documentation](https://gohugo.io/commands/).
112-
113-
### Supported platforms
114-
115-
A subset of the platforms supported by Hugo itself are supported by these wheels for `hugo` via `hugo-python-distributions`. The plan is to support as many platforms as possible with Python wheels and platform tags. Please refer to the following table for a list of supported platforms and architectures:
116-
117-
| Platform | Architecture | Support |
118-
| -------- | --------------- | ------------------------------- |
119-
| macOS | x86_64 (Intel) ||
120-
| macOS | arm64 (Silicon) ||
121-
| Linux | amd64 ||
122-
| Linux | arm64 ||
123-
| Windows | x86_64 ||
124-
| Windows | arm64 | 💡 Experimental support [^1] |
125-
| Windows | x86 | 💡 Experimental support [^1] |
126-
| DragonFlyBSD | amd64 | ❌ Will not receive support[^2] |
127-
| FreeBSD | amd64 | ❌ Will not receive support[^2] |
128-
| OpenBSD | amd64 | ❌ Will not receive support[^2] |
129-
| NetBSD | amd64 | ❌ Will not receive support[^2] |
130-
| Solaris | amd64 | ❌ Will not receive support[^2] |
131-
132-
[^1]: Support for 32-bit (i686) and arm64 architectures on Windows is made possible through the use of the [Zig compiler toolchain](https://ziglang.org/) that uses the LLVM ecosystem. These wheels are experimental owing to the use of `cibuildwheel` and cross-compilation and may not be stable or reliable for all use cases, and are not officially supported by the Hugo project at this time. Please refer to the [Building from source](#building-from-source) section for more information on how to build Hugo for these platforms and architectures, since these wheels are not currently pushed to PyPI for general availability – however, they are tested regularly in CI. If you need support for these platforms, please consider building from source or through a CI provider.
133-
134-
[^2]: Support for these platforms is not possible to include because of i. the lack of resources to test and build for them and ii. the lack of support for these platform specifications in Python packaging standards and tooling. If you need support for these platforms, please consider downloading the [official Hugo binaries](https://github.com/gohugoio/hugo/releases)
135-
136-
### Building from source
137-
138-
Building the extended version of Hugo from source requires the following dependencies:
139-
140-
- The [Go](https://go.dev/doc/install) toolchain
141-
- The [Git](https://git-scm.com/downloads) version control system
142-
- A C/C++ compiler, such as [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/)
143-
144-
Windows users can use the [Chocolatey package manager](https://chocolatey.org/) in order to use the [MinGW compiler](https://chocolatey.org/packages/mingw). After installing Chocolatey, run the following command in an elevated terminal prompt:
145-
146-
```bash
147-
choco install mingw
148-
```
149-
150-
Then, clone the repository and run the build script:
151-
152-
```bash
153-
git clone https://github.com/agriyakhetarpal/hugo-python-distributions@main
154-
python -m venv venv
155-
source venv/bin/activate # on Unix-based systems
156-
venv\Scripts\activate.bat # on Windows
157-
pip install -e . # editable installation
158-
pip install . # regular installation
159-
```
160-
161-
#### Cross-compiling for different architectures
162-
163-
> [!NOTE]
164-
> Cross-compilation is experimental and may not be stable or reliable for all use cases. If you encounter any issues with cross-compilation, please feel free to [open an issue](https://github.com/agriyakhetarpal/hugo-python-distributions/issues/new).
165-
166-
This project is capable of cross-compiling Hugo binaries for various platforms and architectures and it can be used as follows. Cross-compilation is provided for the following platforms:
167-
168-
1. macOS for the `arm64` and `amd64` architectures via the Xcode toolchain,
169-
2. Linux for the `arm64` and `amd64` architectures via the Zig toolchain, and
170-
3. Windows for the `arm64`, and `x86` architectures via the Zig toolchain.
171-
172-
Please refer to the examples below for more information on how to cross-compile Hugo for different architectures:
173-
174-
##### macOS
175-
176-
Say, on an Intel-based (x86_64) macOS machine:
177-
178-
```bash
179-
export GOARCH="arm64"
180-
pip install . # or pip install -e .
181-
```
182-
183-
This will build a macOS `arm64` binary distribution of Hugo that can be used on Apple Silicon-based (`arm64`) macOS machines. To build a binary distribution for the _target_ Intel-based (`x86_64`) macOS platform on the _host_ Apple Silicon-based (`arm64`) macOS machine, you can use the following command:
184-
185-
```bash
186-
export GOARCH="amd64"
187-
pip install . # or pip install -e .
188-
```
189-
190-
##### Linux
191-
192-
First, install [Zig](https://ziglang.org/download/) on your Linux machine, and set these environment variables prior to installing the package:
193-
194-
Say, on an `amd64` Linux machine:
195-
196-
```bash
197-
export CC="zig cc -target aarch64-linux-gnu"
198-
export CXX="zig c++ -target aarch64-linux-gnu"
199-
export GOARCH="arm64"
200-
pip install . # or pip install -e .
201-
```
202-
203-
will cross-compile a Linux arm64 binary distribution of Hugo that can be used on the targeted arm64 Linux machines. To build a binary distribution for the _target_ `amd64` Linux platform on the _host_ `arm64` Linux machine, set the targets differently:
204-
205-
```bash
206-
export CC="zig cc -target x86_64-linux-gnu"
207-
export CXX="zig c++ -target x86_64-linux-gnu"
208-
export GOARCH="amd64"
209-
pip install . # or pip install -e .
210-
```
211-
212-
This creates dynamic linkage for the built Hugo binary with a system-provided GLIBC. If you wish to statically link the binary with MUSL, change the `CC` and `CXX` environment variables as follows:
213-
214-
```bash
215-
export CC="zig cc -target x86_64-linux-musl"
216-
export CXX="zig c++ -target x86_64-linux-musl"
217-
```
218-
219-
Linkage against MUSL is not tested in CI at this time, but it should work in theory. The official Hugo binaries do not link against MUSL for a variety of reasons including but not limited to the size of the binary and the popularity of the GLIBC C standard library and its conventions.
220-
221-
##### Windows
222-
223-
First, install [Zig](https://ziglang.org/download/) on your Windows machine, and set these environment variables prior to installing the package:
224-
225-
Say, on an `amd64` Windows machine:
226-
227-
```bash
228-
set CC="zig cc -target aarch64-windows-gnu"
229-
set CXX="zig c++ -target aarch64-windows-gnu"
230-
set GOARCH="arm64"
231-
pip install . # or pip install -e .
232-
```
233-
234-
will cross-compile a Windows `arm64` binary distribution of Hugo that can be used on the targeted `arm64` Windows machines (note the use of `set` instead of `export` on Windows), and so on for the `x86` architecture:
235-
236-
```bash
237-
set CC="zig cc -target x86-windows-gnu"
238-
set CXX="zig c++ -target x86-windows-gnu"
239-
set GOARCH="386"
240-
pip install . # or pip install -e .
241-
```
242-
243-
For a list of supported distributions for Go, please run the `go tool dist list` command on your system. For a list of supported targets for Zig, please refer to the [Zig documentation](https://ziglang.org/documentation/) for more information or run the `zig targets` command on your system.
244-
245-
> [!TIP]
246-
> Cross-compilation for a target platform and architecture from a different host platform and architecture is also possible, but it remains largely untested at this time. Currently, the [Zig compiler toolchain](https://ziglang.org/) is known to work for cross-platform, cross-architecture compilation.
55+
The documentation for this project is available at [https://agriyakhetarpal.github.io/hugo-python-distributions/](https://agriyakhetarpal.github.io/hugo-python-distributions/)
24756

24857
### Background
24958

0 commit comments

Comments
 (0)