Skip to content

Commit a5779b3

Browse files
authored
Merge pull request #167 from reason-association/change-layout-architecture
Change layout architecture
2 parents 5e6a95a + 3f4e7e4 commit a5779b3

Some content is hidden

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

57 files changed

+624
-1464
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ public/blog/feed.xml
1010
node_modules/
1111
.next/
1212
index_data/*.json
13-
!index_data/blog_authors.json
14-
!index_data/blog_posts.json
15-
!index_data/build-schema.json
1613

1714
yarn-error.log
1815

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ build specific pages (file `index_data/x.json` not found).
5555

5656
## Project Structure Overview
5757

58+
- `data`: Contains hand-curated data, such as sidebar ordering, blog data, etc
59+
- `index_data`: Contains generated data, usually generated by scripts like `scripts/extract-tocs.js`
60+
- `compilers`: Contains a subdirectory with independently installed ReScript compilers, to be able to compile / test examples with different ReScript versions
5861
- `pages`: All Next pages. Those are written in JS / MDX, some pages are re-exporting ReScript based pages from `src/MyPage.res`
5962
- `styles`: Contains all extra CSS that cannot be expressed with Tailwind
6063
- `src`: Contains all ReScript related code for the UI
@@ -145,7 +148,7 @@ posts](https://rescript-lang.org/blogpost-guide).
145148
**Quick-takeaways:**
146149

147150
- Blogposts are located in `_blogposts`
148-
- Author metadata is located in `index_data/blog_authors.json`
151+
- Author metadata is located in `data/blog_authors.json`
149152
- Make sure to follow the file naming rules
150153

151154
### Contributing
File renamed without changes.
File renamed without changes.
File renamed without changes.

data/sidebar_community.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Resources": [
3+
"overview",
4+
"code-of-conduct"
5+
]
6+
}

data/sidebar_gentype_latest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"Overview": [
3+
"introduction",
4+
"getting-started",
5+
"usage"
6+
],
7+
"Advanced": [
8+
"supported-types"
9+
]
10+
}

data/sidebar_manual_latest.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"Overview": [
3+
"introduction",
4+
"installation",
5+
"editor-plugins",
6+
"migrate-from-bucklescript-reason",
7+
"try"
8+
],
9+
"Language Features": [
10+
"overview",
11+
"let-binding",
12+
"type",
13+
"primitive-types",
14+
"tuple",
15+
"record",
16+
"object",
17+
"variant",
18+
"null-undefined-option",
19+
"array-and-list",
20+
"function",
21+
"control-flow",
22+
"pipe",
23+
"pattern-matching-destructuring",
24+
"mutation",
25+
"jsx",
26+
"exception",
27+
"lazy-values",
28+
"promise",
29+
"module",
30+
"import-export",
31+
"attribute",
32+
"unboxed",
33+
"reserved-keywords"
34+
],
35+
"JavaScript Interop": [
36+
"embed-raw-javascript",
37+
"shared-data-types",
38+
"external",
39+
"bind-to-js-object",
40+
"bind-to-js-function",
41+
"import-from-export-to-js",
42+
"bind-to-global-js-values",
43+
"json",
44+
"inlining-constants",
45+
"use-illegal-identifier-names",
46+
"generate-converters-accessors",
47+
"browser-support-polyfills",
48+
"interop-cheatsheet"
49+
],
50+
"Build System": [
51+
"build-overview",
52+
"build-configuration",
53+
"build-configuration-schema",
54+
"interop-with-js-build-systems",
55+
"build-performance"
56+
],
57+
"Guides": [
58+
"converting-from-js",
59+
"libraries"
60+
],
61+
"Extra": [
62+
"newcomer-examples",
63+
"project-structure",
64+
"faq"
65+
]
66+
}

data/sidebar_manual_v800.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"Overview": [
3+
"introduction",
4+
"installation",
5+
"editor-plugins",
6+
"migrate-from-bucklescript-reason",
7+
"try"
8+
],
9+
"Language Features": [
10+
"overview",
11+
"let-binding",
12+
"type",
13+
"primitive-types",
14+
"tuple",
15+
"record",
16+
"object",
17+
"variant",
18+
"null-undefined-option",
19+
"array-and-list",
20+
"function",
21+
"control-flow",
22+
"pipe",
23+
"pattern-matching-destructuring",
24+
"mutation",
25+
"jsx",
26+
"exception",
27+
"lazy-values",
28+
"promise",
29+
"module",
30+
"import-export",
31+
"reserved-keywords"
32+
],
33+
"JavaScript Interop": [
34+
"embed-raw-javascript",
35+
"shared-data-types",
36+
"external",
37+
"bind-to-js-object",
38+
"bind-to-js-function",
39+
"import-from-export-to-js",
40+
"bind-to-global-js-values",
41+
"json",
42+
"use-illegal-identifier-names",
43+
"generate-converters-accessors",
44+
"browser-support-polyfills",
45+
"interop-cheatsheet"
46+
],
47+
"Build System": [
48+
"build-overview",
49+
"build-configuration",
50+
"interop-with-js-build-systems",
51+
"build-performance"
52+
],
53+
"Guides": [
54+
"converting-from-js",
55+
"libraries"
56+
],
57+
"Extra": [
58+
"newcomer-examples",
59+
"project-structure",
60+
"faq"
61+
]
62+
}

next.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ const config = {
2828
}
2929
}
3030
return config
31-
}
31+
},
32+
async redirects() {
33+
return [
34+
{
35+
source: '/community',
36+
destination: '/community/overview',
37+
permanent: true,
38+
},
39+
]
40+
},
3241
};
3342

3443
module.exports = withMdx(withTM(withCSS(config)));

pages/_app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//}
88

99
import "styles/main.css";
10-
import {make as App} from "src/common/App.js";
10+
import {make as ResApp} from "src/common/App.js";
1111

12-
export default App;
12+
export default function App(props) {
13+
return <ResApp {...props} />
14+
};

pages/blogpost-guide.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ touch _blogposts/2020-01-30-my-new-blog-post.mdx
2828

2929
### Map the file to a URL
3030

31-
Open the `index_data/blog_posts.json` file and add a new mapping like this:
31+
Open the `data/blog_posts.json` file and add a new mapping like this:
3232

3333
```
3434
{
@@ -38,7 +38,7 @@ Open the `index_data/blog_posts.json` file and add a new mapping like this:
3838

3939
The key describes the final slug (e.g. `/blog/my-new-blog-post`), while the value defines the relative filepath within the `_blogposts` directory.
4040

41-
Save your changes within `index_data/blog_posts.json` and refresh your browser within [/blog](/blog).
41+
Save your changes within `data/blog_posts.json` and refresh your browser within [/blog](/blog).
4242
You should now see a warning for some malformed frontmatter data. Let's fix this!
4343

4444
## Add Frontmatter Data
@@ -72,7 +72,7 @@ canonical: https://rescript-lang.org/blog/2017/10/01/announcing-1-0
7272
---
7373
```
7474

75-
- `author`: An author alias as defined in `./index_data/blog_authors.json`
75+
- `author`: An author alias as defined in `./data/blog_authors.json`
7676
- `co-authors`: A list of co-author aliases (same aliases allowed as in the `author` field)
7777
- `date`: A **string** date (always make sure to use the `"`, otherwise yaml
7878
will parse it as a `date`). The date format is `"YYYY-MM-DD hh:mm"`. All blog

pages/community/code-of-conduct.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: "Code of Conduct"
3+
description: "Our working codex for the ReScript community"
4+
canonical: "/community/code-of-conduct"
5+
---
6+
17
# Code of Conduct
28

39
## Our Pledge

pages/community.mdx renamed to pages/community/overview.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: "Overview"
3+
description: "Community Resources Overview"
4+
canonical: "/community/overview"
5+
---
6+
17
# Community
28

39
## Core Team

pages/docs/gentype/latest/getting-started.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: "Getting Started"
3+
description: "How to get started with genType in your ReScript projects"
4+
canonical: "/docs/gentype/latest/getting-started"
5+
---
6+
17
# Getting Started
28

39
`genType` is tightly integrated in the ReScript Compiler. It only requires minimal setup.

pages/docs/gentype/latest/introduction.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: "Introduction"
3+
description: "GenType - Interoperability between ReScript and TypeScript / Flow"
4+
canonical: "/docs/gentype/latest/introduction"
5+
---
6+
17
# GenType
28

39
`genType` is a code generation tool that lets you export ReScript values and types to use in JavaScript, and import JavaScript values and types into ReScript.

pages/docs/gentype/latest/supported-types.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: "Supported Types"
3+
description: "Supported types and value convertion in GenType"
4+
canonical: "/docs/gentype/latest/supported-types"
5+
---
6+
17
# Supported Types
28

39
<Intro>

pages/docs/manual/latest/build-configuration-schema.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: "Configuration Schema"
3+
metaTitle: "Build System Configuration Schema"
4+
description: "Schema exploration widget for the ReScript configuration file"
5+
canonical: "/docs/manual/latest/build-configuration-schema"
6+
---
7+
8+
import dynamic from "next/dynamic";
9+
10+
export const Docson = dynamic(() => import("src/components/Docson").then((comp) => {
11+
return comp.make;
12+
}), {
13+
ssr: false,
14+
loading: () => <div> Loading... </div>
15+
});
16+
17+
export default function BuildConfigurationSchemaPage() {
18+
return <Docson/>;
19+
}

pages/docs/manual/latest/build-configuration.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Build System Configuration"
2+
title: "Configuration"
3+
metaTitle: "Build System Configuration"
34
description: "Details about the configuration of the ReScript build system (bsconfig.json)"
45
canonical: "/docs/manual/latest/build-configuration"
56
---

pages/docs/manual/latest/build-overview.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Build System Overview"
2+
title: "Overview"
3+
metaTitle: "Build System Overview"
34
description: "Documentation about the ReScript build system and its toolchain"
45
canonical: "/docs/manual/latest/build-overview"
56
---

pages/docs/manual/latest/build-performance.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Build Performance"
2+
title: "Performance"
3+
metaTitle: "Build Performance"
34
description: "ReScript build performance and measuring tools"
45
canonical: "/docs/manual/latest/build-performance"
56
---

pages/docs/manual/latest/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "ReScript Introduction"
2+
title: "Introduction"
33
description: "The hows and whys of ReScript"
44
canonical: "/docs/manual/latest/introduction"
55
---

pages/docs/manual/latest/overview.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Language Features Overview"
2+
title: "Overview"
3+
metaTitle: "Language Features Overview"
34
description: "A quick overview on ReScript's syntax"
45
canonical: "/docs/manual/latest/overview"
56
---

pages/docs/manual/latest/promise.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Promise"
2+
title: "Async & Promise"
33
description: "JS Promise handling in ReScript"
44
canonical: "/docs/manual/latest/promise"
55
---

pages/docs/manual/latest/unboxed.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: "Unbox a wrapper"
44
canonical: "/docs/manual/latest/unboxed"
55
---
66

7+
# Unboxed
8+
79
Consider a ReScript variant with a single payload, and a record with a single field:
810

911
<CodeTab labels={["ReScript", "JS Output"]}>

pages/docs/manual/v8.0.0/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "ReScript Introduction"
2+
title: "Introduction"
33
description: "The hows and whys of ReScript"
44
canonical: "/docs/manual/latest/introduction"
55
---

pages/docs/manual/v8.0.0/overview.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: "Language Features Overview"
2+
title: "Overview"
3+
metaTitle: "Language Features Overview"
34
description: "A quick overview on ReScript's syntax"
45
canonical: "/docs/manual/latest/overview"
56
---

0 commit comments

Comments
 (0)