1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 08:39:01 +01:00
gojekyll/CONTRIBUTING.md

63 lines
1.8 KiB
Markdown
Raw Normal View History

2017-07-05 17:18:00 +02:00
# Contributing
2017-07-05 20:27:24 +02:00
Here's some ways to help:
2017-07-05 17:18:00 +02:00
2017-07-07 15:36:10 +02:00
* Try using gojekyll on your site. Use this as fodder for test cases.
2017-07-10 01:20:26 +02:00
* Choose an item to work on from the [issues list](https://github.com/osteele/gojekyll/issues).
2017-07-07 15:36:10 +02:00
* Search the sources for FIXME and TODO comments.
2017-07-05 20:27:24 +02:00
* Improve the [code coverage](https://coveralls.io/github/osteele/gojekyll?branch=master).
2017-07-05 17:18:00 +02:00
2017-07-05 20:33:41 +02:00
If you choose to contribute code, please review the [pull request template](https://github.com/osteele/gojekyll/blob/master/.github/PULL_REQUEST_TEMPLATE.md) before you get too far along.
2017-07-05 17:18:00 +02:00
## Developer Cookbook
### Set up your machine
Fork and clone the repo.
2021-06-16 09:48:07 +02:00
[Install go](https://golang.org/doc/install#install). On macOS running Homebrew,
`brew install go` is easier than the linked instructions.
2017-07-05 17:18:00 +02:00
Install package dependencies and development tools:
```bash
2017-07-13 02:01:17 +02:00
make setup
2017-07-05 17:18:00 +02:00
go get -t ./...
```
2021-06-16 09:48:07 +02:00
[Install golangci-lint](https://golangci-lint.run/usage/install/#local-installation).
On macOS: `brew install golangci-lint`
2017-07-05 17:18:00 +02:00
### Test and Lint
```bash
make test
make lint
```
### Debugging tools
```bash
gojekyll -s path/to/site render index.md # render a file to stdout
gojekyll -s path/to/site render page.md # render a file to stdout
gojekyll -s path/to/site render / # render a URL to stdout
gojekyll -s path/to/site variables / # print a file or URL's variables
gojekyll -s path/to/site variables site # print the site variables
gojekyll -s path/to/site variables site.twitter.name # print a specific site variable
```
`./scripts/gojekyll` is an alternative to the `gojekyll` executable, that uses `go run` each time it's invoked.
### Coverage
```bash
./scripts/coverage && go tool cover -html=coverage.out
```
### Profiling
```bash
2017-07-09 21:55:12 +02:00
gojekyll -s path/to/site benchmark
go tool pprof --web gojekyll gojekyll.prof
2017-07-05 17:18:00 +02:00
```