Skip to content

Commit b8d2f5d

Browse files
authored
chore: improve meta tags, add sitemap and fix disappearing components (#188)
1 parent f4e0d11 commit b8d2f5d

29 files changed

+252
-78
lines changed

.vitepress/config.mts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'vitepress'
22
import { routes as navRoutes } from './routes/navbar'
33
import { routes as sidebarRoutes } from './routes/sidebar'
4+
import { headConfig, sitemapConfig } from './head'
45

56
// https://vitepress.dev/reference/site-config
67
export default defineConfig({
@@ -13,7 +14,8 @@ export default defineConfig({
1314
lang: 'en-US',
1415
appearance: 'dark',
1516
lastUpdated: true,
16-
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
17+
sitemap: sitemapConfig,
18+
head: headConfig,
1719
themeConfig: {
1820
logo: {
1921
light: '/logo-light.svg',

.vitepress/head.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { HeadConfig } from 'vitepress'
2+
3+
const HOST_NAME = 'https://sidebase.io'
4+
const OG_IMAGE_URL = `${HOST_NAME}/sidebase-og.jpg`
5+
6+
export const sitemapConfig = {
7+
hostname: HOST_NAME
8+
}
9+
10+
export const headConfig: HeadConfig[] = [
11+
['link', { rel: 'icon', href: '/favicon.ico' }],
12+
['meta', { name: 'theme-color', content: '#30A36C' }],
13+
['meta', { property: 'og:title', content: 'sidebase - by SIDESTREAM' }],
14+
['meta', { property: 'og:description', content: 'The web app development kit to build production fullstack Nuxt 3 apps quickly.' }],
15+
['meta', { property: 'og:site_name', content: 'sidebase' }],
16+
['meta', { property: 'og:type', content: 'website' }],
17+
['meta', { property: 'og:locale', content: 'en' }],
18+
['meta', { property: 'og:image', content: OG_IMAGE_URL }],
19+
['meta', { property: 'og:url', content: HOST_NAME }],
20+
]

.vitepress/theme/Layout.vue

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script setup>
2+
import DefaultTheme from 'vitepress/theme'
3+
4+
import Banner from './components/Banner.vue'
5+
import Terminal from './components/Terminal/Terminal.vue'
6+
import SpinningGradient from './components/SpinningGradient.vue'
7+
// import GithubStarsButton from './components/GithubStarsButton.vue'
8+
9+
const { Layout } = DefaultTheme
10+
11+
// Banner Configuration
12+
const isBannerEnabled = true
13+
const bannerConfig = {
14+
// Leave text empty to disable the banner
15+
text: '✨ NuxtAuth v0.8.0 has been released! ✨',
16+
button: {
17+
href: 'https://github.com/sidebase/nuxt-auth/releases/tag/0.8.0',
18+
text: 'View release notes'
19+
}
20+
}
21+
</script>
22+
23+
<template>
24+
<Layout>
25+
<!--
26+
<template #nav-bar-content-after>
27+
<GithubStarsButton owner="sidebase" repo="sidebase" />
28+
</template>
29+
-->
30+
31+
<template #home-hero-image>
32+
<Terminal />
33+
</template>
34+
35+
<template #home-hero-before>
36+
<Banner v-if="isBannerEnabled" v-bind="bannerConfig" />
37+
<SpinningGradient />
38+
</template>
39+
</Layout>
40+
</template>
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<script lang="ts" setup>
2+
import { VPButton } from 'vitepress/theme'
3+
4+
defineProps<{
5+
text?: string
6+
button?: {
7+
href: string
8+
text: string
9+
}
10+
}>()
11+
</script>
12+
13+
<template>
14+
<div v-if="text" class="Banner">
15+
{{ text }}
16+
<VPButton
17+
v-if="button"
18+
class="small"
19+
theme="brand"
20+
:text="button.text"
21+
:href="button.href"
22+
/>
23+
</div>
24+
</template>
25+
26+
<style scoped>
27+
.VPButton.small {
28+
border-radius: 10px;
29+
padding: 0 10px;
30+
line-height: 26px;
31+
}
32+
33+
.Banner {
34+
display: flex;
35+
align-items: center;
36+
gap: 10px;
37+
justify-content: center;
38+
padding: 12px;
39+
40+
background-color: #F6F6F7;
41+
}
42+
43+
.dark .Banner {
44+
background-color: #202127;
45+
}
46+
47+
@media only screen and (max-width: 800px) {
48+
.Banner {
49+
display: none;
50+
}
51+
}
52+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<script lang="ts" setup>
2+
import { onMounted, ref } from 'vue'
3+
import StarIcon from './StarIcon.vue'
4+
5+
const props = defineProps<{
6+
owner: string
7+
repo: string
8+
}>()
9+
10+
const count = ref(0)
11+
12+
async function fetchCount() {
13+
const res = await fetch(`https://api.github.com/repos/${props.owner}/${props.repo}`)
14+
const resJson = await res.json()
15+
count.value = resJson.stargazers_count ?? 0
16+
}
17+
onMounted(fetchCount)
18+
</script>
19+
20+
<template>
21+
<div class="Wrapper">
22+
<a
23+
title="Github"
24+
class="Button"
25+
:href="`https://github.com/${owner}/${repo}`"
26+
target="_blank"
27+
rel="noreferrer noopener"
28+
>
29+
<StarIcon />
30+
Star
31+
</a>
32+
<a
33+
class="Count"
34+
:href="`https://github.com/${owner}/${repo}/stargazers`"
35+
aria-label="{label}"
36+
target="_blank"
37+
rel="noreferrer noopener"
38+
>
39+
{{ new Intl.NumberFormat().format(count) }}
40+
</a>
41+
</div>
42+
</template>
43+
44+
<style scoped>
45+
.Wrapper {
46+
margin-left: 14px;
47+
display: block;
48+
}
49+
50+
@media only screen and (max-width: 800px) {
51+
.Wrapper {
52+
display: none;
53+
}
54+
}
55+
56+
.Button {
57+
display: flex;
58+
align-items: center;
59+
gap: 5px;
60+
61+
padding: 3px 10px;
62+
border-radius: 8px;
63+
border-bottom-right-radius: 0;
64+
border-top-right-radius: 0;
65+
float: left;
66+
cursor: pointer;
67+
position: relative;
68+
user-select: none;
69+
vertical-align: middle;
70+
white-space: nowrap;
71+
text-decoration: none;
72+
73+
font-size: 13px;
74+
font-weight: 600;
75+
line-height: 20px;
76+
77+
background-color: #FAFBFC;
78+
border: 1px solid rgba(27, 31, 35, 0.2);
79+
border-right: 0px;
80+
color: inherit;
81+
}
82+
83+
.Count {
84+
border-bottom-right-radius: 8px;
85+
border-left: 0;
86+
border-top-right-radius: 8px;
87+
float: left;
88+
padding: 3px 10px;
89+
vertical-align: middle;
90+
91+
font-size: 13px;
92+
font-weight: 600;
93+
line-height: 20px;
94+
text-decoration: none;
95+
96+
background-color: #fff;
97+
border: 1px solid rgba(27, 31, 35, 0.2);
98+
}
99+
100+
.dark .Button {
101+
border: 1px solid #4d4d4f;
102+
background-color: #4d4d4f;
103+
}
104+
105+
.dark .Count {
106+
background-color: #65666A;
107+
}
108+
</style>
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16">
3+
<path fill="currentColor" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815l4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97l.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25" />
4+
</svg>
5+
</template>

.vitepress/theme/index.ts

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
// https://vitepress.dev/guide/custom-theme
2-
import { h } from 'vue'
32
import type { Theme } from 'vitepress'
43
import DefaultTheme from 'vitepress/theme'
4+
import Layout from './Layout.vue'
55

6+
// Styles
67
import './style.css'
78

8-
import Terminal from './components/Terminal/Terminal.vue'
9-
import SpinningGradient from './components/SpinningGradient.vue'
10-
11-
export default {
12-
extends: DefaultTheme,
13-
Layout: () => {
14-
return h(DefaultTheme.Layout, null, {
15-
// See all available slots: https://vitepress.dev/guide/extending-default-theme#layout-slots
16-
'home-hero-image': h(Terminal),
17-
'home-hero-before': h(SpinningGradient)
18-
})
19-
},
20-
} satisfies Theme
9+
export default { extends: DefaultTheme, Layout } satisfies Theme

src/nuxt-auth/application-side/custom-sign-in-page.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/authjs/custom-pages"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/authjs/custom-pages'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/application-side/guest-mode.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/application-side/protecting-pages#guest-mode"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/application-side/protecting-pages#guest-mode'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/application-side/index.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/application-side/session-access"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/application-side/session-access'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/application-side/protecting-pages.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/application-side/protecting-pages"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/application-side/protecting-pages'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/application-side/session-access-and-managment.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/application-side/session-access"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/application-side/session-access'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/configuration/index.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/application-side/configuration"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/application-side/configuration'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/configuration/nuxt-auth-handler.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/authjs/nuxt-auth-handler"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/authjs/nuxt-auth-handler'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/configuration/nuxt-config.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/application-side/configuration"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/application-side/configuration'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/configuration/route-config.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/advanced/caching"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/advanced/caching'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/configuration/session-config.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/authjs/session-data"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/authjs/session-data'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

src/nuxt-auth/getting-started/caching-content.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<script setup>
7-
window.location.href = "https://auth.sidebase.io/guide/advanced/caching"
8-
</script>
6+
<meta http-equiv="refresh" content="0;URL='https://auth.sidebase.io/guide/advanced/caching'" />
97

108
<h1 class="text-center">
119
Redirecting.. Please wait.

0 commit comments

Comments
 (0)