Skip to content

Commit

Permalink
[feat] use vitepress to host docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HerringtonDarkholme committed Sep 13, 2022
1 parent 28b32c9 commit ad09d42
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 45 deletions.
29 changes: 29 additions & 0 deletions website/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { defineConfig } from 'vitepress'

const gaScript = `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-EZSJ3YF2RG');
`

export default defineConfig({
lang: 'en-US',
title: 'ast-grep',
titleTemplate: 'ligthning fast code tool',
base: '/ast-grep/',
description: 'ast-grep(sg) is a ligthning fast and user friendly tool for code searching, linting, rewriting at large scale.',
// head: [
// ['script', {async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-EZSJ3YF2RG'}],
// ['script', {}, gaScript],
// ],
outDir: './dist',
themeConfig: {
logo: 'logo.svg',
nav: [
{ text: 'Guide', link: '/guide' },
{ text: 'Playground', link: '/playground' },
],
},
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added website/guide/introduction.md
Empty file.
Empty file added website/guide/rule-config.md
Empty file.
22 changes: 0 additions & 22 deletions website/index.html

This file was deleted.

30 changes: 30 additions & 0 deletions website/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: home

hero:
name: ast-grep
text: Write Code to Match Code
tagline: ast-grep(sg) is a ligthning fast and user friendly tool for code searching, linting, rewriting at large scale.
image:
src: ../logo.svg
alt: VitePress
actions:
- theme: brand
text: Get Started
link: /guide/introduction
- theme: alt
text: View on GitHub
link: https://github.com/HerringtonDarkholme/ast-grep

features:
- icon: ⚡️
title: Performant
details: Lorem ipsum...
- icon: ⚡️
title: Progressive
details: Lorem ipsum...
- icon: 🛠️
title: Pragmatic
details: Lorem ipsum...

---
9 changes: 5 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview"
"dev": "vitepress dev",
"build": "vue-tsc --noEmit && vitepress build",
"serve": "vitepress serve"
},
"dependencies": {
"@types/js-yaml": "^4.0.5",
Expand All @@ -20,7 +20,8 @@
"ast-grep-wasm": "file:../crates/wasm/pkg/"
},
"devDependencies": {
"@vitejs/plugin-vue": "3.1.0",
"@algolia/client-search": "4.9.1",
"vitepress": "^1.0.0-alpha.13",
"typescript": "4.8.3",
"vite": "3.1.0",
"vue-tsc": "0.40.13"
Expand Down
9 changes: 9 additions & 0 deletions website/playground.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: page
---

<script setup>
import App from './src/App.vue'
</script>

<App/>
Loading

0 comments on commit ad09d42

Please sign in to comment.