Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"projectName": "create-static-site",
"projectOwner": "forestryio",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"contributors": [
{
"login": "chrisdmacrae",
"name": "chrisdmacrae",
"avatar_url": "https://avatars2.githubusercontent.com/u/6855186?v=4",
"profile": "https://github.com/chrisdmacrae",
"contributions": [
"question",
"code",
"design",
"doc",
"example",
"ideas",
"review",
"talk",
"tool",
"tutorial"
]
},
{
"login": "ncphillips",
"name": "NCPhillips",
"avatar_url": "https://avatars2.githubusercontent.com/u/824015?v=4",
"profile": "https://github.com/ncphillips",
"contributions": [
"question",
"bug",
"code",
"doc",
"example",
"ideas",
"infra",
"review",
"talk",
"test",
"tool"
]
}
]
}
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,18 @@ cd my-app
8. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.

Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- --tag next` instead of `npm run publish`.

## Adding Yourself to Contributors
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome.

The following convenience scripts are available:

- `npm run contributors:check`: see if there's any contributors who haven't added themselves to the project
- `npm run contributors:add <github_username> <contribution_types...>`: add a contributor and specify how they have contributed. [See the key](https://github.com/kentcdodds/all-contributors#emoji-key) for contribution types.
- `npm run contributors:generate`: automatically update the table in [`README.md`](/README.md)

For example, to add yourself (if your username was @forestryio) simply run:

```
npm run contributors:add forestryio code,documentation,examples
```
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)

# Create Static Site

Expand Down Expand Up @@ -109,12 +110,23 @@ Currently, `create-static-site` supports two static site generators:

- [**Jekyll**](https://jekyllrb.com) is the static site generator written in Ruby and created by [GitHub](https://github.com) founder, Tom Preston Werner.
- [**Hugo**](https://gohugo.io) is the static site generator written in GoLang and created by Steve Francia.

cd
## Contributing

We'd love to have your helping hand on `create-static-site`! See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on what we're looking for and how to get started.

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars2.githubusercontent.com/u/6855186?v=4" width="100px;"/><br /><sub><b>chrisdmacrae</b></sub>](https://github.com/chrisdmacrae)<br />[💬](#question-chrisdmacrae "Answering Questions") [💻](https://github.com/forestryio/create-static-site/commits?author=chrisdmacrae "Code") [🎨](#design-chrisdmacrae "Design") [📖](https://github.com/forestryio/create-static-site/commits?author=chrisdmacrae "Documentation") [💡](#example-chrisdmacrae "Examples") [🤔](#ideas-chrisdmacrae "Ideas, Planning, & Feedback") [👀](#review-chrisdmacrae "Reviewed Pull Requests") [📢](#talk-chrisdmacrae "Talks") [🔧](#tool-chrisdmacrae "Tools") [✅](#tutorial-chrisdmacrae "Tutorials") | [<img src="https://avatars2.githubusercontent.com/u/824015?v=4" width="100px;"/><br /><sub><b>NCPhillips</b></sub>](https://github.com/ncphillips)<br />[💬](#question-ncphillips "Answering Questions") [🐛](https://github.com/forestryio/create-static-site/issues?q=author%3Ancphillips "Bug reports") [💻](https://github.com/forestryio/create-static-site/commits?author=ncphillips "Code") [📖](https://github.com/forestryio/create-static-site/commits?author=ncphillips "Documentation") [💡](#example-ncphillips "Examples") [🤔](#ideas-ncphillips "Ideas, Planning, & Feedback") [🚇](#infra-ncphillips "Infrastructure (Hosting, Build-Tools, etc)") [👀](#review-ncphillips "Reviewed Pull Requests") [📢](#talk-ncphillips "Talks") [⚠️](https://github.com/forestryio/create-static-site/commits?author=ncphillips "Tests") [🔧](#tool-ncphillips "Tools") |
| :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

## Acknowledgements

This project is greatly inspired by the wonderful [create-react-app](https://github.com/facebookincubator/create-react-app/) project.
This project is greatly inspired by the wonderful [create-react-app](https://github.com/facebookincubator/create-react-app/) project.
8 changes: 8 additions & 0 deletions docs/env-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
---
## Environment Variables

| Title | Var | Description | Default |
| -- | -- | -- | -- |
| Generator Arguments | `GENERATOR_ARGS` | Override the arguments used to build the the site, as defined in `static-scripts.config.js`. Useful for defining your own custom build commands using different options| `process.env.NODE_ENV` |
| Generate Sourcemaps | `GENERATE_SOURCEMAPS` | Set whether or not sourcemaps should be generated for JS and CSS in production builds. You may not want this behaviour if you have large bundles, as it's a costly operation. | `true` |
46 changes: 46 additions & 0 deletions docs/static-scripts-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
---
## Configuration
For all intents and purposes, `create-static-site` is a zero configuration build tool for static sites.

**However**, we acknowledge that many static site generators have widely varying configurations, and may require you to alter the configuration of `create-static-site` slightly to make things work properly.

A limited API is available via `static-scripts.config.js`:

## Options

| Title | Var | Description | Default |
| -- | -- | -- | -- |
| Generator | `generator`, `String` | The name of the generator to display in logs in sdout. | `Generator` |
| Command | `command`, `String` | Specifying the command line command to run your generators builds. | `null` |
| Directories | `directories`, `Object` | Configurable paths for the project | `dist/` |
| Source directory | `directories.src`, `String` | The path where source files should be stored | `src/` |
| Build directory | `directories.build`, `String` | The path where all built assets should be stored | `dist/` |
| Static directory | `directories.static`, `String` | The path where static files should be moved during a build | `dist/` |
| Generator directory | `directories.static`, `String` | The path where the content/configuration of your generator is stored. | `site/` |
| Proxy | `proxy`, `String` | The URL to which the built-in BrowserSync server should proxy instead of running its own server | `false` |
| Args | `args`, `Object` | An object containing arrays of build command arguments. They are selected based on the `GENERATOR_ARGS` [environment variable](./env-variables.md). | [See reference below](#reference) |

### Reference

```
import {resolve} from "path"

module.exports = {
generator: "GENERATOR_NAME", // e.g, "Hugo"
command: "GENERATOR_PRIMARY_COMMAND", // e.g, require("hugo-bin"),
proxy: false,
args: {
default: ["--verbose", "--source", resolve("site/"), "--destination", resolve("dist/")],
development: ["--baseDir", "http://localhost:3000", "--buildDrafts", "--buildFuture", "--buildExpired"]
production: [],
custom: ["--incremental"]
},
directories: {
src: "src/",
build: "dist/",
static: "dist/",
generator: "site/"
}
}
```
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
"install-create-static-site": "./tasks/install-ctp.sh",
"publish": "lerna publish",
"postinstall": "lerna bootstrap",
"next": "lerna publish --npm-tag=next"
"next": "lerna publish --npm-tag=next",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate",
"contributors:check": "all-contributors check"
},
"devDependencies": {
"all-contributors-cli": "^4.11.0",
"lerna": "^2.5.1",
"lerna-changelog": "^0.7.0",
"prettier": "^1.9.2"
Expand Down
Loading