4.0.0 • Published 11 days ago

rescript-pages v4.0.0

Weekly downloads
95
License
MIT
Repository
-
Last release
11 days 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

11 days ago

3.1.0

1 year ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

3.0.0-beta1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.3.0

3 years ago

0.2.1-O

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.5

3 years ago

0.2.3

3 years ago

0.2.4

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.38

3 years ago

0.1.39

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.1.30

3 years ago

0.1.31

3 years ago

0.1.32

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.26

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.20

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago