Skip to content

Commit 9dd281c

Browse files
committed
Extract astro folder to top level
1 parent c0f074d commit 9dd281c

File tree

433 files changed

+7412
-197326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

433 files changed

+7412
-197326
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838

3939
- name: Generate stdlib docs
4040
run: |
41-
grain doc grain/stdlib -o src/stdlib --current-version=$(grain -v)
41+
grain doc grain/stdlib -o src/content/docs/stdlib --current-version=$(grain -v)
4242
4343
- name: Commit updates
4444
run: |
4545
git add src/getting_grain.md
46-
git add src/stdlib/
46+
git add src/content/docs/stdlib/
4747
git commit -m 'chore: Update website for ${{ github.event.inputs.tag }}'
4848
4949
- name: Push updates

.gitignore

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
.DS_Store
2-
Thumbs.db
3-
db.json
4-
*.log
1+
# build output
2+
dist/
3+
4+
# generated types
5+
.astro/
6+
7+
# dependencies
58
node_modules/
6-
.deploy*/
7-
_multiconfig.yml
8-
/docs
9-
/guide
10-
/blog
11-
/try
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/
25+
26+
.vscode/
27+
1228
/*.gr.wasm
13-
/.next/
29+
contributors.json

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
22

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Documentation for the Grain programming language at [grain-lang.org](https://gra
1212

1313
## About
1414

15-
This documentation site is a [Hexo](https://hexo.io/) site. All of the docs are generated from Markdown files, and Hexo builds a static website that is hosted on Netlify.
15+
This documentation site is an [Astro](https://astro.build/) site. All of the docs are generated from Markdown files, and the static bundle generated by Astro is hosted on Netlify.
1616

1717
## Contributing
1818

@@ -36,7 +36,7 @@ To make a change to a document, edit the corresponding Markdown file in [src](sr
3636

3737
### Adding a New Document
3838

39-
Create your new Markdown file in `src`. You'll also need to update [docs_config.yml](docs_config.yml) to include your new page in the sidebar. Each document starts with some front-matter, which is a bit of yml/json that is given to the renderer. For now, this only includes the title of the page. Since the title of the page is an `h1`, headers in your document should begin at level 2:
39+
Create your new Markdown file in the desired location within `src/content/docs`. Each document starts with some front-matter, which is a bit of yml that is given to the renderer. Since the title of the page is an `h1`, headers in your document should begin at level 2:
4040

4141
```markdown
4242
---
@@ -48,20 +48,11 @@ title: Some Title of Some Topic
4848

4949
### Previewing the Site
5050

51-
Once a PR is created, Netlify will create a preview site and comment on the PR with a link. If you'd like to view your changes locally,
52-
53-
For the docs, run:
54-
55-
```sh
56-
npm install
57-
npm run start-docs
58-
```
59-
60-
For the blog, run:
51+
Once a PR is created, Netlify will create a preview site and comment on the PR with a link. If you'd like to view your changes locally (Node v18+ required):
6152

6253
```sh
6354
npm install
64-
npm run start-blog
55+
npm run dev
6556
```
6657

67-
This will install all build dependencies and serve the website on port 3000.
58+
This will install all build dependencies and serve the website on port 4321.

astro/astro.config.mjs renamed to astro.config.mjs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import tailwind from "@astrojs/tailwind";
33
import svelte from "@astrojs/svelte";
44
import rehypeAutolinkHeadings from "rehype-autolink-headings";
55
import rehypeSlug from "rehype-slug";
6-
import rehypeContentIntroTextTransformer from "./src/rehype/rehype-content-intro-text-transformer";
7-
import rehypeAutolinkHeadingsConfig from "./src/rehype/rehype-autolink-headings-config";
86
import path from "node:path";
97
import { createRequire } from "node:module";
8+
import * as fs from "node:fs";
9+
import rehypeContentIntroTextTransformer from "./src/rehype/rehype-content-intro-text-transformer";
10+
import rehypeAutolinkHeadingsConfig from "./src/rehype/rehype-autolink-headings-config";
1011
import rehypeTableWrapper from "./src/rehype/rehype-table-wrapper";
1112

1213
const require = createRequire(import.meta.url);
1314

14-
const grainLang = JSON.parse(fs.readFileSync("./grain.json"));
15+
const grainLang = JSON.parse(fs.readFileSync("./grain-language-server/editor-extensions/vscode/syntaxes/grain.json"));
1516
const theme = JSON.parse(fs.readFileSync("./themes/github-dark-modified-lighter.json"));
1617

1718
// https://astro.build/config
@@ -44,12 +45,18 @@ export default defineConfig({
4445
},
4546
},
4647
},
48+
build: {
49+
target: "esnext",
50+
}
4751
},
52+
4853
integrations: [tailwind(), svelte()],
54+
4955
redirects: {
5056
"/docs": "/docs/intro",
5157
"/docs/guide": "/docs/guide/basics"
5258
},
59+
5360
markdown: {
5461
rehypePlugins: [
5562
rehypeSlug,
@@ -72,5 +79,5 @@ export default defineConfig({
7279
],
7380
langs: [{...grainLang, name: "grain"}]
7481
}
75-
}
76-
});
82+
},
83+
});

astro/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

astro/.vscode/extensions.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

astro/.vscode/launch.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

astro/README.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)