fermyon / developer

This is the home for developer.fermyon.com
https://developer.fermyon.com
Apache License 2.0
54 stars 69 forks source link

Keep area TOC when the user goes to a common page #394

Closed itowlson closed 1 year ago

itowlson commented 1 year ago

I was tootling around looking at stuff in the Spin docs and clicked on the CLI reference. Now the Spin TOC has disappeared and there's links about contributing to Bartholomew whoever he is.

The back button gets me home, so this is definitely not a big deal! But (a) it's a bit odd that the TOC changes and (b) it means I can't keep the reference open while scanning the TOC for relevant links. It would be nice to have the shared content but retain the area TOC.

tpmccallum commented 1 year ago

This is a good point. Here is a bit of background as to why this is currently the case; I thought I might number the points so we can reference individually whilst trying to find a new idea or solution to the "keep area ToC" request.

  1. At present we can only have one .hbs template per .md file.
  2. The .hbs template, referenced in each .md file's frontmatter, is what renders the left-hand-side menu.
  3. An .md file such as the CLI Reference is useful for both Spin and Cloud projects (there are also other .md files that are useful to two or more projects i.e. the contributing to the docs .md is the same for Spin, Cloud and Bartholomew projects).
  4. Rather than mirror .md files, that are common across two or more projects, we have opted for keeping just a single version of a particular common file in a common area (this area has its own .hbs template).
  5. A user will see the common left-hand-side menu when visiting a specific common .md file because that .md file has the common .hbs referenced in its frontmatter.
  6. We could update the site to open common documents in a new tab but that essentially still takes the user to a new place (and might not be a better solution that, as you say, just hitting the back button).
  7. It might be possible to update Bartholomew itself to use dynamic templates (as apposed to typing hard-coded templates into each .md frontmatter section).
tpmccallum commented 1 year ago

A new feature/enhancement request has been placed in the Bartholomew repository; Re: dynamic templates. https://github.com/fermyon/bartholomew/issues/161

tpmccallum commented 1 year ago

Re-opening so that the updating of Bartholomew and shipping into developer docs can be tracked in this issue.

tpmccallum commented 1 year ago

This has been resolved via PR #616