Skip to content

Commit

Permalink
📝 Add site command
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary authored Oct 27, 2019
1 parent 8b3a299 commit e7b55b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ Alternately, you can add the package as a `devDependency`:
npm install @staart/site --save-dev
```

And then use the `generate` function:
Then, run the `site` command to generate your static site:

```bash
npm run site
```

Or programmatically use the `generate` function:

```ts
import { generate } from "@staart/site";
Expand All @@ -47,14 +53,15 @@ generate({ /* options */ })

## 🛠️ Configuration

You can create a `.staartrc` file or another [Cosmiconfig](https://github.com/davidtheclark/cosmiconfig)-compatible configuration file, like `staart.config.js`.
You can create a `.staartrc` file or another [Cosmiconfig](https://github.com/davidtheclark/cosmiconfig)-compatible configuration file, like `staart.config.js` or the `staart` key in `package.json`. You can also supply these options as an object parameter to the `generate` function.

| Option | Description | Default |
| ------ | ----------- | ------- |
| `title` | Name of the site | `Staart Site` |
| `repo` | URL to git repository | `repository` key in `package.json` |
| `contentDir` | Folder with markdown content | `./content` |
| `distDir` | Output directory | `./public` |
| `assetsDir` | Static assets directory | `./assets` |
| `templatePath` | HTML template file path | `./index.html` |
| `stylePath` | Scss stylesheet path | `style.scss` |
| `homePath` | Markdown file path for homepage | `README.md` |
Expand All @@ -73,6 +80,7 @@ You can create a `.staartrc` file or another [Cosmiconfig](https://github.com/da
| `noHome` | Don't generate `index.html` | `false` |
| `noSitemap` | Don't generate sitemaps | `false` |
| `noContentList` | Don't add content lists | `false` |
| `noDelayWithoutToken` | Don't delay GitHub API requests | `false` |

Staart Site also uses the `repository` and `author` fields for copyright/last modified information, but you can overwrite them using the configuration above.

Expand Down

1 comment on commit e7b55b3

@vercel
Copy link

@vercel vercel bot commented on e7b55b3 Oct 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.