# Building Hugo with the latest version of Chroma

**URL:** https://discourse.gohugo.io/t/building-hugo-with-the-latest-version-of-chroma/8543
**Category:** tips & tricks
**Created:** [September 27, 2017, 2:42pm UTC](https://discourse.gohugo.io/t/building-hugo-with-the-latest-version-of-chroma/8543 "2017-09-27T14:42:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)
#### Post date: [September 27, 2017, 2:42pm UTC](https://discourse.gohugo.io/t/building-hugo-with-the-latest-version-of-chroma/8543/1 "2017-09-27T14:42:46Z")

</div>

Hello all,

I thought this might be useful to any non-Go developer who wants to build Hugo from master branch, including the latest version of Chroma too (assuming that the heads of both branches are compatible with each other).

## hugo\_update.sh

> <https://gist.github.com/kaushalmodi/456b5ea26b3e869e5d63d4a67b85f676>

Doing `hugo version` will then print:

> Hugo Static Site Generator v0.30-DEV-A354D130:CHROMA-33F604C8 linux/amd64 BuildDate: 2017-09-27T10:25:05-04:00

The script works great, but I’d like to know if there’s a way to optimize this piece in there:

```bash
# Tue Sep 26 11:28:47 EDT 2017 - kmodi
# Turns out that the chroma package contains sub-packages too.. so have to
# include all separately.
govendor fetch github.com/alecthomas/chroma
govendor fetch github.com/alecthomas/chroma/formatters
govendor fetch github.com/alecthomas/chroma/formatters/html
govendor fetch github.com/alecthomas/chroma/lexers
govendor fetch github.com/alecthomas/chroma/styles

```

---

<div class="post-metadata">

### Author: ![moorereason](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/moorereason/32/592_2.png) [@moorereason](https://discourse.gohugo.io/u/moorereason)
#### Post date: [September 27, 2017, 5:02pm UTC](https://discourse.gohugo.io/t/building-hugo-with-the-latest-version-of-chroma/8543/2 "2017-09-27T17:02:13Z")

</div>

If you have a working Go environment, just delete the vendored package.

```auto
go get -u github.com/alecthomas/chroma/...
cd $GOPATH/src/github.com/gohugoio/hugo
make vendor
rm -rf vendor/github.com/alecthomas/chroma

```

---

<div class="post-metadata">

### Author: ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)
#### Post date: [September 27, 2017, 8:27pm UTC](https://discourse.gohugo.io/t/building-hugo-with-the-latest-version-of-chroma/8543/3 "2017-09-27T20:27:16Z")

</div>

> [@moorereason](#):
>
> make vendor

I don’t need `make vendor` as I am doing `govendor sync`, right?

---

<div class="post-metadata">

### Author: ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)
#### Post date: [September 27, 2017, 8:32pm UTC](https://discourse.gohugo.io/t/building-hugo-with-the-latest-version-of-chroma/8543/4 "2017-09-27T20:32:05Z")

</div>

Thanks for that suggestion… I have updated the above gist with that… looks like I didn’t need `make vendor` as I am doing `govendor sync`. Let me know if I am overlooking something by doing that.
