Skip to content

Commit

Permalink
refactor: re-organize
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 12, 2024
1 parent 0785d9d commit daddf22
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 21 deletions.
30 changes: 14 additions & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ import type { RouteRecordRaw } from 'vue-router'
import '@unocss/reset/tailwind.css'
import 'uno.css'
import 'github-markdown-css'
import './style.css'
import './styles/global.css'

const routes: RouteRecordRaw[] = [
{
name: 'Index',
path: '/',
component: () => import('./components/index.vue'),
component: () => import('./views/index.vue'),
},
{
name: 'Sponsors',
path: '/sponsors',
component: () => import('./views/sponsors.vue'),
},
{
name: 'NotFound',
path: '/:pathMatch(.*)*',
component: () => import('./components/not-found.vue'),
component: () => import('./views/not-found.vue'),
},
{
name: 'NotFoundSSG',
path: '/404',
component: () => import('./components/not-found.vue'),
},
{
name: 'Sponsors',
path: '/sponsors',
component: () => import('./components/sponsors.vue'),
component: () => import('./views/not-found.vue'),
},
]

Expand All @@ -41,19 +41,17 @@ for (const { id } of getAllEpisode()) {
name: `Episode${id}`,
path: `/episode/${id}`,
component: () =>
import('./components/episode-content.vue').then(
({ default: EpisodeContent }) => {
return h(EpisodeContent, { id })
},
),
import('./views/episode.vue').then(({ default: EpisodeContent }) => {
return h(EpisodeContent, { id })
}),
})
}
for (const { github } of getAllContributors()) {
routes.push({
name: `Contributor${github}`,
path: `/contributor/${github}`,
component: () =>
import('./components/contributor-content.vue').then(
import('./views/contributor.vue').then(
({ default: ContributorContent }) => {
return h(ContributorContent, { github })
},
Expand All @@ -77,5 +75,5 @@ export const createApp = ViteSSG(App, {

if (isClient && !detectFont()('PingFang SC')) {
// improve font on Windows
import('./style-font.css')
import('./styles/font.css')
}
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/typings/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ declare module 'vue' {
AppHeader: typeof import('./../components/app-header.vue')['default']
AppNavbar: typeof import('./../components/app-navbar.vue')['default']
Badge: typeof import('./../components/badge.vue')['default']
Components: typeof import('./../components/index.vue')['default']
ContributorContent: typeof import('./../components/contributor-content.vue')['default']
EpisodeContent: typeof import('./../components/episode-content.vue')['default']
Components: typeof import('../views/index.vue')['default']
ContributorContent: typeof import('../views/contributor.vue')['default']
EpisodeContent: typeof import('../views/episode.vue')['default']
EpisodeItem: typeof import('./../components/episode-item.vue')['default']
EpisodeMeta: typeof import('./../components/episode-meta.vue')['default']
NavHamburger: typeof import('./../components/navbar/nav-hamburger.vue')['default']
NavMenu: typeof import('./../components/navbar/nav-menu.vue')['default']
NavSearch: typeof import('./../components/navbar/nav-search.vue')['default']
NotFound: typeof import('./../components/not-found.vue')['default']
NotFound: typeof import('../views/not-found.vue')['default']
Person: typeof import('./../components/person.vue')['default']
PersonList: typeof import('./../components/person-list.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Sponsors: typeof import('./../components/sponsors.vue')['default']
Sponsors: typeof import('../views/sponsors.vue')['default']
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit daddf22

Please sign in to comment.