Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs update to upstream hugo relearn 7.3.2 #6267

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
- 'doc/**'
- '.github/workflows/hugo.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
schedule:
# run daily, this refreshes the cache
- cron: "13 2 * * *"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
- 'doc/**'
- '.github/workflows/hugo.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
schedule:
# run daily, this refreshes the cache
- cron: "13 2 * * *"
Expand Down
103 changes: 74 additions & 29 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
# Quick start guide:
# Quick start guide

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

## Required software

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

### Compatible versions
### Supported versions of Hugo and the Hugo Relearn theme

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

Hugo v0.121.0 to ~v0.127.0 (the current version of the Ubuntu `snap` is too recent)
- Fixes to support newer versions are forthcoming.

Hugo Relearn 5.24.0 (defined by a git tag in doc/go.mod)
- Note: Hugo Relearn >= 5.25 currently trigger additional warnings due to deprecations.
- Further updates fix this situation are forthcoming step by step.

Hugo Relearn >= 5.24.0 and < 6.x are expected to work:
- https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/index.html#5-24-0
- Breaking changes in Relearn 6.0.0:
https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0
- The minimum Hugo version required by the Relearn theme is 0.126.0.
- The current Ubuntu `snap` (which provides 0.142.0) also works.

## Installation

- Install Hugo; follow the guidance on https://gohugo.io/getting-started/installing.
You'll need to install Go as well: see https://go.dev/
- Hugo installation is described at https://gohugo.io/installation
- On Ubuntu 24.04, the version installed by `apt` works.
- On Ubuntu 22.04 and older:
- `apt-get install hugo` would install a version that is too old.
- `sudo snap install hugo` installs a too recent version
- Install Hugo 0.126 or newer (required by the Hugo Relearn theme)
follow the guidance on <https://gohugo.io/installing>.
You'll need to install Go as well: see <https://go.dev/>
- On Ubuntu, use the `snap` package:
- `sudo snap install hugo` installs the current version
`apt-get install hugo` would install a version that is too old,
(this applies up to Ubuntu 24.04)

- To install Hugo from source, you need a recent `golang-1.2x` compiler:
- On Ubuntu 22.04, this can be done with:

