Skip to content

Commit 905351e

Browse files
authored
Merge pull request #346 from Minnozz/format
Run `npx rescript format -all`
2 parents 1308887 + 5dcb048 commit 905351e

File tree

6 files changed

+37
-43
lines changed

6 files changed

+37
-43
lines changed

src/Blog.res

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ module CategorySelector = {
5858
}
5959

6060
@react.component
61-
let make = (
62-
~selected: selection,
63-
~onSelected: selection => unit,
64-
) => {
61+
let make = (~selected: selection, ~onSelected: selection => unit) => {
6562
let tabs = [All, Archived]
6663

6764
<div className="text-16 w-full flex items-center justify-between text-gray-60">
@@ -334,8 +331,7 @@ let default = (props: props): React.element => {
334331
<div className="hidden sm:flex justify-center ">
335332
<div className="my-16 w-full" style={ReactDOMStyle.make(~maxWidth="12rem", ())}>
336333
<CategorySelector
337-
onSelected={selection => setSelection(_ => selection)}
338-
selected=currentSelection
334+
onSelected={selection => setSelection(_ => selection)} selected=currentSelection
339335
/>
340336
</div>
341337
</div>
@@ -371,29 +367,29 @@ let default = (props: props): React.element => {
371367
}
372368

373369
let getStaticProps: Next.GetStaticProps.t<props, params> = _ctx => {
374-
let (posts, malformed, archived) = BlogApi.getAllPosts()->Belt.Array.reduce(
375-
([], [], []),
376-
(acc, postData) => {
377-
let (posts, malformed, archived) = acc
378-
let id = postData.slug
379-
380-
let decoded = BlogFrontmatter.decode(postData.frontmatter)
381-
382-
switch decoded {
383-
| Error(message) =>
384-
let m = {Malformed.id: id, message: message}
385-
let malformed = Belt.Array.concat(malformed, [m])
386-
(posts, malformed, archived)
387-
| Ok(frontmatter) =>
388-
if postData.archived {
389-
Js.Array2.push(archived, {Post.id: id, frontmatter: frontmatter})->ignore
390-
} else {
391-
Js.Array2.push(posts, {Post.id: id, frontmatter: frontmatter})->ignore
392-
}
393-
(posts, malformed, archived)
370+
let (posts, malformed, archived) = BlogApi.getAllPosts()->Belt.Array.reduce(([], [], []), (
371+
acc,
372+
postData,
373+
) => {
374+
let (posts, malformed, archived) = acc
375+
let id = postData.slug
376+
377+
let decoded = BlogFrontmatter.decode(postData.frontmatter)
378+
379+
switch decoded {
380+
| Error(message) =>
381+
let m = {Malformed.id: id, message: message}
382+
let malformed = Belt.Array.concat(malformed, [m])
383+
(posts, malformed, archived)
384+
| Ok(frontmatter) =>
385+
if postData.archived {
386+
Js.Array2.push(archived, {Post.id: id, frontmatter: frontmatter})->ignore
387+
} else {
388+
Js.Array2.push(posts, {Post.id: id, frontmatter: frontmatter})->ignore
394389
}
395-
},
396-
)
390+
(posts, malformed, archived)
391+
}
392+
})
397393

398394
let props = {
399395
posts: Post.orderByDate(posts),

src/BlogArticle.res

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,7 @@ let default = (props: props) => {
153153
: React.null
154154

155155
let content = switch fm {
156-
| Ok({
157-
date,
158-
author,
159-
co_authors,
160-
title,
161-
description,
162-
canonical,
163-
articleImg,
164-
previewImg,
165-
}) =>
156+
| Ok({date, author, co_authors, title, description, canonical, articleImg, previewImg}) =>
166157
<div className="w-full">
167158
<Meta
168159
title={title ++ " | ReScript Blog"}

src/BlogData.res

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ let data = Js.Array2.map(
1010
("release-8-3-pt1", "2020-09-25-release-8-3"),
1111
("new-rescript-logo", "2020-08-28-new-rescript-logo"),
1212
("bucklescript-is-rebranding", "2020-08-10-bucklescript-is-rebranding"),
13-
("a-note-on-bucklescripts-future-commitments", "archive/a-note-on-bucklescripts-future-commitments"),
13+
(
14+
"a-note-on-bucklescripts-future-commitments",
15+
"archive/a-note-on-bucklescripts-future-commitments",
16+
),
1417
("a-small-step-for-bucklescript", "archive/a-small-step-for-bucklescript"),
1518
("a-story-of-exception-encoding", "archive/a-story-of-exception-encoding"),
1619
("a-story-of-lazy-encoding", "archive/a-story-of-lazy-encoding"),
@@ -61,7 +64,10 @@ let data = Js.Array2.map(
6164
("union-types-in-bucklescript", "archive/union-types-in-bucklescript"),
6265
("whats-new-in-7-pt1", "archive/whats-new-in-7-pt1"),
6366
("whats-new-in-7-pt2", "archive/whats-new-in-7-pt2"),
64-
("editor-support-custom-operators-and-more", "2020-11-17-editor-support-custom-operators-and-more"),
67+
(
68+
"editor-support-custom-operators-and-more",
69+
"2020-11-17-editor-support-custom-operators-and-more",
70+
),
6571
("editor-support-release-1-0", "2020-11-26-editor-support-release-1-0"),
6672
("bucklescript-release-8-4", "2020-12-07-release-8-4"),
6773
],

src/common/Constants.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This is used for the version dropdown in the manual layouts
2-
let allManualVersions = [("latest", "v9.1"),("v9.0.0", "v8.2 - v9.0"), ("v8.0.0", "v6.0 - v8.2")]
2+
let allManualVersions = [("latest", "v9.1"), ("v9.0.0", "v8.2 - v9.0"), ("v8.0.0", "v6.0 - v8.2")]
33

44
// Used for the DocsOverview and collapsible navigation
55
let languageManual = version => {

src/common/DocFrontmatter.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type t = {
66
ghEditHref: string,
77
}
88

9-
let decode = (json) => {
9+
let decode = json => {
1010
open! Json.Decode
1111
try Some({
1212
title: field("title", string, json),

src/components/Markdown.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ module A = {
392392
| _ => href
393393
}
394394
<Next.Link href>
395-
<a href rel="noopener noreferrer" className="no-underline text-fire hover:underline" ?target>
395+
<a
396+
href rel="noopener noreferrer" className="no-underline text-fire hover:underline" ?target>
396397
children
397398
</a>
398399
</Next.Link>

0 commit comments

Comments
 (0)