2013-07-06 19:36:30 -04:00
---
2014-05-29 18:42:05 -04:00
aliases:
- /doc/contributing/
- /meta/contributing/
2016-01-06 17:45:19 -05:00
lastmod: 2015-05-25
2014-05-29 18:42:05 -04:00
date: 2013-07-01
2014-04-23 03:00:11 -04:00
menu:
main:
2014-05-29 18:42:05 -04:00
parent: community
2015-01-12 06:08:20 -05:00
next: /tutorials/automated-deployments
2015-05-25 11:54:22 -04:00
prev: /community/mailing-list
2014-05-29 18:42:05 -04:00
title: Contributing to Hugo
weight: 30
2013-07-08 17:57:01 -04:00
---
2013-07-04 11:32:55 -04:00
2014-08-31 07:08:36 -04:00
All contributions to Hugo are welcome. Whether you want to scratch an itch, or simply contribute to the project, feel free to pick something from the roadmap
2015-01-27 21:17:09 -05:00
or contact [spf13 ](http://spf13.com/ ) about what may make sense
2014-05-27 18:32:57 -04:00
to do next.
You should fork the project and make your changes. *We encourage pull requests to discuss code changes.*
2013-08-03 03:30:34 -04:00
2013-12-10 22:23:20 -05: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.
2015-01-17 02:45:53 -05:00
* Make sure `go test ./...` passes, and `go build` completes. Our [Travis CI loop ](https://travis-ci.org/spf13/hugo ) 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.
2013-12-10 22:23:20 -05:00
## Contribution Overview
2013-12-10 19:38:52 -05:00
1. Fork Hugo from https://github.com/spf13/hugo
2013-07-04 11:32:55 -04:00
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
2013-12-10 19:38:52 -05:00
4. Commit passing tests to validate changes.
2013-12-10 22:23:20 -05:00
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-12-10 19:38:52 -05:00
2013-08-03 03:30:34 -04:00
2013-12-10 19:38:52 -05:00
# Building from source
2013-08-03 03:30:34 -04:00
2014-01-28 23:29:05 -05:00
## Clone locally (for contributors):
2013-08-03 03:30:34 -04:00
git clone https://github.com/spf13/hugo
cd hugo
go get
2014-08-31 07:08:36 -04:00
Because Go expects all of your libraries to be found in either
2014-12-27 02:50:08 -05:00
`$GOROOT` or `$GOPATH` , it's helpful to symlink the project to one
2013-08-03 03:30:34 -04:00
of the following paths:
2014-12-27 02:50:08 -05:00
* `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`
2013-08-03 03:30:34 -04:00
2014-01-28 23:29:05 -05:00
## Running Hugo
2013-08-03 03:30:34 -04:00
cd /path/to/hugo
2014-05-06 02:51:16 -04:00
go install github.com/spf13/hugo/hugo
2013-08-03 03:30:34 -04:00
go run main.go
2014-01-28 23:29:05 -05:00
## Building Hugo
2013-08-03 03:30:34 -04:00
cd /path/to/hugo
go build -o hugo main.go
mv hugo /usr/local/bin/