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

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

Closed
itowlson opened this issue Feb 28, 2023 · 4 comments
Closed

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

itowlson opened this issue Feb 28, 2023 · 4 comments

Comments

@itowlson
Copy link
Contributor

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
Copy link
Contributor

tpmccallum commented Feb 28, 2023

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
Copy link
Contributor

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

@tpmccallum
Copy link
Contributor

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

@tpmccallum
Copy link
Contributor

This has been resolved via PR #616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants