Skip to content

Commit 3f4e7e4

Browse files
committed
Relocate handcurated data from index_data/ into data/
1 parent 1046aee commit 3f4e7e4

File tree

14 files changed

+16
-16
lines changed

14 files changed

+16
-16
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.

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

scripts/test-hrefs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ const path = require("path");
1414
const fs = require("fs");
1515
const urlModule = require("url");
1616

17-
const blog_index = require("../index_data/blog_posts.json");
17+
const blog_index = require("../data/blog_posts.json");
1818

19-
// Our blogpost urls are mapped via `index_data/blog_posts.json`
19+
// Our blogpost urls are mapped via `data/blog_posts.json`
2020
// the blog_posts file has following structure: { [slug]: [filepath relative to _blogposts] }
2121
const mapBlogFilePath = path => {
2222
const match = path.match(/\.\/_blogposts\/(.*\.mdx)/);

src/common/BlogApi.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/common/BlogApi.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// Manual mapping between slugs and actual file
2929
// { [slug: string] : [filepath: string] }
3030
// The filepath is relative within _blogposts
31-
let index: Js.Dict.t<string> = %raw("require('../../index_data/blog_posts.json')")
31+
let index: Js.Dict.t<string> = %raw("require('../../data/blog_posts.json')")
3232

3333
module GrayMatter = {
3434
type output = {

src/common/BlogFrontmatter.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)