2015-10-18 18:33:01 +02:00
|
|
|
hugo
|
|
|
|
====
|
2015-10-18 17:42:14 +02:00
|
|
|
|
2015-10-18 18:33:01 +02:00
|
|
|
![](https://badge.imagelayers.io/vimagick/hugo:latest.svg)
|
2015-10-18 17:42:14 +02:00
|
|
|
|
|
|
|
[hugo][1] makes the web fun again.
|
|
|
|
|
|
|
|
## Directory Tree
|
|
|
|
|
|
|
|
```
|
|
|
|
~/fig/hugo/
|
|
|
|
|-- docker-compose.yml
|
|
|
|
`-- www/
|
|
|
|
`-- themes/
|
|
|
|
`-- hyde/
|
|
|
|
```
|
|
|
|
|
|
|
|
## docker-compose.yml
|
|
|
|
|
|
|
|
```
|
|
|
|
hugo:
|
2015-10-18 18:33:01 +02:00
|
|
|
image: vimagick/hugo
|
2015-10-18 17:42:14 +02:00
|
|
|
command: >
|
|
|
|
server --bind=0.0.0.0
|
|
|
|
--port=80
|
2016-05-01 03:06:20 +02:00
|
|
|
--baseUrl=http://blog.easypi.info/
|
2015-10-18 17:42:14 +02:00
|
|
|
--theme=hyde
|
|
|
|
--watch
|
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
volumes:
|
|
|
|
- ./www:/www
|
|
|
|
restart: always
|
|
|
|
```
|
|
|
|
|
2015-10-18 18:18:11 +02:00
|
|
|
> **WARNING:** `hugo server` is for testing purpose.
|
|
|
|
> The default value of `--baseUrl` option is `http://<bind>:<port>/`.
|
|
|
|
> I set it to the same value as that in `config.toml` here.
|
|
|
|
> It maybe not a good practice.
|
|
|
|
|
2015-10-18 17:42:14 +02:00
|
|
|
## Up and Running
|
|
|
|
|
|
|
|
```
|
2015-10-18 18:33:01 +02:00
|
|
|
$ alias hugo='docker run --rm -v `pwd`:/www vimagick/hugo'
|
2015-10-18 18:37:26 +02:00
|
|
|
|
2015-10-18 17:42:14 +02:00
|
|
|
$ cd ~/fig/hugo/www
|
|
|
|
$ curl -L https://github.com/spf13/hyde/archive/master.tar.gz | tar xz --strip 1 -C ./themes/hyde/
|
2015-10-18 18:18:11 +02:00
|
|
|
|
2015-10-18 17:42:14 +02:00
|
|
|
$ hugo new site .
|
|
|
|
$ vim config.toml
|
2015-10-18 18:18:11 +02:00
|
|
|
|
2015-10-18 17:42:14 +02:00
|
|
|
$ hugo new post/hello-world.md
|
|
|
|
$ vim content/post/hello-world.md
|
2015-10-18 18:18:11 +02:00
|
|
|
|
2015-10-18 17:42:14 +02:00
|
|
|
$ docker-compose up -d
|
2015-10-18 18:18:11 +02:00
|
|
|
|
|
|
|
$ hugo
|
2015-10-18 17:42:14 +02:00
|
|
|
```
|
|
|
|
|
2015-10-18 18:18:11 +02:00
|
|
|
> The last `hugo` command will use `baseurl` in `config.toml`.
|
|
|
|
|
2016-05-01 03:06:20 +02:00
|
|
|
Open <http://blog.easypi.info/> in your browser!
|
2015-10-18 17:42:14 +02:00
|
|
|
|
|
|
|
[1]: http://gohugo.io/
|