@@ -105,9 +105,9 @@ module BlogCard = {
105105 </Link .String >
106106 </div >
107107 <div className = "px-2" >
108- // <Link to=Url( `/blog/${slug}`) >
109- // <h2 className="hl-4"> {React.string(title)} </h2>
110- // </Link>
108+ <Link . String to = { ` /blog/${slug}`} >
109+ <h2 className = "hl-4" > {React .string (title )} </h2 >
110+ </Link . String >
111111 <div className = "captions text-gray-40 pt-1" >
112112 {switch category {
113113 | Some (category ) =>
@@ -154,6 +154,7 @@ module FeatureCard = {
154154 </div >
155155 | None => React .null
156156 }}
157+
157158 {
158159 let className = "absolute top-0 h-full w-full object-cover"
159160 switch previewImg {
@@ -197,9 +198,9 @@ module FeatureCard = {
197198 <p className = "body-md text-gray-70" > {React .string (firstParagraph )} </p >
198199 </div >
199200 </div >
200- // <Link to=Url( `/blog/${slug}`) >
201- // <Button> {React.string("Read Article")} </Button>
202- // </Link>
201+ <Link . String to = { ` /blog/${slug}`} >
202+ <Button > {React .string ("Read Article" )} </Button >
203+ </Link . String >
203204 </div >
204205 </section >
205206 }
@@ -225,11 +226,11 @@ let make = (~posts: array<BlogApi.post>, ~category: category): React.element =>
225226 let featureBox =
226227 <div className = "w-full mb-24 lg:px-8 xl:px-0" >
227228 <FeatureCard
228- previewImg = ?{first .frontmatter .previewImg -> Null .toOption }
229+ previewImg = ?{first .frontmatter .previewImg -> Nullable .toOption }
229230 title = first .frontmatter .title
230- badge = ?{first .frontmatter .badge -> Null .toOption }
231+ badge = ?{first .frontmatter .badge -> Nullable .toOption }
231232 author = first .frontmatter .author
232- firstParagraph = ?{first .frontmatter .description -> Null .toOption }
233+ firstParagraph = ?{first .frontmatter .description -> Nullable .toOption }
233234 date = {first .frontmatter .date -> DateStr .toDate }
234235 slug = {BlogApi .blogPathToSlug (first .path )}
235236 />
@@ -242,16 +243,17 @@ let make = (~posts: array<BlogApi.post>, ~category: category): React.element =>
242243 className = "px-4 md:px-8 xl:px-0 grid grid-cols-1 xs:grid-cols-2 md:grid-cols-3 gap-20 gap-y-12 md:gap-y-24 w-full"
243244 >
244245 {Array .map (rest , post => {
245- let badge = post .frontmatter .badge -> Null .toOption
246+ let badge = post .frontmatter .badge -> Nullable .toOption
246247
247248 <BlogCard
248249 key = {post .path }
249- previewImg = ?{post .frontmatter .previewImg -> Null .toOption }
250+ previewImg = ?{post .frontmatter .previewImg -> Nullable .toOption }
250251 title = post .frontmatter .title
251252 author = post .frontmatter .author
252253 ?badge
253254 date = {post .frontmatter .date -> DateStr .toDate }
254- slug = {BlogApi .blogPathToSlug (post .path )}
255+ // TODO RR7 format blog urls
256+ slug = {` /${encodeURI(post.frontmatter.title)}` }
255257 />
256258 })-> React .array }
257259 </div >
@@ -262,7 +264,6 @@ let make = (~posts: array<BlogApi.post>, ~category: category): React.element =>
262264 postsBox
263265 </>
264266 }
265-
266267 <>
267268 <div className = "hidden sm:flex justify-center " >
268269 <div className = "my-16 w-full max-w-48" >
@@ -298,15 +299,6 @@ let make = (~posts: array<BlogApi.post>, ~category: category): React.element =>
298299 </>
299300}
300301
301- // let getStaticProps_All: Next.GetStaticProps.t<props, params> = async _ctx => {
302- // let props = {
303- // posts: BlogApi.getLivePosts(),
304- // category: All,
305- // }
306-
307- // {"props": props}
308- // }
309-
310302// let getStaticProps_Archived: Next.GetStaticProps.t<props, params> = async _ctx => {
311303// let props = {
312304// posts: BlogApi.getArchivedPosts(),
0 commit comments