Files
yourpart3/frontend/src/router/blogRoutes.js

59 lines
2.0 KiB
JavaScript

const BlogListView = () => import('@/views/blog/BlogListView.vue');
const BlogView = () => import('@/views/blog/BlogView.vue');
const BlogEditorView = () => import('@/views/blog/BlogEditorView.vue');
import { buildAbsoluteUrl } from '@/utils/seo.js';
export default [
{ path: '/blogs/create', name: 'BlogCreate', component: BlogEditorView, meta: { requiresAuth: true } },
{ path: '/blogs/:id/edit', name: 'BlogEdit', component: BlogEditorView, props: true, meta: { requiresAuth: true } },
// Slug-only route first so it doesn't get captured by the :id route
{
path: '/blogs/:slug',
name: 'BlogSlug',
component: BlogView,
props: route => ({ slug: route.params.slug }),
meta: {
seo: {
title: 'Blogs auf YourPart',
description: 'Öffentliche Blogs, Beiträge und Community-Inhalte auf YourPart.',
},
},
},
// Id-constrained route (numeric id only) with optional slug for canonical links
{
path: '/blogs/:id(\\d+)/:slug?',
name: 'Blog',
component: BlogView,
props: true,
meta: {
seo: {
title: 'Blogs auf YourPart',
description: 'Öffentliche Blogs, Beiträge und Community-Inhalte auf YourPart.',
},
},
},
{
path: '/blogs',
name: 'BlogList',
component: BlogListView,
meta: {
seo: {
title: 'Blogs auf YourPart - Community-Beiträge und Themen',
description: 'Entdecke öffentliche Blogs auf YourPart mit Community-Beiträgen, Gedanken, Erfahrungen und Themen aus verschiedenen Bereichen.',
keywords: 'Blogs, Community Blog, Artikel, Beiträge, YourPart',
canonicalPath: '/blogs',
jsonLd: [
{
'@context': 'https://schema.org',
'@type': 'CollectionPage',
name: 'Blogs auf YourPart',
url: buildAbsoluteUrl('/blogs'),
description: 'Öffentliche Blogs und Community-Beiträge auf YourPart.',
inLanguage: 'de',
},
],
},
},
},
];