Skip to content

Commit

Permalink
feat: simple page
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jul 23, 2024
1 parent 480ac0d commit d0ed965
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 42 deletions.
50 changes: 24 additions & 26 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,30 @@ export default defineConfig({
{ text: 'API', link: '/api/', activeMatch: '/api/' },
{ text: '审查工具', link: 'https://i.gkd.li' },
],
sidebar: [
{
text: '指引',
items: [
{ text: '什么是 GKD?', link: '/guide/what-is-gkd' },
{ text: '开始使用', link: '/guide/' },
{ text: '快照审查', link: '/guide/snapshot' },
{ text: '订阅规则', link: '/guide/subscription' },
{ text: '疑难解答', link: '/guide/faq' },
],
},
{
text: '选择器',
items: [
{ text: '语法介绍', link: '/selector/' },
{ text: '属性方法', link: '/selector/node' },
{ text: '选择示例', link: '/selector/example' },
{ text: '查询优化', link: '/selector/optimize' },
],
},
{
text: 'API',
link: '/api/',
items: typedocSidebar,
},
],
sidebar: {
'/guide/': [
{
text: '指引',
items: [
{ text: '什么是 GKD?', link: '/guide/what-is-gkd' },
{ text: '开始使用', link: '/guide/' },
{ text: '快照审查', link: '/guide/snapshot' },
{ text: '订阅规则', link: '/guide/subscription' },
{ text: '疑难解答', link: '/guide/faq' },
],
},
{
text: '选择器',
items: [
{ text: '语法介绍', link: '/guide/selector' },
{ text: '属性方法', link: '/guide/node' },
{ text: '选择示例', link: '/guide/example' },
{ text: '查询优化', link: '/guide/optimize' },
],
},
],
'/api/': typedocSidebar.map((v) => ({ ...v, collapsed: undefined })),
},
editLink: {
pattern: 'https://github.com/gkd-kit/docs/edit/main/docs/:path',
text: '为此页提供修改建议',
Expand Down
9 changes: 9 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import DefaultTheme from 'vitepress/theme';
import components from '../components';
import './custom.css';

// Redirect /selector/* to /guide/*
if (!import.meta.env.SSR && location.pathname.startsWith('/selector/')) {
if (location.pathname.at(-1) === '/') {
location.pathname = '/guide/selector';
} else {
location.pathname = location.pathname.replace('/selector/', '/guide/');
}
}

export default {
extends: DefaultTheme,
enhanceApp({ app }) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 0 additions & 16 deletions docs/snapshot/index.md

This file was deleted.

0 comments on commit d0ed965

Please sign in to comment.