Skip to content

Change layout architecture #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public/blog/feed.xml
node_modules/
.next/
index_data/*.json
!index_data/blog_authors.json
!index_data/blog_posts.json
!index_data/build-schema.json

yarn-error.log

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ build specific pages (file `index_data/x.json` not found).

## Project Structure Overview

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

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

### Contributing
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions data/sidebar_community.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Resources": [
"overview",
"code-of-conduct"
]
}
10 changes: 10 additions & 0 deletions data/sidebar_gentype_latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Overview": [
"introduction",
"getting-started",
"usage"
],
"Advanced": [
"supported-types"
]
}
66 changes: 66 additions & 0 deletions data/sidebar_manual_latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"Overview": [
"introduction",
"installation",
"editor-plugins",
"migrate-from-bucklescript-reason",
"try"
],
"Language Features": [
"overview",
"let-binding",
"type",
"primitive-types",
"tuple",
"record",
"object",
"variant",
"null-undefined-option",
"array-and-list",
"function",
"control-flow",
"pipe",
"pattern-matching-destructuring",
"mutation",
"jsx",
"exception",
"lazy-values",
"promise",
"module",
"import-export",
"attribute",
"unboxed",
"reserved-keywords"
],
"JavaScript Interop": [
"embed-raw-javascript",
"shared-data-types",
"external",
"bind-to-js-object",
"bind-to-js-function",
"import-from-export-to-js",
"bind-to-global-js-values",
"json",
"inlining-constants",
"use-illegal-identifier-names",
"generate-converters-accessors",
"browser-support-polyfills",
"interop-cheatsheet"
],
"Build System": [
"build-overview",
"build-configuration",
"build-configuration-schema",
"interop-with-js-build-systems",
"build-performance"
],
"Guides": [
"converting-from-js",
"libraries"
],
"Extra": [
"newcomer-examples",
"project-structure",
"faq"
]
}
62 changes: 62 additions & 0 deletions data/sidebar_manual_v800.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"Overview": [
"introduction",
"installation",
"editor-plugins",
"migrate-from-bucklescript-reason",
"try"
],
"Language Features": [
"overview",
"let-binding",
"type",
"primitive-types",
"tuple",
"record",
"object",
"variant",
"null-undefined-option",
"array-and-list",
"function",
"control-flow",
"pipe",
"pattern-matching-destructuring",
"mutation",
"jsx",
"exception",
"lazy-values",
"promise",
"module",
"import-export",
"reserved-keywords"
],
"JavaScript Interop": [
"embed-raw-javascript",
"shared-data-types",
"external",
"bind-to-js-object",
"bind-to-js-function",
"import-from-export-to-js",
"bind-to-global-js-values",
"json",
"use-illegal-identifier-names",
"generate-converters-accessors",
"browser-support-polyfills",
"interop-cheatsheet"
],
"Build System": [
"build-overview",
"build-configuration",
"interop-with-js-build-systems",
"build-performance"
],
"Guides": [
"converting-from-js",
"libraries"
],
"Extra": [
"newcomer-examples",
"project-structure",
"faq"
]
}
11 changes: 10 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ const config = {
}
}
return config
}
},
async redirects() {
return [
{
source: '/community',
destination: '/community/overview',
permanent: true,
},
]
},
};

module.exports = withMdx(withTM(withCSS(config)));
6 changes: 4 additions & 2 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//}

import "styles/main.css";
import {make as App} from "src/common/App.js";
import {make as ResApp} from "src/common/App.js";

export default App;
export default function App(props) {
return <ResApp {...props} />
};
6 changes: 3 additions & 3 deletions pages/blogpost-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ touch _blogposts/2020-01-30-my-new-blog-post.mdx

### Map the file to a URL

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

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

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

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

## Add Frontmatter Data
Expand Down Expand Up @@ -72,7 +72,7 @@ canonical: https://rescript-lang.org/blog/2017/10/01/announcing-1-0
---
```

- `author`: An author alias as defined in `./index_data/blog_authors.json`
- `author`: An author alias as defined in `./data/blog_authors.json`
- `co-authors`: A list of co-author aliases (same aliases allowed as in the `author` field)
- `date`: A **string** date (always make sure to use the `"`, otherwise yaml
will parse it as a `date`). The date format is `"YYYY-MM-DD hh:mm"`. All blog
Expand Down
6 changes: 6 additions & 0 deletions pages/community/code-of-conduct.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: "Code of Conduct"
description: "Our working codex for the ReScript community"
canonical: "/community/code-of-conduct"
---

# Code of Conduct

## Our Pledge
Expand Down
6 changes: 6 additions & 0 deletions pages/community.mdx → pages/community/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: "Overview"
description: "Community Resources Overview"
canonical: "/community/overview"
---

# Community

## Core Team
Expand Down
6 changes: 6 additions & 0 deletions pages/docs/gentype/latest/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: "Getting Started"
description: "How to get started with genType in your ReScript projects"
canonical: "/docs/gentype/latest/getting-started"
---

# Getting Started

`genType` is tightly integrated in the ReScript Compiler. It only requires minimal setup.
Expand Down
6 changes: 6 additions & 0 deletions pages/docs/gentype/latest/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: "Introduction"
description: "GenType - Interoperability between ReScript and TypeScript / Flow"
canonical: "/docs/gentype/latest/introduction"
---

# GenType

`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.
Expand Down
6 changes: 6 additions & 0 deletions pages/docs/gentype/latest/supported-types.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: "Supported Types"
description: "Supported types and value convertion in GenType"
canonical: "/docs/gentype/latest/supported-types"
---

# Supported Types

<Intro>
Expand Down
14 changes: 0 additions & 14 deletions pages/docs/manual/latest/build-configuration-schema.js

This file was deleted.

19 changes: 19 additions & 0 deletions pages/docs/manual/latest/build-configuration-schema.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "Configuration Schema"
metaTitle: "Build System Configuration Schema"
description: "Schema exploration widget for the ReScript configuration file"
canonical: "/docs/manual/latest/build-configuration-schema"
---

import dynamic from "next/dynamic";

export const Docson = dynamic(() => import("src/components/Docson").then((comp) => {
return comp.make;
}), {
ssr: false,
loading: () => <div> Loading... </div>
});

export default function BuildConfigurationSchemaPage() {
return <Docson/>;
}
3 changes: 2 additions & 1 deletion pages/docs/manual/latest/build-configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Build System Configuration"
title: "Configuration"
metaTitle: "Build System Configuration"
description: "Details about the configuration of the ReScript build system (bsconfig.json)"
canonical: "/docs/manual/latest/build-configuration"
---
Expand Down
3 changes: 2 additions & 1 deletion pages/docs/manual/latest/build-overview.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Build System Overview"
title: "Overview"
metaTitle: "Build System Overview"
description: "Documentation about the ReScript build system and its toolchain"
canonical: "/docs/manual/latest/build-overview"
---
Expand Down
3 changes: 2 additions & 1 deletion pages/docs/manual/latest/build-performance.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Build Performance"
title: "Performance"
metaTitle: "Build Performance"
description: "ReScript build performance and measuring tools"
canonical: "/docs/manual/latest/build-performance"
---
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/manual/latest/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "ReScript Introduction"
title: "Introduction"
description: "The hows and whys of ReScript"
canonical: "/docs/manual/latest/introduction"
---
Expand Down
3 changes: 2 additions & 1 deletion pages/docs/manual/latest/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Language Features Overview"
title: "Overview"
metaTitle: "Language Features Overview"
description: "A quick overview on ReScript's syntax"
canonical: "/docs/manual/latest/overview"
---
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/manual/latest/promise.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Promise"
title: "Async & Promise"
description: "JS Promise handling in ReScript"
canonical: "/docs/manual/latest/promise"
---
Expand Down
2 changes: 2 additions & 0 deletions pages/docs/manual/latest/unboxed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: "Unbox a wrapper"
canonical: "/docs/manual/latest/unboxed"
---

# Unboxed

Consider a ReScript variant with a single payload, and a record with a single field:

<CodeTab labels={["ReScript", "JS Output"]}>
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/manual/v8.0.0/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "ReScript Introduction"
title: "Introduction"
description: "The hows and whys of ReScript"
canonical: "/docs/manual/latest/introduction"
---
Expand Down
3 changes: 2 additions & 1 deletion pages/docs/manual/v8.0.0/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Language Features Overview"
title: "Overview"
metaTitle: "Language Features Overview"
description: "A quick overview on ReScript's syntax"
canonical: "/docs/manual/latest/overview"
---
Expand Down
Loading