Skip to content

Commit b058cc4

Browse files
committed
docs(website): Show the documented version in the navbar only
Naming the release in both the navbar and the footer was one place too many. The footer is the copy-free one, but it sits below a page of flags where nobody sees it, so the badge stays and the footer partial goes. Comments trimmed with it, including one that had gone stale: the footer described HUGO_PARAMS_VERSION, which stopped existing when the version became a release-please-bumped literal in hugo.yaml.
1 parent c2327ef commit b058cc4

6 files changed

Lines changed: 10 additions & 49 deletions

File tree

‎internal/cmd/root.go‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ func nudgeInit(cmd *cobra.Command) bool {
174174
return true
175175
}
176176

177-
// Root returns the fully wired command tree, for callers that need to inspect
178-
// it rather than run it — documentation generation, shell completions. It never
179-
// executes a command, so no credential or network access is involved.
177+
// Root returns the command tree for cmd/docgen
180178
func Root() *cobra.Command {
181179
prepare()
182180
return rootCmd

‎website/README.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Then open <http://localhost:1313>. Re-run `docgen` after changing help text.
1818

1919
## What is hand-written
2020

21-
| Path | Purpose |
22-
| -------------------------------------- | ---------------------------------- |
23-
| `hugo.yaml` | Site config, navigation, theme |
24-
| `layouts/_partials/navbar-title.html` | Theme override: version badge |
25-
| `layouts/_partials/custom/footer.html` | Names the release being documented |
26-
| `layouts/home.html` | Theme override |
21+
| Path | Purpose |
22+
| ------------------------------------- | ------------------------------ |
23+
| `hugo.yaml` | Site config, navigation, theme |
24+
| `layouts/_partials/navbar-title.html` | Theme override: version badge |
25+
| `layouts/home.html` | Theme override |

‎website/hugo.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ menu:
4545
icon: github
4646

4747
params:
48-
# The release this build documents, shown beside the navbar title and in the
49-
# footer. Bumped by release-please, which is why website/hugo.yaml is one of
50-
# its extra-files.
5148
version: "v2.0.0-beta.3" # x-release-please-version
5249
description: The Flagsmith command-line interface — manage flags, segments and environments from your terminal.
5350
navbar:

‎website/layouts/_partials/custom/footer.html‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎website/layouts/_partials/navbar-title.html‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
{{/*
2-
Hextra has no hook for navbar content, so this is the theme's own
3-
navbar-title.html with a version badge added beside the title. The version
4-
belongs where it is seen without scrolling: a reader arriving from a search
5-
result on an older CLI should not have to reach the footer to find out which
6-
release the page describes.
7-
8-
The auto margin that pushes the menu to the right moves onto the badge when
9-
there is one, so the badge sits beside the title rather than beside the menu.
10-
11-
Copied from hextra@v0.12.3 layouts/_partials/navbar-title.html; re-check when
12-
bumping the theme.
2+
Copied from hextra@v0.12.3 to add the version badge, which has no hook. The
3+
auto margin moves onto the badge so it sits beside the title.
134
*/}}
145
{{- $logoPath := .Site.Params.navbar.logo.path | default "images/logo.svg" -}}
156
{{- $logoLink := .Site.Params.navbar.logo.link | default .Site.Home.RelPermalink -}}

‎website/layouts/home.html‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{{/*
2-
The site is the command reference, so the home page is the `flagsmith` root
3-
command's own page and needs the command tree beside it. Hextra's home layout
4-
passes disableSidebar, which would leave the front page with no navigation at
5-
all, so use the layout the theme gives any other reference page.
6-
7-
Copied from hextra@v0.12.3 layouts/docs/list.html; re-check when bumping the
8-
theme.
2+
Customise the homepage (copied from `hextra@v0.12.3`) in order to update the
3+
sidebar to match flagsmith's command structure.
94
*/}}
105
{{ define "main" }}
116
<div class='hx:mx-auto hx:flex hextra-max-page-width'>

0 commit comments

Comments
 (0)