-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
204 changed files
with
7,517 additions
and
500 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
typescript.includeWorkspace=true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,50 @@ | ||
<script setup lang="ts"> | ||
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation()) | ||
provide('navigation', navigation) | ||
// Head | ||
useServerHead({ | ||
link: [ | ||
{ rel: 'stylesheet', href: 'https://rsms.me/inter/inter.css' }, | ||
{ rel: 'icon', type: 'image/svg+xml', href: '/icon.svg' }, | ||
], | ||
htmlAttrs: { | ||
lang: 'en', | ||
}, | ||
bodyAttrs: { | ||
class: 'antialiased font-sans text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-900', | ||
}, | ||
}) | ||
useServerSeoMeta({ | ||
viewport: { | ||
width: 'device-width', | ||
initialScale: '1', | ||
maximumScale: '1', | ||
}, | ||
themeColor: [ | ||
{ content: '#18181b', media: '(prefers-color-scheme: dark)' }, | ||
{ content: 'white', media: '(prefers-color-scheme: light)' }, | ||
], | ||
ogImage: '/social-preview.jpg', | ||
twitterImage: '/social-preview.jpg', | ||
twitterCard: 'summary_large_image', | ||
}) | ||
</script> | ||
|
||
<template> | ||
<AppLayout> | ||
<SeoKit /> | ||
<OgImageScreenshot /> | ||
<NuxtPage /> | ||
</AppLayout> | ||
<div> | ||
<Header /> | ||
|
||
<UContainer> | ||
<NuxtPage /> | ||
</UContainer> | ||
|
||
<ClientOnly> | ||
<DocsSearch /> | ||
</ClientOnly> | ||
|
||
<UNotifications /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { RouterConfig } from '@nuxt/schema' | ||
|
||
function findHashPosition(hash): { el: any; behavior: ScrollBehavior; top: number } { | ||
const el = document.querySelector(hash) | ||
// vue-router does not incorporate scroll-margin-top on its own. | ||
if (el) { | ||
const top = Number.parseFloat(getComputedStyle(el).scrollMarginTop) | ||
|
||
return { | ||
el: hash, | ||
behavior: 'smooth', | ||
top, | ||
} | ||
} | ||
} | ||
|
||
// https://router.vuejs.org/api/#routeroptions | ||
export default <RouterConfig>{ | ||
scrollBehavior(to, from, savedPosition) { | ||
const nuxtApp = useNuxtApp() | ||
|
||
// If history back | ||
if (savedPosition) { | ||
// Handle Suspense resolution | ||
return new Promise((resolve) => { | ||
nuxtApp.hooks.hookOnce('page:finish', () => { | ||
setTimeout(() => resolve(savedPosition), 50) | ||
}) | ||
}) | ||
} | ||
|
||
// Scroll to heading on click | ||
if (to.hash) { | ||
return new Promise((resolve) => { | ||
if (to.path === from.path) { | ||
setTimeout(() => resolve(findHashPosition(to.hash)), 50) | ||
} | ||
else { | ||
nuxtApp.hooks.hookOnce('page:finish', () => { | ||
setTimeout(() => resolve(findHashPosition(to.hash)), 50) | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
// Scroll to top of window | ||
return { top: 0 } | ||
}, | ||
} |
Oops, something went wrong.