4.0.0 • Published 1 year ago

rescript-pages v4.0.0

Weekly downloads
95
License
MIT
Repository
-
Last release
1 year ago

ReScript Pages

Yet another static website generator

Key features

  • Markdown collection based content: Write markdown files in directories, the directories become collections, the files become items
  • Completely over-engineered: generates a Single-Page-Application that kicks in after the initial load, loading the minimum delta to transition to the next page
  • Simple API: you basically have two hooks to get data:
    • useItem(collection, ~id),
    • useCollection(collection, ~page=1, ~direction=#desc)
  • Pagination: You define the page size in your config, the generator creates the correct pagination
  • RSS & Sitemap generation
  • i18n support

Installation

$ yarn add rescript-pages

Usage

Create an entry file with a default export with your configuration:

let default = Pages.make(
  App.make,
  {
    siteTitle: "Title",
    siteDescription: "Description",
    distDirectory: "dist",
    baseUrl: "https://example.url",
    staticsDirectory: Some("public"),
    paginateBy: 20,
    variants: [
      {
        subdirectory: None,
        localeFile: None,
        contentDirectory: "contents",
        getUrlsToPrerender: ({getAll, getPages}) =>
          Array.concatMany([
            ["/"],
            getAll("pages")->Array.map(slug => `/${slug}`),
            getAll("posts")->Array.map(slug => `/post/${slug}`),
            ["/posts"],
            getPages("posts")->Array.map(page => `/posts/${page->Int.toString}`),
            ["404.html"],
          ]),
      },
    ],
  },
)

We provide two commands:

  • start: starts a dev server
  • build: builds the website
$ pages start entry.bs.js
$ pages build entry.bs.js
4.0.0

1 year ago

3.1.0

2 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

3.0.0-beta1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.5.3

4 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.3.0

5 years ago

0.2.1-O

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.5

5 years ago

0.2.3

5 years ago

0.2.4

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.38

5 years ago

0.1.39

5 years ago

0.1.33

5 years ago

0.1.34

5 years ago

0.1.35

5 years ago

0.1.36

5 years ago

0.1.37

5 years ago

0.1.30

5 years ago

0.1.31

5 years ago

0.1.32

5 years ago

0.1.27

5 years ago

0.1.28

5 years ago

0.1.29

5 years ago

0.1.26

5 years ago

0.1.24

5 years ago

0.1.25

5 years ago

0.1.21

5 years ago

0.1.22

5 years ago

0.1.23

5 years ago

0.1.20

5 years ago

0.1.14

5 years ago

0.1.15

5 years ago

0.1.16

5 years ago

0.1.17

5 years ago

0.1.18

5 years ago

0.1.19

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago