File tree Expand file tree Collapse file tree 5 files changed +66
-4
lines changed
Expand file tree Collapse file tree 5 files changed +66
-4
lines changed Original file line number Diff line number Diff line change 1+ <!--
2+ ~ Copyright 2023 Exactpro (Exactpro Systems Limited)
3+ ~
4+ ~ Licensed under the Apache License, Version 2.0 (the "License");
5+ ~ you may not use this file except in compliance with the License.
6+ ~ You may obtain a copy of the License at
7+ ~
8+ ~ http://www.apache.org/licenses/LICENSE-2.0
9+ ~
10+ ~ Unless required by applicable law or agreed to in writing, software
11+ ~ distributed under the License is distributed on an "AS IS" BASIS,
12+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ ~ See the License for the specific language governing permissions and
14+ ~ limitations under the License.
15+ -->
16+
17+ <script setup lang="ts">
18+ import { withTrailingSlash } from ' ../../utils/navigation'
19+
20+ defineProps ({
21+ href: {
22+ type: String ,
23+ default: ' '
24+ },
25+ target: {
26+ type: String ,
27+ default: undefined ,
28+ required: false
29+ }
30+ })
31+ </script >
32+
33+ <template >
34+ <NuxtLink :href =" withTrailingSlash(href)" :target =" target" >
35+ <slot />
36+ </NuxtLink >
37+ </template >
Original file line number Diff line number Diff line change 3232 @click =" showChildren = !showChildren"
3333 />
3434 <NuxtLink
35- :to =" navItem._path"
35+ :to =" withTrailingSlash( navItem._path) "
3636 class =" w-full"
3737 @click =" showContentTree = false"
3838 >
5555<script lang="ts">
5656import { defineComponent } from ' vue'
5757import { NavItem } from ' @nuxt/content/dist/runtime/types'
58+ import { withTrailingSlash } from ' ../../../utils/navigation'
5859
5960export default defineComponent ({
6061 name: ' ContentNavigationItem' ,
@@ -71,7 +72,8 @@ export default defineComponent({
7172 setup() {
7273 return {
7374 showChildren: ref (false ),
74- showContentTree: useShowContentTree ()
75+ showContentTree: useShowContentTree (),
76+ withTrailingSlash
7577 }
7678 },
7779 computed: {
Original file line number Diff line number Diff line change 1616
1717<script lang="ts">
1818import { ParsedContent } from ' @nuxt/content/dist/runtime/types'
19+ import { withTrailingSlash } from ' ../../../utils/navigation'
1920export default {
2021 name: ' EpLayoutSurroundDocCard'
2122}
@@ -30,7 +31,7 @@ defineProps<{
3031
3132<template >
3233 <NuxtLink
33- :to =" doc._path"
34+ :to =" withTrailingSlash( doc._path ?? '') "
3435 class =" block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700"
3536 >
3637 <div >
Original file line number Diff line number Diff line change 1616
1717import { SitemapStream , streamToPromise } from 'sitemap'
1818import { joinURL , parseURL , withProtocol } from 'ufo'
19+ import { withTrailingSlash } from '../../utils/navigation'
1920import { serverQueryContent } from '#content/server'
2021const appConfig = useAppConfig ( )
2122
@@ -38,7 +39,7 @@ export default defineEventHandler(async (event) => {
3839 continue
3940 }
4041 sitemap . write ( {
41- url : joinURL ( path . pathname , doc . _path ) ,
42+ url : withTrailingSlash ( joinURL ( path . pathname , doc . _path ) ) ,
4243 changefreq : 'monthly'
4344 } )
4445 }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 Exactpro (Exactpro Systems Limited)
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ import { withTrailingSlash as ufoWithTrailingSlash } from 'ufo'
18+
19+ export function withTrailingSlash ( str : string ) : string {
20+ return ufoWithTrailingSlash ( str )
21+ }
You can’t perform that action at this time.
0 commit comments