Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rewrite docs with VitePress #180

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
90ba66a
removed docus and added vitepress basic configuration
zoey-kaiser May 10, 2024
f96f09a
added gitignore and npmrc
zoey-kaiser May 10, 2024
7ac12da
updated gitignore
zoey-kaiser May 10, 2024
3739085
remove file to not track
zoey-kaiser May 10, 2024
4f4529d
began adding logic for custom landing page
zoey-kaiser May 10, 2024
55ae80d
reverted changes to home
zoey-kaiser May 10, 2024
a78b26a
added a TerminalComponent
zoey-kaiser May 10, 2024
4e48da5
remove unneeded files
zoey-kaiser May 23, 2024
dc304b4
added twoslash integration
zoey-kaiser May 23, 2024
ff72008
added basic vitepress landing page back
zoey-kaiser May 23, 2024
75e7a78
updated themeing
zoey-kaiser May 23, 2024
8cf814e
adjusted dark mode background
zoey-kaiser May 23, 2024
f0c9247
added new Icon + small style updates
zoey-kaiser May 23, 2024
1345d9c
finished landing page
zoey-kaiser May 23, 2024
7bb2db4
added links to docs of previous versions
zoey-kaiser May 23, 2024
37a0e97
began adding page layout
zoey-kaiser May 23, 2024
70de6ee
added all base pages and began working on outling nav and sidebar
zoey-kaiser May 23, 2024
fec7174
Delete .DS_Store
zoey-kaiser May 23, 2024
6651aaf
added simple readme
zoey-kaiser May 23, 2024
3707a46
added linter and formatter from antfu
zoey-kaiser May 23, 2024
0828a54
added CI to lint and type check
zoey-kaiser May 23, 2024
f7eec2b
merged main
zoey-kaiser May 23, 2024
caa247c
remove typecheck from CI
zoey-kaiser May 23, 2024
d9940ce
updated Readme a bit
zoey-kaiser May 23, 2024
108dc91
Finished writing getting started section
zoey-kaiser May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint-and-typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.6.1
uses: actions/setup-node@v4
with:
node-version: 20.6.1

- name: setup
run: npm i -g @antfu/ni

- name: install
run: nci

- name: lint
run: nr lint
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
## User-specific files
.DS_Store
.idea

## Vite Press related
.vitepress/cache
.vitepress/dist

node_modules
*.iml
.idea
*.log*
.nuxt
.vscode
.DS_Store
coverage
dist
sw.*
.env
.output
.output
34 changes: 34 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { defineConfig } from 'vitepress'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { routes as navRoutes } from './routes/navbar'
import { routes as sidebarRoutes } from './routes/sidebar'

export default defineConfig({
title: 'NuxtAuth',
titleTemplate: ':title - by sidebase',
description: 'The productive way to build fullstack Nuxt 3 applications.',
srcDir: 'src',
lang: 'en-US',
appearance: 'dark',
lastUpdated: true,
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
// @ts-expect-error The import types are broken?
markdown: { codeTransformers: [transformerTwoslash()] },
themeConfig: {
logo: '/icon.svg',
nav: navRoutes,
sidebar: sidebarRoutes,
socialLinks: [
{ icon: 'github', link: 'https://github.com/sidebase' },
{ icon: 'x', link: 'https://twitter.com/sidebase_io' },
{ icon: 'discord', link: 'https://discord.gg/VzABbVsqAc' },
],
footer: {
message: 'Released under the MIT License.',
copyright: 'Developed by SIDESTREAM',
},
search: {
provider: 'local',
},
},
})
52 changes: 52 additions & 0 deletions .vitepress/routes/navbar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { DefaultTheme } from 'vitepress'

export const routes: DefaultTheme.Config['nav'] = [
{
text: 'Docs',
items: [
{
text: 'Getting started',
link: '/guide/getting-started/introduction',
},
{
text: 'Guide',
link: '/guide/authjs/quick-start',
},
{
text: 'Recipes',
link: '/recipes/overview',
},
],
},
{ text: 'API', link: '/api/overview' },
{
text: 'Resources',
items: [
{
text: 'Overview',
link: '/resources/overview',
},
{
text: 'Security',
link: '/resources/security',
},
{
text: 'Error references',
link: '/resources/error-reference',
},
],
},
{
text: '0.8.0',
items: [
{
text: '0.7.2',
link: 'https://github.com/sidebase/nuxt-auth/tree/0.7.2/docs/content',
},
{
text: '0.6.7',
link: 'https://github.com/sidebase/nuxt-auth/tree/0.6.7/docs/content',
},
],
},
]
88 changes: 88 additions & 0 deletions .vitepress/routes/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import type { DefaultTheme } from 'vitepress'

export const routes: DefaultTheme.Config['sidebar'] = {
'/guide': [
{
text: 'Getting started',
base: '/guide/getting-started',
items: [
{
text: 'Introduction',
link: '/introduction',
},
{
text: 'Installation',
link: '/installation',
},
{
text: 'Choosing the provider',
link: '/choose-provider',
},
],
},
{
text: 'AuthJS Provider',
base: '/guide/authjs',
items: [
{
text: 'Quick Start',
link: '/quick-start',
},
{
text: 'NuxtAuthHandler',
link: '/nuxt-auth-handler',
},
{
text: 'Custom pages',
link: '/custom-pages',
},
{
text: 'Session data',
link: '/session-data',
},
],
},
{
text: 'Local / Refresh Provider',
base: '/guide/local',
items: [
{
text: 'Quick Start',
link: '/quick-start',
},
{
text: 'Session data',
link: '/session-data',
},
{
text: 'Refresh token',
link: '/refresh-token',
},
],
},
{
text: 'Advanced',
base: '/guide/advanced',
items: [
{
text: 'Middleware',
collapsed: true,
items: [
{ text: 'Global', link: '/middleware/global' },
{ text: 'Page', link: '/middleware/page' },
],
},
{
text: 'Deployment',
collapsed: true,
items: [
{ text: 'Self-hosted', link: '/deployment/self-hosted' },
{ text: 'Vercel', link: '/deployment/vercel' },
{ text: 'Netlify', link: '/deployment/netlify' },
],
},
{ text: 'Caching', link: '/caching' },
],
},
],
}
20 changes: 20 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { EnhanceAppContext, Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'

import './style.css'
import '@shikijs/vitepress-twoslash/style.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app }: EnhanceAppContext) {
app.use(TwoslashFloatingVue)
},
} satisfies Theme
Loading