DocumenterVitepress.jl icon indicating copy to clipboard operation
DocumenterVitepress.jl copied to clipboard

"Next page" link on homepage points to index which is homepage

Open LilithHafner opened this issue 1 year ago • 3 comments

This issue is visible at the bottom of https://chairmarks.lilithhafner.com/v1.1.2/. The "Next page: Home" button links to https://chairmarks.lilithhafner.com/v1.1.2/index which redirects to https://chairmarks.lilithhafner.com/v1.1.2/.

LilithHafner avatar Mar 09 '24 00:03 LilithHafner

Bump, a user of Chairmarks has found this issue as well :)

LilithHafner avatar Apr 06 '25 18:04 LilithHafner

I would not say that is a bug per se, rather a config setup convention. In vitepress, the root index.md is used for the landing page, which only contains the top nav menu, the sidebar menu is for content other than that.

Setting the following at the top of your index.md file should give you the expected behaviour.

```@raw html
---
layout: home
---
```

lazarusA avatar Apr 11 '25 09:04 lazarusA

ok, looking back again at vitepress, in config.mts we can do:

sidebar: [
  { text: 'Home', link: '/' }, // note that it should be the root `/` instead of `index.md`. 
  { text: 'Why use Chairmarks?', link: '/why' },
  { text: 'Tutorial', link: '/tutorial' },
  { text: 'How To', collapsed: false, items: [
  { text: 'migrate from BenchmarkTools', link: '/migration' },
  { text: 'install Chairmarks ergonomically', link: '/autoload' },
  { text: 'perform automated regression testing on a package', link: '/regressions' }]
   },
  { text: 'Reference', link: '/reference' },
  { text: 'Explanations', link: '/explanations' }
  ]

and this will get the proper navigation links, no need for layout: home. Unfortunately, using the page keyword in make.jl is not supported:

[ Info: SetupBuildDirectory: setting up build directory.
ERROR: '/' is not an existing page!

will need to investigate more for a Documenter/DVpress solution. But a pure vitepress solution is already possible.

lazarusA avatar Apr 12 '25 15:04 lazarusA