Skip to content

Commit

Permalink
Add build function to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Noah committed May 6, 2020
1 parent 0856c1c commit 2f9dd97
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Generates an optimized static website.
- [Command-Line Interface (CLI)](#command-line-interface-cli)
- [Library](#library)
- [Importing](#importing)
- [`build()`](#build)
- [`renderPage(pagePath, data, callback)`](#renderpagepagepath-data-callback)
- [`getData()`](#getdata)
- [Understanding How Data is Collected and Used](#understanding-how-data-is-collected-and-used)
Expand Down Expand Up @@ -82,6 +83,17 @@ const staticSiteGenerator = require("@the-noah/static-site-generator");
import * as staticSiteGenerator from "@the-noah/static-site-generator";
```

### `build()`

Renders all pages in `options.srcDir` and saves them in `build`, as well as copies all files from `options.srcDir/static` to `build`.

**Returns** `void`

**Example**
```TypeScript
staticSiteGenerator.build();
```

### `renderPage(pagePath, data, callback)`

Renders the page found at `pagePath` with the data `data` and calls `callback` with the resulting minified HTML.
Expand Down

0 comments on commit 2f9dd97

Please sign in to comment.