ReScript Pages

HomeShowcaseDocsGitHub
A dead-simple static website generator

Markdown-based

Just write markdown files in directories! The directories become collections, the markdown files items.

---
title: My post
date: 2020-11-20
---

Hello!

React-powered

When the client boots, there's no subsequent page reload, it only fetches the missing data to navigate to the next page (but it works without JS!).

@react.component
let make = (~url, ~config) => {
  /* your app */
}

Simple API

You only need two hooks to access the data from your markdown files. At build time, the system knows what you read from your components.

/* items */
Pages.useItem(collection, ~id)
/* collections */
Pages.useCollection(collection)

Pagination

You define the page size in your config, the generator creates the correct paginated pages & API endpoints.

Pages.useCollection(
  collection,
  ~page=1,
  ~direction=#asc
)

Great SEO

ReScript Pages automatically generates a sitemap, and RSS feeds are created for each collection.

<Pages.Head>
  <title>
    {post.title->React.string}
  </title>
</Pages.Head>

Internationalization

A ReScript Pages config contains variants. Each variant can specify its content source, destination path and locales. You simply provide the dictionnary.

Pages.t("Hello")
/* "Hello" in english */
/* "Bonjour" in french */
Copyright 2021 - Matthias Le Brun