-
Notifications
You must be signed in to change notification settings - Fork 243
Hide an article from the sidebar or draft mode
Pepe Cano edited this page Apr 17, 2020
·
2 revisions
k6 doc project provides the options to hide articles:
- ability to hide certain articles from the sidebar and mobile dropdown menu while respectful pages still have to be generated and accessible via other links or manual url typing.
- ability to generate certain content only in dev mode to prevent leaking doc entries into prod
Add hideFromSidebar field to the .md file you want to hide from sidebar:
---
title: 'k6 REST API'
excerpt: ''
hideFromSidebar: true
---Then rebuild project in prod mode.
- You have to keep at least one frontmatter
hideFromSidebarfield among.mdfiles with any value to prevent GraphQL query errors. Consider usingBooleantypes for clarity. - You cannot hide article cluster with that option! Given:
If you want to hide from sidebar the whole k6-ws cluster you should add hideFromSidebar to each .md file in a cluster. Setting this field only to high level 08 [k6-ws.md](http://k6-ws.md) will lead to unwanted behaviour.
Add draft flag to the frontmatter field to be available in dev mode or the staging environment
---
title: 'k6 REST API'
excerpt: ''
draft: 'true'
---Then rebuilt in prod mode
Actually, they are exactly the same:
-
draftis a string. -
keep at least 1
draftflag with any value among.mdentries to prevent build errors from graphql -
do not use this flag at high level entries (look at example above with
k6-ws)