Skip to content

Commit 3183abf

Browse files
authored
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
2 parents 9be7780 + 7f64d07 commit 3183abf

File tree

154 files changed

+145
-367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+145
-367
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
- 'doc/**'
88
- '.github/workflows/hugo.yml'
99
pull_request:
10-
paths-ignore:
11-
- 'doc/**'
12-
- '.github/workflows/hugo.yml'
1310
schedule:
1411
# run daily, this refreshes the cache
1512
- cron: "13 2 * * *"

.github/workflows/other.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
- 'doc/**'
88
- '.github/workflows/hugo.yml'
99
pull_request:
10-
paths-ignore:
11-
- 'doc/**'
12-
- '.github/workflows/hugo.yml'
1310
schedule:
1411
# run daily, this refreshes the cache
1512
- cron: "13 2 * * *"

doc/README.md

Lines changed: 74 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,32 @@
1-
# Quick start guide:
1+
# Quick start guide
22

3-
- Visit https://xapi-project.github.io/new-docs/ to view the current documentation.
3+
- Visit <https://xapi-project.github.io/new-docs/> to view the current documentation.
44

55
## Required software
66

77
The docs use Hugo and the [Hugo Relearn theme](https://mcshelby.github.io/hugo-theme-relearn),
88
an enhanced fork of the popular Hugo Learn theme.
99

10-
### Compatible versions
10+
### Supported versions of Hugo and the Hugo Relearn theme
1111

12-
Due to a number of gradual changes in Hugo and Relearn,
13-
the docs are currently only compatible with specific older versions of Hugo and Relearn.
12+
Hugo Relearn 7.3.2 is currently used (defined by a git tag in `doc/go.mod`).
1413

15-
Hugo v0.121.0 to ~v0.127.0 (the current version of the Ubuntu `snap` is too recent)
16-
- Fixes to support newer versions are forthcoming.
17-
18-
Hugo Relearn 5.24.0 (defined by a git tag in doc/go.mod)
19-
- Note: Hugo Relearn >= 5.25 currently trigger additional warnings due to deprecations.
20-
- Further updates fix this situation are forthcoming step by step.
21-
22-
Hugo Relearn >= 5.24.0 and < 6.x are expected to work:
23-
- https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/index.html#5-24-0
24-
- Breaking changes in Relearn 6.0.0:
25-
https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0
14+
- 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.
2616

2717
## Installation
2818

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)
3626

3727
- To install Hugo from source, you need a recent `golang-1.2x` compiler:
3828
- On Ubuntu 22.04, this can be done with:
29+
3930
```bash
4031
sudo apt install golang-1.23-go
4132
# 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:
4738
## Development
4839

4940
- 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/>
5142
- Add content to `doc/content/`:
5243
- 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/`.
5546
- 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,
5748
[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:
78+
https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes
79+
80+
These pages might need review when making changes as their content is
81+
generated by layouts/partials/content.html:
82+
83+
- XenAPI Reference: <https://xapi-project.github.io/new-docs/xen-api/classes>
84+
- XenAPI Releases: <https://xapi-project.github.io/new-docs/xen-api/releases>
85+
86+
For a summary of the partials supported by the Hugo Relearn theme, see:
87+
https://mcshelby.github.io/hugo-theme-relearn/configuration/customization/partials
88+
89+
Hint: For upgrading the Hugo Relearn theme, you can use:
90+
91+
```bash
92+
cd doc; hugo mod get -u github.com/McShelby/[email protected]
93+
```
94+
95+
#### Summary
96+
97+
Hugo >= 0.126 and the Hugo Relearn >= 7.3.2 are supported to render the docs.
98+
99+
#### References
100+
101+
- Changes with Relearn 6.x:
102+
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0>
103+
- Breaking changes with Relearn 7.x:
104+
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0>

doc/content/design/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "Design Documents"
3-
menuTitle = "Designs"
3+
linkTitle = "Designs"
44
+++
55

66
{{< design_docs_list >}}

doc/content/toolstack/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: The XAPI Toolstack
3-
menuTitle: The Toolstack
3+
linkTitle: The Toolstack
44
weight: 10
55
---
66

doc/content/toolstack/features/events/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "Event handling in the Control Plane - Xapi, Xenopsd and Xenstore"
3-
menuTitle = "Event handling"
3+
linkTitle = "Event handling"
44
+++
55

66
Introduction

doc/content/xapi/cli/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "XE CLI architecture"
3-
menuTitle = "CLI"
3+
linkTitle = "CLI"
44
+++
55

66
{{% notice info %}}

doc/content/xapi/memory/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "Host memory accounting"
3-
menuTitle = "Memory"
3+
linkTitle = "Memory"
44
+++
55

66
Memory is used for many things:

doc/content/xapi/storage/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "XAPI's Storage Layers"
3-
menuTitle = "Storage"
3+
linkTitle = "Storage"
44
+++
55

66
{{% notice info %}}

doc/content/xapi/walkthroughs/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "XAPI requests walk-throughs"
3-
menuTitle = "Walk-throughs"
3+
linkTitle = "Walk-throughs"
44
+++
55

66
Let's detail the handling process of an XML request within XAPI.

0 commit comments

Comments
 (0)