Migrate the Nuxt 3 + Vue 3 SSR frontend application for basicstack.org to our self-hosted Forgejo instance. This repository will serve as the source for all future development and deployment of the basicstack.org website. The application includes: - Nuxt 3 + Vue 3 SSR setup - Directus CMS integration - Tailwind CSS styling - Kubernetes deployment manifests - Docker containerization Co-Authored-By: Paperclip <noreply@paperclip.ing>
58 lines
1 KiB
Vue
58 lines
1 KiB
Vue
<template>
|
|
<nav class="navigation" v-if="navigation">
|
|
<NuxtLink
|
|
v-for="item in navigation"
|
|
:key="item.id"
|
|
:to="getNavLink(item)"
|
|
class="nav-link"
|
|
>
|
|
{{ item.label }}
|
|
</NuxtLink>
|
|
</nav>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const { getNavigation } = useDirectus()
|
|
|
|
const { data: navigation } = await useAsyncData('navigation', () => getNavigation())
|
|
|
|
function getNavLink(item: any) {
|
|
if (item.type === 'custom' && item.custom_route) {
|
|
return item.custom_route
|
|
}
|
|
if (item.type === 'external' && item.external_url) {
|
|
return item.external_url
|
|
}
|
|
if (item.type === 'page' && item.page_id) {
|
|
return `/${item.page_id}`
|
|
}
|
|
return '/'
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.navigation {
|
|
display: flex;
|
|
gap: 2rem;
|
|
align-items: center;
|
|
}
|
|
|
|
.nav-link {
|
|
color: #4b5563;
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
transition: color 0.2s;
|
|
}
|
|
|
|
.nav-link:hover,
|
|
.nav-link.router-link-active {
|
|
color: #3b82f6;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.navigation {
|
|
flex-direction: column;
|
|
gap: 1rem;
|
|
}
|
|
}
|
|
</style>
|