Skip to content

Commit 064814e

Browse files
committed
fix: hide copy actions on non-docs layouts
1 parent 00b4db2 commit 064814e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/nimiq-vitepress-theme/src/layout/SearchCommandBox.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { LRUCache } from '../lib/lru'
1717
1818
const emit = defineEmits<{ close: [] }>()
1919
20-
const { localeIndex, theme, isDark } = useData<NimiqVitepressThemeConfig>()
20+
const { localeIndex, theme, isDark, frontmatter } = useData<NimiqVitepressThemeConfig>()
2121
2222
const {
2323
copyMarkdownContent,
@@ -77,6 +77,12 @@ const searchIndex = computedAsync(async () =>
7777
7878
const cache = new LRUCache(16) // 16 files
7979
80+
// Check if current layout is docs (default layout or explicitly set to 'docs')
81+
const isDocsLayout = computed(() => {
82+
const layout = frontmatter.value.layout
83+
return !layout || layout === 'docs'
84+
})
85+
8086
// Computed lists for better maintainability
8187
const moduleItems = computed(() =>
8288
theme.value.modules?.filter(m => !m.hidden) || [],
@@ -87,7 +93,8 @@ const socialItems = computed(() =>
8793
)
8894
8995
const copyItems = computed(() => {
90-
if (!showCopyMarkdown.value)
96+
// Only show copy/AI actions on docs layout
97+
if (!isDocsLayout.value || !showCopyMarkdown.value)
9198
return []
9299
93100
const items = []

0 commit comments

Comments
 (0)