Skip to content

Commit eeb26c5

Browse files
committed
Remove trailing slash, setup redirects, and cleanup
1 parent 536d506 commit eeb26c5

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

usehooks.com/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import sitemap from "@astrojs/sitemap";
1313
// https://astro.build/config
1414
export default defineConfig({
1515
site: "https://usehooks.com",
16+
trailingSlash: "never",
1617
integrations: [react(), tailwind(), mdx(), sitemap()],
1718
output: "static",
1819
// adapter: vercel(),

usehooks.com/src/components/search/HookCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function HookCard({
99
}) {
1010
return (
1111
<li className={styles.hook}>
12-
<a href={`/${name.toLowerCase()}/`}>
12+
<a href={`/${name.toLowerCase()}`}>
1313
<h3 className={styles["card-title"]}>{name}</h3>
1414
<p className={styles["card-description"]}>{tagline}</p>
1515
<svg

usehooks.com/src/sections/HomeHero.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ const hooksMarquee2 = (await getCollection('hooks')).slice(25,50);
1414
<ul class="marquee-content">
1515
{hooksMarquee1.map(hook => (
1616
<li>
17-
<a href={`/${hook.slug}/`} tabindex="-1">{hook.data.name}</a>
17+
<a href={`/${hook.slug}`} tabindex="-1">{hook.data.name}</a>
1818
</li>
1919
))}
2020
</ul>
2121
<ul class="marquee-content">
2222
{hooksMarquee1.map(hook => (
2323
<li>
24-
<a href={`/${hook.slug}/`} tabindex="-1">{hook.data.name}</a>
24+
<a href={`/${hook.slug}`} tabindex="-1">{hook.data.name}</a>
2525
</li>
2626
))}
2727
</ul>
@@ -30,14 +30,14 @@ const hooksMarquee2 = (await getCollection('hooks')).slice(25,50);
3030
<ul class="marquee-content">
3131
{hooksMarquee2.map(hook => (
3232
<li>
33-
<a href={`/${hook.slug}/`} tabindex="-1">{hook.data.name}</a>
33+
<a href={`/${hook.slug}`} tabindex="-1">{hook.data.name}</a>
3434
</li>
3535
))}
3636
</ul>
3737
<ul class="marquee-content">
3838
{hooksMarquee2.map(hook => (
3939
<li>
40-
<a href={`/${hook.slug}/`} tabindex="-1">{hook.data.name}</a>
40+
<a href={`/${hook.slug}`} tabindex="-1">{hook.data.name}</a>
4141
</li>
4242
))}
4343
</ul>

usehooks.com/vercel.json

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"trailingSlash": false,
23
"rewrites": [
34
{
45
"source": "/stats/js/script.js",
@@ -16,7 +17,7 @@
1617
},
1718
{
1819
"source": "/useOnScreen",
19-
"destination": "/usetntersectionobserver"
20+
"destination": "/useintersectionobserver"
2021
},
2122
{
2223
"source": "/useWhyDidYouUpdate",
@@ -46,10 +47,6 @@
4647
"source": "/useLockBodyScroll",
4748
"destination": "/uselockbodyscroll"
4849
},
49-
{
50-
"source": "/useThrottle",
51-
"destination": "/usethrottle"
52-
},
5350
{
5451
"source": "/useToggle",
5552
"destination": "/usetoggle"
@@ -122,17 +119,9 @@
122119
"source": "/useDarkMode",
123120
"destination": "/"
124121
},
125-
{
126-
"source": "/useRouter",
127-
"destination": "/"
128-
},
129122
{
130123
"source": "/useAsync",
131124
"destination": "/"
132125
},
133-
{
134-
"source": "/useAuth",
135-
"destination": "/"
136-
}
137126
]
138127
}

0 commit comments

Comments
 (0)