0f31e84635
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54 lines
2.7 KiB
JavaScript
54 lines
2.7 KiB
JavaScript
import { createRouter, createWebHistory, createMemoryHistory } from 'vue-router'
|
|
import SettingsView from './views/SettingsView.vue'
|
|
import GalleryView from './views/GalleryView.vue'
|
|
import ShowcaseView from './views/ShowcaseView.vue'
|
|
import TagsView from './views/TagsView.vue'
|
|
import ArtistView from './views/ArtistView.vue'
|
|
import SeriesManageView from './views/SeriesManageView.vue'
|
|
import SeriesReaderView from './views/SeriesReaderView.vue'
|
|
import SubscriptionsView from './views/SubscriptionsView.vue'
|
|
import CredentialsView from './views/CredentialsView.vue'
|
|
import DownloadsView from './views/DownloadsView.vue'
|
|
import PostsView from './views/PostsView.vue'
|
|
import ArtistsView from './views/ArtistsView.vue'
|
|
|
|
// The application's front door. `/` redirects here. Changing the front door
|
|
// is a one-line edit (e.g. '/gallery' or '/tags').
|
|
export const FRONT_DOOR = '/showcase'
|
|
|
|
const routes = [
|
|
// Root is a redirect only — no meta.title so it stays out of the nav.
|
|
{ path: '/', redirect: FRONT_DOOR },
|
|
|
|
// FC-2: image backbone
|
|
{ path: '/showcase', name: 'showcase', component: ShowcaseView, meta: { title: 'Showcase' } },
|
|
{ path: '/gallery', name: 'gallery', component: GalleryView, meta: { title: 'Gallery' } },
|
|
{ path: '/artists', name: 'artists', component: ArtistsView, meta: { title: 'Artists' } },
|
|
{ path: '/tags', name: 'tags', component: TagsView, meta: { title: 'Tags' } },
|
|
// Artist detail — no meta.title (reached by clicking an artist, not nav).
|
|
{ path: '/artist/:slug', name: 'artist', component: ArtistView },
|
|
// Series management — no meta.title (reached from a series tag card).
|
|
{ path: '/series/:tagId', name: 'series-manage', component: SeriesManageView },
|
|
// Series reader — immersive (no top nav, no meta.title).
|
|
{ path: '/series/:tagId/read', name: 'series-read', component: SeriesReaderView, meta: { immersive: true } },
|
|
{ path: '/settings', name: 'settings', component: SettingsView, meta: { title: 'Settings' } },
|
|
|
|
// FC-3: subscription backbone
|
|
{ path: '/posts', name: 'posts', component: PostsView, meta: { title: 'Posts' } },
|
|
{ path: '/subscriptions', name: 'subscriptions', component: SubscriptionsView, meta: { title: 'Subscriptions' } },
|
|
{ path: '/credentials', name: 'credentials', component: CredentialsView, meta: { title: 'Credentials' } },
|
|
{ path: '/downloads', name: 'downloads', component: DownloadsView, meta: { title: 'Downloads' } }
|
|
]
|
|
|
|
// Browser uses HTML5 history; non-browser (Vitest/SSR) falls back to memory
|
|
// history so the module is importable without `window`.
|
|
const history =
|
|
typeof window !== 'undefined' ? createWebHistory() : createMemoryHistory()
|
|
|
|
const router = createRouter({
|
|
history,
|
|
routes
|
|
})
|
|
|
|
export default router
|