hugo/docs/content/community/contributing.md

59 lines
2 KiB
Markdown
Raw Normal View History

2013-07-06 23:36:30 +00:00
---
title: "Contributing to Hugo"
2013-08-17 12:34:25 +00:00
date: "2013-07-01"
aliases: ["/doc/contributing/", "/meta/contributing/"]
groups: ["community"]
groups_weight: 30
---
2013-07-04 15:32:55 +00:00
We welcome all contributions. Feel free to pick something from the roadmap
2013-08-17 12:34:25 +00:00
or contact [spf13](http://spf13.com) about what may make sense
to do next. Go ahead and fork the project and make your changes. *We encourage pull requests to discuss code changes.*
2013-08-03 07:30:34 +00:00
When you're ready to create a pull request, be sure to:
* Have test cases for the new code. If you have questions about how to do it, please ask in your pull request.
* Run `go fmt`
* Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request.
* Make sure `go test ./...` passes, and go build completes. Our Travis CI loop will catch most things that are missing. The exception: Windows. We run on windows from time to time, but if you have access please check on a Windows machine too.
## Contribution Overview
1. Fork Hugo from https://github.com/spf13/hugo
2013-07-04 15:32:55 +00:00
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Commit passing tests to validate changes.
5. Run `go fmt`
6. Squash commits into a single (or logically grouped) commits (`git rebase -i`)
7. Push to the branch (`git push origin my-new-feature`)
8. Create new Pull Request
2013-08-03 07:30:34 +00:00
# Building from source
2013-08-03 07:30:34 +00:00
## Clone locally (for contributors):
2013-08-03 07:30:34 +00:00
git clone https://github.com/spf13/hugo
cd hugo
go get
2013-08-17 12:34:25 +00:00
Because go expects all of your libraries to be found in either
$GOROOT or $GOPATH, it's helpful to symlink the project to one
2013-08-03 07:30:34 +00:00
of the following paths:
* ln -s /path/to/your/hugo $GOPATH/src/github.com/spf13/hugo
* ln -s /path/to/your/hugo $GOROOT/src/pkg/github.com/spf13/hugo
## Running Hugo
2013-08-03 07:30:34 +00:00
cd /path/to/hugo
go install github.com/spf13/hugo/hugolibs
go run main.go
## Building Hugo
2013-08-03 07:30:34 +00:00
cd /path/to/hugo
go build -o hugo main.go
mv hugo /usr/local/bin/