Skip to content

Commit 1304e5c

Browse files
committed
feat: add changelog option to frontmatter and update default behavior in useChangelog
1 parent e75249e commit 1304e5c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/vitepress-theme/frontmatter.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The Nimiq Vitepress theme supports the following frontmatter options:
3333
| `outline` | `boolean` | `true` if headings exist | Whether to show the outline (table of contents) |
3434
| `secondarySidebar` | `boolean` | `true` for docs layout, `false` for home layout | Whether to show the secondary sidebar |
3535
| `widget` | `boolean` | `true` for docs layout, `false` for home layout | Whether to show the widget area in the secondary sidebar |
36+
| `changelog` | `boolean` | `true` for docs layout, `false` for home layout | Whether to show the changelog in the secondary sidebar |
3637

3738
## Page Layouts
3839

@@ -76,6 +77,7 @@ layout: home
7677
# Override the default home layout behavior to show the widget area
7778
secondarySidebar: true
7879
widget: true
80+
changelog: true
7981
---
8082
```
8183

@@ -88,6 +90,7 @@ The secondary sidebar contains both the outline (table of contents) and optional
8890
# Hide the outline but keep the widget
8991
outline: false
9092
widget: true
93+
changelog: true
9194

9295
# Or hide both by disabling the entire secondary sidebar
9396
secondarySidebar: false

packages/nimiq-vitepress-theme/src/composables/useChangelog.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export const useChangelog = createGlobalState(() => {
3636
const showChangelog = computed(() => {
3737
if (frontmatter.value.changelog !== undefined)
3838
return !!frontmatter.value.changelog
39-
return true
39+
40+
// Default behavior: true for docs layout, false for home layout
41+
const layout = frontmatter.value.layout || 'docs'
42+
return layout === 'docs'
4043
})
4144

4245
return {

0 commit comments

Comments
 (0)