Skip to content

Commit 1537c78

Browse files
Hugo docs: Support newer Hugo and Hugo Relearn versions; update README
1 parent 4ea5d43 commit 1537c78

File tree

16 files changed

+345
-42
lines changed

16 files changed

+345
-42
lines changed

doc/README.md

Lines changed: 72 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 6.4.0 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,65 @@ 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+
#### Upgrading to the Hugo Relearn 7.x.x theme versions
76+
77+
The partials in `layouts/partials` contain code for rendering the XenAPI releases
78+
and class reference:
79+
80+
These custom partials need updates to support the breaking changes of Hugo Relearn
81+
7.0.0. Otherwise, the Relearn theme menu sidebar on those pages would be missing.
82+
These are the pages to verify for correct menu rendering when updating to 7.x.x:
83+
84+
- XenAPI Reference: <https://xapi-project.github.io/new-docs/xen-api/classes>
85+
- XenAPI Releases: <https://xapi-project.github.io/new-docs/xen-api/releases>
86+
87+
Hint: For upgrading the Hugo Relearn theme, you can use:
88+
89+
```bash
90+
cd doc; hugo mod get -u github.com/McShelby/[email protected]
91+
```
92+
93+
#### Summary
94+
95+
Hugo Relearn >= 5.23 and Relearn 6.x.x work now, 7.x.x is work in progress.
96+
97+
#### References
98+
99+
- Changes with Relearn 6.x:
100+
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0>
101+
- Breaking changes with Relearn 7.x (to be supported):
102+
<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/guides/howtos/add-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This document describes how to add a new class to the data model that
66
defines the Xen Server API. It complements two other documents that
77
describe how to extend an existing class:
88

9-
* [Adding a field](add-field)
10-
* [Adding a function](add-function)
9+
* [Adding a Field]({{% ref add-field.md %}})
10+
* [Adding a Function]({{% ref add-function.md %}})
1111

1212
As a running example, we will use the addition of a class that is part
1313
of the design for the PVS Direct feature. PVS Direct introduces

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.

doc/content/xapi/walkthroughs/migration_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "From RPC migration request to xapi internals"
3-
menuTitle = "How XAPI handles migration request"
3+
linkTitle = "How XAPI handles migration request"
44
+++
55

66
## Overview

0 commit comments

Comments
 (0)