Fix/missing openbolt topic links and subtopic summaries#387
Conversation
|
I put together an alternative approach, #388, there are some minor tradeoffs but it seems simpler and less brittle. |
|
this PR commingles several topics. I'd like to see them as individual PRs |
| {%- endfor -%} | ||
|
|
||
| {%- comment -%} | ||
| Extract the child's first intro paragraph for the description. |
There was a problem hiding this comment.
I think I'd rather that we populate the front matter description field.
Fwiw, the example you linked doesn't autogenerate descriptions. See "running plans" on https://help.puppet.com/bolt/current/topics/plans.htm
I'd considered that, but ended up staging them as individual commits in a single PR, because each one basically fixes a follow-on issue the previous fix exposed, and I didn't want merging just one PR in the chain to result in publishing not-actually-fixed docs. Is that a legitimate concern? If not, I'll happily break it up into individual PRs. |
The OpenBolt page renders missed the top-level landing pages for plans and tasks (and the product itself) because they didn't handle the case where a nav item parent ALSO contained a link to their own content. This patch adds that capability to the liquid templates, along with some comments to avoid gotchas Assisted-by: Claude Opus 4.7 Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
- Remove old bolt.html (now reachable by nav menu template fix) - Recover/adapt relevant 'bolt.html' page content into index page - Rebrand Bolt to OpenBolt on navbar, landing, and version pages - Fix various broken cross-links This is not a complete overhaul for branding and correctness, but it fixes what I needed to update before removing 'bolt.html' Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
This mimics the parent-topic-with-links behavior seen in the original Puppet Bolt documentation site, linking to each child/sub-topic under the parent, with a summary taken from that sub-topic's first paragraph. Parent .md templates must include the child_topics.html to endable this behavior Assisted-by: Claude Opus 4.8 Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
a182c48 to
fb1fb60
Compare
miharp
left a comment
There was a problem hiding this comment.
Built the branch locally and tested both URL prefixes. The nav-item change checks out — no rendering change for any other collection's nav shapes. One functional issue with the new child_topics include on the versioned /openbolt/5.x/ pages, plus three small content fixes on index.md; all four have one-click suggestions inline.
| {%- assign nav_base = nil -%} | ||
| {%- for entry in site.data.nav_map -%} | ||
| {%- if entry.nav_key == page.nav -%} | ||
| {%- assign nav_base = entry.base -%} | ||
| {%- break -%} | ||
| {%- endif -%} | ||
| {%- endfor -%} | ||
|
|
||
| {%- assign page_subpath = page.url | remove_first: nav_base -%} |
There was a problem hiding this comment.
The child-topics list only renders under /openbolt/latest/. Each collection also publishes at its versioned prefix (/openbolt/5.x/, via the _openbolt_latest symlink), but nav_map has a single base: /openbolt/latest/ for this nav key, so on a 5.x page remove_first: nav_base strips nothing, no nav entry matches, and the include silently emits nothing. Deriving the base from the page's own URL (same technique as sidebar.html) works under both prefixes, and won't need nav_map bookkeeping when 6.x lands:
| {%- assign nav_base = nil -%} | |
| {%- for entry in site.data.nav_map -%} | |
| {%- if entry.nav_key == page.nav -%} | |
| {%- assign nav_base = entry.base -%} | |
| {%- break -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- assign page_subpath = page.url | remove_first: nav_base -%} | |
| {%- assign nav_collection_dir = page.collection | prepend: '_' | append: '/' -%} | |
| {%- assign page_subpath = page.relative_path | remove_first: nav_collection_dir | replace: '.md', '.html' | replace: '.markdown', '.html' -%} | |
| {%- assign nav_base = page.url | remove: page_subpath -%} |
Tested locally: with this, /openbolt/5.x/plans.html renders the full list with version-correct child links (descriptions too, since the site[page.collection] lookup then matches), and /openbolt/latest/ renders exactly as before.
| - [Join us on Slack](https://voxpupuli.slack.com/) - Join the #bolt channel. | ||
| - Follow us on [Bluesky](https://bsky.app/profile/voxpupuli.bsky.social/) or [Mastodon](https://fosstodon.org/@voxpupuli/) | ||
| - [Connect with the OpenVox/VoxPupuli Community](https://voxpupuli.org/connect/) | ||
| - [OpenVox on GitHub](https://github.com/openvox/) |
There was a problem hiding this comment.
github.com/openvox is an unrelated company (OpenVox Communication Co., Ltd., a telephony hardware vendor) that happens to own that org name — and since it returns a 200 rather than a 404, link checkers won't catch it. The project org is OpenVoxProject, as used elsewhere in this file:
| - [OpenVox on GitHub](https://github.com/openvox/) | |
| - [OpenVox on GitHub](https://github.com/OpenVoxProject/) |
| - [Installing OpenBolt](bolt_installing.html) | ||
| - [Getting started with Bolt](getting_started_with_bolt.html) |
There was a problem hiding this comment.
I think these two are leftovers from the old bolt.md "Getting started" list — both already appear on this page under better homes: "Installing OpenBolt" under Install OpenBolt (line 30) and the getting-started page under Learn the basics (line 57, where it's labeled "Getting started with OpenBolt" — this copy still says "Bolt"). Dropping them removes the duplication and the naming mismatch in one go:
| - [Installing OpenBolt](bolt_installing.html) | |
| - [Getting started with Bolt](getting_started_with_bolt.html) |
| - [Writing tasks](writing_tasks.html) | ||
| - [Writing plans](writing_plans.html) | ||
| - [Writing plans in YAML](writing_yaml_plans.html) | ||
| - [Example plans](writing_plans.html) |
There was a problem hiding this comment.
"Example plans" points at the same writing_plans.html as the "Writing plans" bullet two lines up, and no dedicated example-plans page exists (carried over from the old bolt.md). Since Learn the basics already links "OpenBolt examples" (bolt_examples.html), the cleanest fix is to drop the bullet:
| - [Example plans](writing_plans.html) |
This patch restores the behavior and missing content of the original Bolt documentation site:
bolt,plans,tasks,bolt_examples) in the navbaritem:+link:items in the_data/nav/<product>_<version>.ymldataboltpage (the original Puppet Bolt landing page, left in the repo)boltpage intoindex(the OpenBolt landing page)This fix is a prerequisite to replacing the defunct pup.pt links, referenced in bolt's error and help messages.
Implementation notes:
item:andlink:plan.md).Assisted-by: Claude Opus 4.7 & 4.8
Fixes #386
Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent