Skip to content

Commit df97b54

Browse files
feat: add blog sidebar
1 parent 2deaa30 commit df97b54

File tree

6 files changed

+141
-137
lines changed

6 files changed

+141
-137
lines changed

website/.vitepress/config.ts

Lines changed: 137 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ gtag('js', new Date());
77
gtag('config', 'G-EZSJ3YF2RG');
88
`
99

10-
const monacoPrefix = 'monaco-editor/esm/vs'
11-
1210
export default defineConfig({
1311
lang: 'en-US',
1412
title: 'ast-grep',
@@ -62,132 +60,143 @@ export default defineConfig({
6260
editLink: {
6361
pattern: 'https://github.com/ast-grep/ast-grep.github.io/edit/main/website/:path'
6462
},
65-
sidebar: [
66-
{
67-
text: 'Guide',
68-
link: '/guide/introduction.html',
69-
items: [
70-
{ text: 'Quick Start', link: '/guide/quick-start.html' },
71-
{ text: 'Pattern Syntax', link: '/guide/pattern-syntax.html' },
72-
{ text: 'Rule Essentials', link: '/guide/rule-config.html', collapsed: true,
73-
items:[
74-
{ text: 'Atomic Rule', link: '/guide/rule-config/atomic-rule.html' },
75-
{ text: 'Relational Rule', link: '/guide/rule-config/relational-rule.html' },
76-
{ text: 'Composite Rule', link: '/guide/rule-config/composite-rule.html' },
77-
{ text: 'Utility Rule', link: '/guide/rule-config/utility-rule.html' },
78-
],},
79-
{
80-
text: 'Project Setup', collapsed: true, link: '/guide/scan-project.html',
81-
items: [
82-
{ text: 'Project Configuration', link: '/guide/project/project-config.html' },
83-
{ text: 'Lint Rule', link: '/guide/project/lint-rule.html' },
84-
{ text: 'Test Your Rule', link: '/guide/test-rule.html' },
85-
],
86-
},
87-
{ text: 'Rewrite Code', link: '/guide/rewrite-code.html', collapsed: true,
88-
items: [
89-
{ text: 'Transform Code', link: '/guide/rewrite/transform.html' },
90-
{ text: 'Rewriter Rule', link: '/guide/rewrite/rewriter.html' },
91-
],
92-
},
93-
{
94-
text: 'Tooling Overview', link: '/guide/tooling-overview.html', collapsed: true,
95-
items: [
96-
{ text: 'Editor Integration', link: '/guide/tools/editors.html' },
97-
{ text: 'JSON mode', link: '/guide/tools/json.html' },
98-
],
99-
},
100-
{ text: 'API Usage', link: '/guide/api-usage.html', collapsed: true,
101-
items:[
102-
{ text: 'JavaScript API', link: '/guide/api-usage/js-api.html' },
103-
{ text: 'Python API', link: '/guide/api-usage/py-api.html' },
104-
{ text: 'Performance Tip', link: '/guide/api-usage/performance-tip.html' },
105-
]},
106-
],
107-
collapsed: false,
108-
},
109-
{
110-
text: 'Examples',
111-
link: '/catalog/',
112-
items: [
113-
{ text: 'C', link: '/catalog/c/'},
114-
{ text: 'Go', link: '/catalog/go/'},
115-
{ text: 'Java', link: '/catalog/java/'},
116-
{ text: 'Python', link: '/catalog/python/'},
117-
{ text: 'Ruby', link: '/catalog/ruby/'},
118-
{ text: 'Rust', link: '/catalog/rust/'},
119-
{ text: 'TypeScript', link: '/catalog/typescript/'},
120-
{ text: 'TSX', link: '/catalog/tsx/'},
121-
],
122-
collapsed: true,
123-
},
124-
{
125-
text: 'Reference',
126-
items: [
127-
{ text: 'Command Line Interface', link: '/reference/cli.html', collapsed: true,
128-
items: [
129-
{ text: 'sg run', link: '/reference/cli/run.html' },
130-
{ text: 'sg scan', link: '/reference/cli/scan.html' },
131-
{ text: 'sg test', link: '/reference/cli/test.html' },
132-
{ text: 'sg new', link: '/reference/cli/new.html' },
133-
],
134-
},
135-
{ text: 'Project Config', link: '/reference/sgconfig.html' },
136-
{ text: 'Rule Config', link: '/reference/yaml.html', collapsed: false,
137-
items: [
138-
{ text: 'fix', link: '/reference/yaml/fix.html' },
139-
{ text: 'transformation', link: '/reference/yaml/transformation.html' },
140-
{ text: 'rewriter', link: '/reference/yaml/rewriter.html' },
141-
],
142-
},
143-
{ text: 'Rule Object', link: '/reference/rule.html' },
144-
{ text: 'API Reference', link: '/reference/api.html' },
145-
{ text: 'Language List', link: '/reference/languages.html' },
146-
{ text: 'Playground Manual', link: '/reference/playground.html' },
147-
],
148-
collapsed: true,
149-
},
150-
{
151-
text: 'Advanced Topics',
152-
items: [
153-
{ text: 'Frequently Asked Questions', link: '/advanced/faq.html'},
154-
{ text: 'How ast-grep Works', link: '/advanced/how-ast-grep-works.html', collapsed: false,
155-
items: [
156-
{ text: 'Core Concepts', link: '/advanced/core-concepts.html'},
157-
{ text: 'Pattern Syntax', link: '/advanced/pattern-parse.html'},
158-
{ text: 'Pattern Match Algorithm', link: '/advanced/match-algorithm.html'},
159-
{ text: 'How Rewrite Works', link: '/advanced/find-n-patch.html'},
160-
] ,
161-
},
162-
{ text: 'Custom Language Support', link: '/advanced/custom-language.html'},
163-
{ text: 'Multi-Language Documents', link: '/advanced/language-injection.html'},
164-
{ text: 'Comparison with Other Tools', link: '/advanced/tool-comparison.html'},
165-
],
166-
collapsed: true,
167-
},
168-
{
169-
text: 'Contributing',
170-
items: [
171-
{ text: 'Guide', link: '/contributing/how-to.html' },
172-
{ text: 'Development', link: '/contributing/development.html' },
173-
{ text: 'Add New Language', link: '/contributing/add-lang.html' },
174-
],
175-
collapsed: true,
176-
},
177-
{
178-
text: 'Links',
179-
items: [
180-
{ text: 'Playground', link: '/playground.html' },
181-
{ text: 'Blog', link: '/blog.html' },
182-
{ text: 'VSCode', link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode'},
183-
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ'},
184-
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep'},
185-
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/'},
186-
{ text: 'Docs.rs', link: 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' },
187-
],
188-
collapsed: true,
189-
},
190-
],
63+
sidebar: {
64+
'/blog/': [
65+
{ text: 'Blog List', link: '/blog.html' },
66+
{ text: 'Homepage', link: '/' },
67+
{ text: 'VSCode', link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode'},
68+
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ'},
69+
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep'},
70+
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/'},
71+
{ text: 'Docs.rs', link: 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' },
72+
],
73+
'/': [
74+
{
75+
text: 'Guide',
76+
link: '/guide/introduction.html',
77+
items: [
78+
{ text: 'Quick Start', link: '/guide/quick-start.html' },
79+
{ text: 'Pattern Syntax', link: '/guide/pattern-syntax.html' },
80+
{ text: 'Rule Essentials', link: '/guide/rule-config.html', collapsed: true,
81+
items:[
82+
{ text: 'Atomic Rule', link: '/guide/rule-config/atomic-rule.html' },
83+
{ text: 'Relational Rule', link: '/guide/rule-config/relational-rule.html' },
84+
{ text: 'Composite Rule', link: '/guide/rule-config/composite-rule.html' },
85+
{ text: 'Utility Rule', link: '/guide/rule-config/utility-rule.html' },
86+
],},
87+
{
88+
text: 'Project Setup', collapsed: true, link: '/guide/scan-project.html',
89+
items: [
90+
{ text: 'Project Configuration', link: '/guide/project/project-config.html' },
91+
{ text: 'Lint Rule', link: '/guide/project/lint-rule.html' },
92+
{ text: 'Test Your Rule', link: '/guide/test-rule.html' },
93+
],
94+
},
95+
{ text: 'Rewrite Code', link: '/guide/rewrite-code.html', collapsed: true,
96+
items: [
97+
{ text: 'Transform Code', link: '/guide/rewrite/transform.html' },
98+
{ text: 'Rewriter Rule', link: '/guide/rewrite/rewriter.html' },
99+
],
100+
},
101+
{
102+
text: 'Tooling Overview', link: '/guide/tooling-overview.html', collapsed: true,
103+
items: [
104+
{ text: 'Editor Integration', link: '/guide/tools/editors.html' },
105+
{ text: 'JSON mode', link: '/guide/tools/json.html' },
106+
],
107+
},
108+
{ text: 'API Usage', link: '/guide/api-usage.html', collapsed: true,
109+
items:[
110+
{ text: 'JavaScript API', link: '/guide/api-usage/js-api.html' },
111+
{ text: 'Python API', link: '/guide/api-usage/py-api.html' },
112+
{ text: 'Performance Tip', link: '/guide/api-usage/performance-tip.html' },
113+
]},
114+
],
115+
collapsed: false,
116+
},
117+
{
118+
text: 'Examples',
119+
link: '/catalog/',
120+
items: [
121+
{ text: 'C', link: '/catalog/c/'},
122+
{ text: 'Go', link: '/catalog/go/'},
123+
{ text: 'Java', link: '/catalog/java/'},
124+
{ text: 'Python', link: '/catalog/python/'},
125+
{ text: 'Ruby', link: '/catalog/ruby/'},
126+
{ text: 'Rust', link: '/catalog/rust/'},
127+
{ text: 'TypeScript', link: '/catalog/typescript/'},
128+
{ text: 'TSX', link: '/catalog/tsx/'},
129+
],
130+
collapsed: true,
131+
},
132+
{
133+
text: 'Reference',
134+
items: [
135+
{ text: 'Command Line Interface', link: '/reference/cli.html', collapsed: true,
136+
items: [
137+
{ text: 'sg run', link: '/reference/cli/run.html' },
138+
{ text: 'sg scan', link: '/reference/cli/scan.html' },
139+
{ text: 'sg test', link: '/reference/cli/test.html' },
140+
{ text: 'sg new', link: '/reference/cli/new.html' },
141+
],
142+
},
143+
{ text: 'Project Config', link: '/reference/sgconfig.html' },
144+
{ text: 'Rule Config', link: '/reference/yaml.html', collapsed: false,
145+
items: [
146+
{ text: 'fix', link: '/reference/yaml/fix.html' },
147+
{ text: 'transformation', link: '/reference/yaml/transformation.html' },
148+
{ text: 'rewriter', link: '/reference/yaml/rewriter.html' },
149+
],
150+
},
151+
{ text: 'Rule Object', link: '/reference/rule.html' },
152+
{ text: 'API Reference', link: '/reference/api.html' },
153+
{ text: 'Language List', link: '/reference/languages.html' },
154+
{ text: 'Playground Manual', link: '/reference/playground.html' },
155+
],
156+
collapsed: true,
157+
},
158+
{
159+
text: 'Advanced Topics',
160+
items: [
161+
{ text: 'Frequently Asked Questions', link: '/advanced/faq.html'},
162+
{ text: 'How ast-grep Works', link: '/advanced/how-ast-grep-works.html', collapsed: false,
163+
items: [
164+
{ text: 'Core Concepts', link: '/advanced/core-concepts.html'},
165+
{ text: 'Pattern Syntax', link: '/advanced/pattern-parse.html'},
166+
{ text: 'Pattern Match Algorithm', link: '/advanced/match-algorithm.html'},
167+
{ text: 'How Rewrite Works', link: '/advanced/find-n-patch.html'},
168+
] ,
169+
},
170+
{ text: 'Custom Language Support', link: '/advanced/custom-language.html'},
171+
{ text: 'Multi-Language Documents', link: '/advanced/language-injection.html'},
172+
{ text: 'Comparison with Other Tools', link: '/advanced/tool-comparison.html'},
173+
],
174+
collapsed: true,
175+
},
176+
{
177+
text: 'Contributing',
178+
items: [
179+
{ text: 'Guide', link: '/contributing/how-to.html' },
180+
{ text: 'Development', link: '/contributing/development.html' },
181+
{ text: 'Add New Language', link: '/contributing/add-lang.html' },
182+
],
183+
collapsed: true,
184+
},
185+
{
186+
text: 'Links',
187+
items: [
188+
{ text: 'Playground', link: '/playground.html' },
189+
{ text: 'Blog', link: '/blog.html' },
190+
{ text: 'VSCode', link: 'https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode'},
191+
{ text: 'Discord', link: 'https://discord.com/invite/4YZjf6htSQ'},
192+
{ text: 'StackOverflow', link: 'https://stackoverflow.com/questions/tagged/ast-grep'},
193+
{ text: 'Reddit', link: 'https://www.reddit.com/r/astgrep/'},
194+
{ text: 'Docs.rs', link: 'https://docs.rs/ast-grep-core/latest/ast_grep_core/' },
195+
],
196+
collapsed: true,
197+
},
198+
],
199+
},
191200
footer: {
192201
message: 'Made with ❤️ with Rust',
193202
copyright: 'Copyright © 2022-present Herrington Darkholme',

website/blog/code-search-design-space.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
author:
33
- name: Herrington Darkholme
4-
sidebar: false
54
date: 2024-12-25
65
head:
76
- - meta

website/blog/stars-3000.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
author:
33
- name: Herrington Darkholme
4-
sidebar: false
54
search: false
65
date: 2023-11-02
76
head:
@@ -76,4 +75,4 @@ If you want to contribute to the code or documentation of ast-grep, we have prep
7675

7776
I hope you are as enthusiastic as I am about the progress and future of ast-grep. I sincerely value your feedback, suggestions, and contributions. Please do not hesitate to contact me if you have any questions or comments.
7877

79-
Thank you for your wonderful support. You are making a difference in the open source community and in the lives of many developers who use ast-grep.
78+
Thank you for your wonderful support. You are making a difference in the open source community and in the lives of many developers who use ast-grep.

website/blog/stars-5000.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
author:
33
- name: Herrington Darkholme
4-
sidebar: false
54
search: false
65
date: 2024-01-20
76
head:
@@ -120,4 +119,4 @@ And we want to especially thank ast-grep's sponsors!
120119

121120
We hope that you enjoy the new features and improvements in ast-grep. We are always working to make ast-grep better and we look forward to hearing from you.
122121

123-
Happy coding!
122+
Happy coding!

website/blog/stars-6000.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
author:
33
- name: Herrington Darkholme
4-
sidebar: false
54
search: false
65
date: 2024-05-19
76
head:
@@ -94,4 +93,4 @@ As ast-grep continues to grow, we remain committed to providing a tool that not
9493
![sponsors](/image/blog/sponsor2.png)
9594

9695

97-
We thank each and every one of you, espeically ast-grep's sponsors, for your support, contributions, and feedback that have shaped ast-grep into what it is today. Here's to many more milestones ahead!
96+
We thank each and every one of you, espeically ast-grep's sponsors, for your support, contributions, and feedback that have shaped ast-grep into what it is today. Here's to many more milestones ahead!

website/blog/typed-napi.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
author:
33
- name: Herrington Darkholme
4-
sidebar: false
54
search: false
65
date: 2024-12-22
76
head:
@@ -439,4 +438,4 @@ As [Theo](https://x.com/theo) aptly puts it in [his video](https://www.youtube.c
439438

440439
> There are very few devs that understand Rust deeply enough and compiler deeply enough that also care about TypeScript in web dev enough to build something for web devs in Rust
441440
442-
ast-grep is determined to bridge that gap between Rust and TypeScript!
441+
ast-grep is determined to bridge that gap between Rust and TypeScript!

0 commit comments

Comments
 (0)