Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
FroudeDescartes committed Nov 28, 2024
2 parents e852a02 + dbbb374 commit a60b81b
Show file tree
Hide file tree
Showing 30 changed files with 45 additions and 14 deletions.
16 changes: 10 additions & 6 deletions components/app/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@ const { data: navigation } = await useAsyncData("navigation", () =>
fetchContentNavigation(),
);
const topLinks = navigation.value.reduce((previous, current) => {
if (current.children) {
previous.push(current);
}
return previous;
}, []);
const topLinks = computed(() =>
navigation.value.reduce((previous, current) => {
// Exclude the /guidelines path
if (current.children && !current._path.includes('/guidelines')) {
previous.push(current);
}
return previous;
}, [] as typeof navigation.value),
);
const header = useAppConfig().header;
const route = useRoute();
Expand Down
9 changes: 9 additions & 0 deletions components/content/sh-guidelines.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
{{ guidelines }}
</template>

<script setup>
const guidelines = await useAsyncData('guidelines', () => queryContent('/_8.guidelines').where({ _partial: true }).findOne())
</script>
4 changes: 2 additions & 2 deletions components/content/sh-img-container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<img :src="urlImage" :alt="altImage" :class="ui.image">
</figure>
</div>
<figcaption :class="ui.figcaption">
<div :class="ui.figcaption">
<MDC :value="figcaption" />
</figcaption>
</div>
</div>
</template>

Expand Down
24 changes: 21 additions & 3 deletions components/prev-next-page.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<hr class="border-2 dark:border-golden rounded-r-xl rounded-l-xl" />
<div class="grid grid-cols-2 mt-10 mx-auto max-w-max min-w-full not-prose">
<NuxtLink v-if="prev" :to="prev._path" :class="['justify-start text-left items-start lg:mr-20 sm:mr-5', ui.button]">
<NuxtLink v-if="prev && prev._path !=='/'" :to="prev._path" :class="['col-start-1 justify-start text-left items-start lg:mr-20 sm:mr-5', ui.button]">
<UIcon name="i-vaadin:chevron-circle-left-o" dynamic :class="ui.icon" />
<div :class="ui.title">{{ prev.title }}</div>
<div v-if="showDescription && prev.description" :class="['text-left', ui.description]">{{ prev.description }}
</div>
</NuxtLink>
<NuxtLink v-if="next" :to="next._path" :class="['justify-end text-right items-end lg:ml-20 sm:ml-5', ui.button]">
<NuxtLink v-if="next && next._path !=='/'" :to="next._path" :class="['col-start-2 justify-end text-right items-end lg:ml-20 sm:ml-5', ui.button]">
<UIcon name="i-vaadin:chevron-circle-right-o" dynamic :class="ui.icon" />
<div :class="ui.title">{{ next.title }}</div>
<div v-if="showDescription && next.description" :class="['text-right', ui.description]">{{ next.description }}
Expand All @@ -17,9 +17,27 @@
</template>

<script setup lang="ts">
const route = useRoute();
const excludedPaths = [
"/announcement",
"/landing-page-floaters",
"/landing-page-menu",
"/test-guide",
"/guidelines/index"
];
const excludedDirectoryRegex = /^\/guidelines(\/|$)/;
// Adjust the query to exclude specific paths
const [prev, next] = await queryContent()
.where({ _path: { $not: /\/_dir$/ }, _partial: false })
.where({
_path: { $not: /\/_dir$/ }, // Exclude _dir directories
_partial: false, // Exclude partial content (this could be used instead of the _dir exlusion above)
$and: [
{ _path: { $not: { $in: excludedPaths } } }, // Exclude specific files
{ _path: { $not: excludedDirectoryRegex } }, // Exclude specific diectorie; -> think about adding all of this to app.config.ts
]
})
.findSurround(route.path);
const config = {
Expand Down
2 changes: 1 addition & 1 deletion content/announcement.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
visible: true # When set to true, makes Announcement banner visible
visible: false # When set to true, makes Announcement banner visible
---

::ShTwoColumns
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This section is constructed out of two sub-sections:
- [Looks&Feel](/_8.guidelines/looks-feel/)
- [Components](/_8.guidelines/components/)

List of components:
<!-- List of components:
- [sh-action-card](/_8.guidelines/components/sh-action-card)
- [sh-alert](/_8.guidelines/components/sh-alert)
Expand All @@ -33,4 +33,4 @@ List of components:
- [sh-social](/_8.guidelines/components/sh-social)
- [sh-text-img](/_8.guidelines/components/sh-text-img)
- [sh-two-columns](/_8.guidelines/components/sh-two-columns)
- [sh-video](/_8.guidelines/components/sh-video)
- [sh-video](/_8.guidelines/components/sh-video) -->

0 comments on commit a60b81b

Please sign in to comment.