Skip to content

Commit c299425

Browse files
committed
accounting docs - nuxt file serial added
1 parent d98af6d commit c299425

25 files changed

Lines changed: 70 additions & 2 deletions

components/layout/CustomAside.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const appConfig = useAppConfig();
4545
4646
const sidebarItems = computed(() => {
4747
const path = route.path;
48-
const sidebarConfig = appConfig.shadcnDocs.sidebar || {};
48+
const sidebarConfig = appConfig.shadcnDocs?.sidebar || {};
4949
5050
// Find which config section matches the current route
5151
const key = Object.keys(sidebarConfig).find((k) => path.startsWith(k));
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<template>
2+
<div v-if="page.prevNext ?? true" class="border-t pt-6 lg:flex lg:flex-row">
3+
<LayoutPrevNextButton :prev-next="prevPage" side="left" />
4+
<span class="flex-1" />
5+
<LayoutPrevNextButton :prev-next="nextPage" side="right" />
6+
</div>
7+
</template>
8+
9+
<script setup lang="ts">
10+
const { page } = useContent();
11+
const route = useRoute();
12+
const appConfig = useAppConfig();
13+
14+
// Get flattened list of all sidebar items (with both link and text) in order
15+
const sidebarItems = computed(() => {
16+
const sidebarConfig = appConfig.shadcnDocs?.sidebar || {};
17+
const key = Object.keys(sidebarConfig).find(k => route.path.startsWith(k));
18+
if (!key) return [];
19+
20+
const items: Array<{ link: string; text: string }> = [];
21+
const sidebar = sidebarConfig[key];
22+
23+
// Flatten sidebar and include both link and text
24+
sidebar.forEach(section => {
25+
if (section.items) {
26+
section.items.forEach(item => {
27+
if (item.link && item.text) {
28+
items.push({
29+
link: item.link,
30+
text: item.text
31+
});
32+
}
33+
});
34+
}
35+
});
36+
37+
return items;
38+
});
39+
40+
const currentIndex = computed(() =>
41+
sidebarItems.value.findIndex(item => item.link === route.path)
42+
);
43+
44+
const prevPage = computed(() => {
45+
if (currentIndex.value > 0) {
46+
const prevItem = sidebarItems.value[currentIndex.value - 1];
47+
return {
48+
_path: prevItem.link,
49+
title: prevItem.text // Add title for the button
50+
};
51+
}
52+
return null;
53+
});
54+
55+
const nextPage = computed(() => {
56+
if (currentIndex.value < sidebarItems.value.length - 1) {
57+
const nextItem = sidebarItems.value[currentIndex.value + 1];
58+
return {
59+
_path: nextItem.link,
60+
title: nextItem.text // Add title for the button
61+
};
62+
}
63+
return null;
64+
});
65+
</script>

components/layout/DocsFooter.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
<!-- Right: Back to Top Button -->
77
<LayoutBackToTop />
88
</div>
9-
<LayoutPrevNext />
9+
10+
<!-- <LayoutPrevNext /> -->
11+
<LayoutCustomPrevNext />
12+
1013
<div class="flex">
1114
<LayoutCarbonAds v-if="!isDesktop && carbonAdsEnabled" class="mx-auto" />
1215
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)