Skip to content

Commit

Permalink
chore: use trailing slash for routes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 14, 2024
1 parent e722d40 commit 99fab28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</template>

<script lang="ts" setup>
import { joinURL } from 'ufo'
import { joinURL, withTrailingSlash } from 'ufo'
const route = useRoute()
Expand Down Expand Up @@ -52,7 +52,7 @@ if (import.meta.server) {
)
const { path = '/' } = route.fullPath.match(PATH_RE)?.groups ?? {}
const url = `https://roe.dev${path}`
const url = withTrailingSlash(`https://roe.dev${path}`)
useServerHead({
meta: () => [
Expand Down
5 changes: 4 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export default defineNuxtConfig({
experimental: {
buildCache: false,
defaults: {
nuxtLink: {
trailingSlash: 'append',
},
useAsyncData: {
deep: false,
},
Expand All @@ -161,7 +164,7 @@ export default defineNuxtConfig({
future: { nativeSWR: true },
prerender: {
crawlLinks: true,
routes: ['/', '/rss.xml', '/voted', '/work', '/feedback', '/ama', '/ai'],
routes: ['/', '/rss.xml', '/voted/', '/work/', '/feedback/', '/ama/', '/ai/'],
},
hooks: {
'prerender:generate' (route) {
Expand Down

0 comments on commit 99fab28

Please sign in to comment.