You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docs update to upstream hugo relearn 7.3.2 (#6267)
Minor fixup: It should be ready for a new round reviews now:
The incremental change consists only of the required incremental fixes
(see the [Compare
link](https://github.com/xapi-project/xen-api/compare/e92341cd8439a083e4c8ad54c55690de6f2c04a5..7f64d072899e05f39afe9fd3391bf00ddec2a099)
of it.
- Review comment from Pau applied: Reverted not running the required
pull_request workflows.
- Review comment from Pau applied: Fixed not even temporarily using
private forks: Squashed commits
- While squashing those changes, I:
- Split change from `menuTitle` to `linkTitle` into an initial commit
(can be done first)
- Squashed the changes for `doc/hugo.toml` into one commit.
- and extracted the change to `hugo.toml` into one commit (support
current Hugo versions)
- Squashed the changes for `doc/README.md` into one commit (no
intermediate changes)
- I found one inadvertent revert of a previous simplification: I removed
this accidental revert.
----
Hugo docs: Fix upstream Hugo compatibility:
- Includes the fixed commit from #6264, and
- Adds a 2nd commit to complete the fix for upstream compatibility.
### Update Hugo version support to work with the current Hugo version
This PR fixes using the Ubuntu snap to render the Hugo docs.
Relearn 7.x completely REMOVED the `header.html` and `footer.html`
partials
Partials that useed them are:
-
https://github.com/xapi-project/xen-api/blob/master/doc/layouts/xenapi/class.html
-
https://github.com/xapi-project/xen-api/blob/master/doc/layouts/xenapi/release.html
To update to 7.x, these had to be moved to the content.html partial, as
documented.
Changes:
- Hugo Relearn 6.x uses the `linkTitle` front matter option now:
Quote from the release notes: _The front matter option `menuTitle`
[deprecated in
5.24.0](https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/index.html#5-24-0)
was removed in favour for Hugo’s linkTitle._
- Newer versions of Hugo require the option `unsafe = true` to include
raw HTML.
- Two Hugo Relearn 6.x partials need fixes for newer versions of Hugo.
### Update doc/README.md accordingly
- Update the information on supported versions.
- Add information on the breaking changes in Hugo Relearn 7.x.x to watch
out for.
- While at it, fix/improve the formatting of doc/README.md:
- Spelling fixes/improvements
- Fix markdown linting errors (empty lines for spacing, no bare links)
- Tidy up the document structure
- The minimum Hugo version required by the Relearn theme is 0.126.0.
15
+
- The current Ubuntu `snap` (which provides 0.142.0) also works.
26
16
27
17
## Installation
28
18
29
-
- Install Hugo; follow the guidance on https://gohugo.io/getting-started/installing.
30
-
You'll need to install Go as well: see https://go.dev/
31
-
- Hugo installation is described at https://gohugo.io/installation
32
-
- On Ubuntu 24.04, the version installed by `apt` works.
33
-
- On Ubuntu 22.04 and older:
34
-
-`apt-get install hugo` would install a version that is too old.
35
-
-`sudo snap install hugo` installs a too recent version
19
+
- Install Hugo 0.126 or newer (required by the Hugo Relearn theme)
20
+
follow the guidance on <https://gohugo.io/installing>.
21
+
You'll need to install Go as well: see <https://go.dev/>
22
+
- On Ubuntu, use the `snap` package:
23
+
-`sudo snap install hugo` installs the current version
24
+
`apt-get install hugo` would install a version that is too old,
25
+
(this applies up to Ubuntu 24.04)
36
26
37
27
- To install Hugo from source, you need a recent `golang-1.2x` compiler:
38
28
- On Ubuntu 22.04, this can be done with:
29
+
39
30
```bash
40
31
sudo apt install golang-1.23-go
41
32
# Add it to your path, assuming your .local/bin/ is early in your PATH:
@@ -47,13 +38,67 @@ Hugo Relearn >= 5.24.0 and < 6.x are expected to work:
47
38
## Development
48
39
49
40
- Run a local server: `hugo server`
50
-
- Open a browser at http://127.0.0.1:1313/new-docs/
41
+
- Open a browser at <http://127.0.0.1:1313/new-docs/>
51
42
- Add content to `doc/content/`:
52
43
- Documents are written in Markdown.
53
-
- Please wrap lines in paragraphs to make review and diffs easier to read.
54
-
- The menu hierarchy comes mostly from the directory structure in`content/`.
44
+
- Please wrap lines in paragraphs to make reviews more manageable.
45
+
- The menu hierarchy comes mainly from the directory structure in`content/`.
55
46
- A file called `_index.md` is needed in a directory to define a new level in the menu.
56
-
- To set the page title which is also used for the main menu,
47
+
- To set the page title,
57
48
[use the front matter](https://gohugo.io/content-management/front-matter/).
58
-
- For a page that has images or other stuff included, it is best to create a new directory. Put the contents in a `index.md` file (no `_`) and the related files next to it. See https://gohugo.io/content-management/organization/ for more information.
59
-
- Look at https://mcshelby.github.io/hugo-theme-relearn/ for more information about what the Relearn theme offers, including some handy "shortcodes".
49
+
- For a page that has images or other stuff included, it is best to create a new directory:
50
+
Put the contents in an `index.md` file (no `_`) and the related files next to it.
51
+
See <https://gohugo.io/content-management/organization/>for more information.
52
+
53
+
See <https://mcshelby.github.io/hugo-theme-relearn/>for more information about
54
+
the features of the Relearn theme, including handy "shortcodes".
55
+
56
+
Note: When switching versions, before re-generating the documentation using
57
+
`hugo server`, delete the previously generated static site using `rm -r docs/public`.
58
+
59
+
### Notes for supporting current versions of Hugo and the Relearn theme
60
+
61
+
Backported fixes to support newer Hugo versions:
62
+
63
+
- `layouts/partials/header.html`, it fixes:
64
+
```js
65
+
ERROR deprecated: .Sites.First was deprecated in Hugo v0.127.0 and will be removed in Hugo 0.143.0. Use .Sites.Default instead.
66
+
```
67
+
- `layouts/partials/menu.html`, it fixes:
68
+
```js
69
+
ERROR deprecated: .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in Hugo 0.143.0. Use hugo.IsMultilingual instead.
70
+
```
71
+
72
+
The fixes for those issues were backported from the Hugo Relearn v7.x.x theme.
73
+
When updating to Hugo Relearn 7.x.x, please remove them (if possible).
74
+
75
+
#### Tips when upgradubg to newer Hugo Relearn versions
76
+
77
+
Check the release notes of the Hugo Relearn theme for breaking changes:
0 commit comments