```bash
sudo apt install golang-1.23-go
# Add it to your path, assuming your .local/bin/ is early in your PATH:
Expand All @@ -47,13 +38,67 @@ Hugo Relearn >= 5.24.0 and < 6.x are expected to work:
## Development

- Run a local server: `hugo server`
- Open a browser at http://127.0.0.1:1313/new-docs/
- Open a browser at <http://127.0.0.1:1313/new-docs/>
- Add content to `doc/content/`:
- Documents are written in Markdown.
- Please wrap lines in paragraphs to make review and diffs easier to read.
- The menu hierarchy comes mostly from the directory structure in `content/`.
- Please wrap lines in paragraphs to make reviews more manageable.
- The menu hierarchy comes mainly from the directory structure in `content/`.
- A file called `_index.md` is needed in a directory to define a new level in the menu.
- To set the page title which is also used for the main menu,
- To set the page title,
[use the front matter](https://gohugo.io/content-management/front-matter/).
- 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.
- Look at https://mcshelby.github.io/hugo-theme-relearn/ for more information about what the Relearn theme offers, including some handy "shortcodes".
- For a page that has images or other stuff included, it is best to create a new directory:
Put the contents in an `index.md` file (no `_`) and the related files next to it.
See <https://gohugo.io/content-management/organization/> for more information.

See <https://mcshelby.github.io/hugo-theme-relearn/> for more information about
the features of the Relearn theme, including handy "shortcodes".

Note: When switching versions, before re-generating the documentation using
`hugo server`, delete the previously generated static site using `rm -r docs/public`.

### Notes for supporting current versions of Hugo and the Relearn theme

Backported fixes to support newer Hugo versions:

- `layouts/partials/header.html`, it fixes:
```js
ERROR deprecated: .Sites.First was deprecated in Hugo v0.127.0 and will be removed in Hugo 0.143.0. Use .Sites.Default instead.
```
- `layouts/partials/menu.html`, it fixes:
```js
ERROR deprecated: .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in Hugo 0.143.0. Use hugo.IsMultilingual instead.
```

The fixes for those issues were backported from the Hugo Relearn v7.x.x theme.
When updating to Hugo Relearn 7.x.x, please remove them (if possible).

#### Tips when upgradubg to newer Hugo Relearn versions

Check the release notes of the Hugo Relearn theme for breaking changes:
https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes

These pages might need review when making changes as their content is
generated by layouts/partials/content.html:

- XenAPI Reference: <https://xapi-project.github.io/new-docs/xen-api/classes>
- XenAPI Releases: <https://xapi-project.github.io/new-docs/xen-api/releases>

For a summary of the partials supported by the Hugo Relearn theme, see:
https://mcshelby.github.io/hugo-theme-relearn/configuration/customization/partials

Hint: For upgrading the Hugo Relearn theme, you can use:

```bash
cd doc; hugo mod get -u github.com/McShelby/[email protected]
```

#### Summary

Hugo >= 0.126 and the Hugo Relearn >= 7.3.2 are supported to render the docs.

#### References

- Changes with Relearn 6.x:
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0>
- Breaking changes with Relearn 7.x:
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0>
2 changes: 1 addition & 1 deletion doc/content/design/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Design Documents"
menuTitle = "Designs"
linkTitle = "Designs"
+++

{{< design_docs_list >}}
2 changes: 1 addition & 1 deletion doc/content/toolstack/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: The XAPI Toolstack
menuTitle: The Toolstack
linkTitle: The Toolstack
weight: 10
---

Expand Down
2 changes: 1 addition & 1 deletion doc/content/toolstack/features/events/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Event handling in the Control Plane - Xapi, Xenopsd and Xenstore"
menuTitle = "Event handling"
linkTitle = "Event handling"
+++

Introduction
Expand Down
2 changes: 1 addition & 1 deletion doc/content/xapi/cli/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "XE CLI architecture"
menuTitle = "CLI"
linkTitle = "CLI"
+++

{{% notice info %}}
Expand Down
2 changes: 1 addition & 1 deletion doc/content/xapi/memory/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "Host memory accounting"
menuTitle = "Memory"
linkTitle = "Memory"
+++

Memory is used for many things:
Expand Down
2 changes: 1 addition & 1 deletion doc/content/xapi/storage/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "XAPI's Storage Layers"
menuTitle = "Storage"
linkTitle = "Storage"
+++

{{% notice info %}}
Expand Down
2 changes: 1 addition & 1 deletion doc/content/xapi/walkthroughs/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "XAPI requests walk-throughs"
menuTitle = "Walk-throughs"
linkTitle = "Walk-throughs"
+++

Let's detail the handling process of an XML request within XAPI.
Expand Down
2 changes: 1 addition & 1 deletion doc/content/xapi/walkthroughs/migration_overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = "From RPC migration request to xapi internals"
menuTitle = "How XAPI handles migration request"
linkTitle = "How XAPI handles migration request"
+++

## Overview
Expand Down
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/_index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
+++
title = "XenAPI Reference"
layout = "class"
type = "xenapi"
weight = 100
+++

Expand Down
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/auth.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "auth"
layout = "class"
type = "xenapi"
class = "auth"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/blob.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "blob"
layout = "class"
type = "xenapi"
class = "blob"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/bond.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "Bond"
layout = "class"
type = "xenapi"
class = "Bond"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/certificate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "Certificate"
layout = "class"
type = "xenapi"
class = "Certificate"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/cluster.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "Cluster"
layout = "class"
type = "xenapi"
class = "Cluster"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/cluster_host.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "Cluster_host"
layout = "class"
type = "xenapi"
class = "Cluster_host"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/console.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "console"
layout = "class"
type = "xenapi"
class = "console"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/crashdump.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "crashdump"
layout = "class"
type = "xenapi"
class = "crashdump"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/data_source.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "data_source"
layout = "class"
type = "xenapi"
class = "data_source"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/dr_task.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "DR_task"
layout = "class"
type = "xenapi"
class = "DR_task"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/event.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "event"
layout = "class"
type = "xenapi"
class = "event"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/feature.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "Feature"
layout = "class"
type = "xenapi"
class = "Feature"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/gpu_group.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "GPU_group"
layout = "class"
type = "xenapi"
class = "GPU_group"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/host.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "host"
layout = "class"
type = "xenapi"
class = "host"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/host_cpu.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "host_cpu"
layout = "class"
type = "xenapi"
class = "host_cpu"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/host_crashdump.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "host_crashdump"
layout = "class"
type = "xenapi"
class = "host_crashdump"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/host_metrics.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "host_metrics"
layout = "class"
type = "xenapi"
class = "host_metrics"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/host_patch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "host_patch"
layout = "class"
type = "xenapi"
class = "host_patch"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/lvhd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "LVHD"
layout = "class"
type = "xenapi"
class = "LVHD"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/message.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "message"
layout = "class"
type = "xenapi"
class = "message"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/network.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "network"
layout = "class"
type = "xenapi"
class = "network"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/network_sriov.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "network_sriov"
layout = "class"
type = "xenapi"
class = "network_sriov"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/observer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "Observer"
layout = "class"
type = "xenapi"
class = "Observer"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/pbd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "PBD"
layout = "class"
type = "xenapi"
class = "PBD"
+++
2 changes: 0 additions & 2 deletions doc/content/xen-api/classes/pci.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
+++
title = "PCI"
layout = "class"
type = "xenapi"
class = "PCI"
+++
Loading
Loading