mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-01 19:22:38 +00:00
Compare commits
131 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bbd33dbf5d | |||
| 0e09be7b3c | |||
| 195f945758 | |||
| 44b8f740e9 | |||
| a48e132345 | |||
| 7f82b41a24 | |||
| 84db6c74a0 | |||
| e0cf2e05bb | |||
| dbbc5c4810 | |||
| 7bcc1ce659 | |||
| fd41e70cff | |||
| 4ec8ee7fb1 | |||
| 1e19a98451 | |||
| 6fb556367b | |||
| 51bcd5083c | |||
| 6e086e3d03 | |||
| 5895e32b0a | |||
| b2dcd867fd | |||
| d2c24baafe | |||
| 4989950d49 | |||
| a358b33f26 | |||
| a392fca962 | |||
| 75f782f035 | |||
| e00f5c9c07 | |||
| 37c69054e2 | |||
| 477684022f | |||
| 70d8ddcb60 | |||
| 5f831a6223 | |||
| e7a54e7afc | |||
| aa6b1b9be7 | |||
| a1d260b41a | |||
| dd9b1baab0 | |||
| 1039356edf | |||
| ccdd08d57a | |||
| d12cf5a25d | |||
| e10e51a008 | |||
| 34c566773a | |||
| 41805dca9e | |||
| 7ee1f25e9e | |||
| 3aa0e16d0c | |||
| b3c8056de2 | |||
| fe132e1c3e | |||
| 8431c8d39d | |||
| da72805a43 | |||
| 72fd871710 | |||
| 118f8f7cf2 | |||
| 56d82aa025 | |||
| eccb064782 | |||
| 2e1e4934b6 | |||
| a54404968a | |||
| bfce30d859 | |||
| 30e14cc316 | |||
| c825a73121 | |||
| 7198ea8a1e | |||
| dd78d5b23f | |||
| a7765bb3c1 | |||
| 31393f6024 | |||
| aff1ac3235 | |||
| b463c5ad86 | |||
| 1a041522df | |||
| 3aade08977 | |||
| 0e1bda34c3 | |||
| 2e4ccd3d34 | |||
| fd924d1802 | |||
| e908d955d2 | |||
| 8b620f7a8a | |||
| 12611e0c64 | |||
| 58ce9213c0 | |||
| ae3039b6e8 | |||
| 3554fd1218 | |||
| 1ac4dbb900 | |||
| 8f69fe57a4 | |||
| f8c5716adf | |||
| 2ba9a8769f | |||
| c43b512b47 | |||
| 19f2e72913 | |||
| 0f40e1fadf | |||
| 516e6c6dc5 | |||
| 3183b9a29d | |||
| 1a282ee432 | |||
| fb53987a4f | |||
| 662e12f348 | |||
| 422057f607 | |||
| 4aa1239070 | |||
| 411ac93086 | |||
| 4345026bd6 | |||
| deffb4c3d9 | |||
| 12b844daf0 | |||
| b502b9d8cc | |||
| 781a1539cc | |||
| af85eb62b4 | |||
| 882b2b61fc | |||
| 00e2fe077a | |||
| ccb8300d38 | |||
| 214dbdfb6f | |||
| 729be8074b | |||
| 6cee0dfe53 | |||
| 8be3934b59 | |||
| fbb25014e1 | |||
| bf5e59958d | |||
| 86543d6a50 | |||
| 3b47805fdd | |||
| e6ae32a0ba | |||
| 5103935ae8 | |||
| 95386544e8 | |||
| 7b99fb9f1c | |||
| d531d17b3b | |||
| 9266bf9d4c | |||
| 873a6f1885 | |||
| f503d76a3b | |||
| 93643860c9 | |||
| db46bcf82d | |||
| 66d4850b89 | |||
| 715ff1f874 | |||
| c17ad675e8 | |||
| d8717cd4c7 | |||
| 2d08a296a2 | |||
| a9e551a100 | |||
| 2aafb24766 | |||
| 4bd5ce7ef3 | |||
| 0f78dd06a4 | |||
| 714594a8b7 | |||
| dce70fb7c5 | |||
| c84079baa9 | |||
| a30023f5cb | |||
| 1f26420d39 | |||
| ff54b6bddc | |||
| 629e1439e8 | |||
| 26aa06a3db | |||
| 52a0cea65d | |||
| 8ca586a6e5 |
+10
@@ -0,0 +1,10 @@
|
||||
# See https://github.com/blog/2392-introducing-code-owners
|
||||
|
||||
# These owners will be the default owners for everything in the repo.
|
||||
* @bep
|
||||
|
||||
tpl/* @moorereason @bep
|
||||
docs/* @digitalcraftsman
|
||||
snapcraft.yaml @anthonyfok
|
||||
Dockerfile @anthonyfok
|
||||
i18n/* @bogem
|
||||
+9
-9
@@ -5,7 +5,7 @@ organization, tutorials, blog posts, bug reports, issues, feature requests,
|
||||
feature implementations, pull requests, answering questions on the forum,
|
||||
helping to manage issues, etc.
|
||||
|
||||
The Hugo community and maintainers are [very active](https://github.com/spf13/hugo/pulse/monthly) and helpful, and the project benefits greatly from this activity. We created a [step by step guide](https://gohugo.io/tutorials/how-to-contribute-to-hugo/) if you're unfamiliar with GitHub or contributing to open source projects in general.
|
||||
The Hugo community and maintainers are [very active](https://github.com/gohugoio/hugo/pulse/monthly) and helpful, and the project benefits greatly from this activity. We created a [step by step guide](https://gohugo.io/tutorials/how-to-contribute-to-hugo/) if you're unfamiliar with GitHub or contributing to open source projects in general.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -22,14 +22,14 @@ The Hugo community and maintainers are [very active](https://github.com/spf13/hu
|
||||
|
||||
## Asking Support Questions
|
||||
|
||||
We have an active [discussion forum](http://discuss.gohugo.io) where users and developers can ask questions.
|
||||
We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions.
|
||||
Please don't use the GitHub issue tracker to ask questions.
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
If you believe you have found a defect in Hugo or its documentation, use
|
||||
the GitHub [issue tracker](https://github.com/spf13/hugo/issues) to report the problem to the Hugo maintainers.
|
||||
If you're not sure if it's a bug or not, start by asking in the [discussion forum](http://discuss.gohugo.io).
|
||||
the GitHub [issue tracker](https://github.com/gohugoio/hugo/issues) to report the problem to the Hugo maintainers.
|
||||
If you're not sure if it's a bug or not, start by asking in the [discussion forum](https://discourse.gohugo.io).
|
||||
When reporting the issue, please provide the version of Hugo in use (`hugo version`) and your operating system.
|
||||
|
||||
## Submitting Patches
|
||||
@@ -48,12 +48,12 @@ To make the contribution process as seamless as possible, we ask for the followi
|
||||
|
||||
* Go ahead and fork the project and make your changes. We encourage pull requests to allow for review and discussion of code changes.
|
||||
* When you’re ready to create a pull request, be sure to:
|
||||
* Sign the [CLA](https://cla-assistant.io/spf13/hugo).
|
||||
* Sign the [CLA](https://cla-assistant.io/gohugoio/hugo).
|
||||
* Have test cases for the new code. If you have questions about how to do this, please ask in your pull request.
|
||||
* Run `go fmt`.
|
||||
* Add documentation if you are adding new features or changing functionality. The docs site lives in `/docs`.
|
||||
* Squash your commits into a single commit. `git rebase -i`. It’s okay to force update your pull request with `git push -f`.
|
||||
* Ensure that `make check` succeeds. [Travis CI](https://travis-ci.org/spf13/hugo) (Linux and macOS) and [AppVeyor](https://ci.appveyor.com/project/spf13/hugo/branch/master) (Windows) will fail the build if `make check` fails.
|
||||
* Ensure that `make check` succeeds. [Travis CI](https://travis-ci.org/gohugoio/hugo) (Linux and macOS) and [AppVeyor](https://ci.appveyor.com/project/gohugoio/hugo/branch/master) (Windows) will fail the build if `make check` fails.
|
||||
* Follow the **Git Commit Message Guidelines** below.
|
||||
|
||||
### Git Commit Message Guidelines
|
||||
@@ -94,7 +94,7 @@ You **must use govendor** to fetch and manage Hugo's dependencies.
|
||||
|
||||
```
|
||||
go get github.com/kardianos/govendor
|
||||
govendor get github.com/spf13/hugo
|
||||
govendor get github.com/gohugoio/hugo
|
||||
```
|
||||
|
||||
### Using Git Remotes
|
||||
@@ -108,7 +108,7 @@ started:
|
||||
1. Change to the Hugo source directory:
|
||||
|
||||
```
|
||||
cd $HOME/go/src/github.com/spf13/hugo
|
||||
cd $HOME/go/src/github.com/gohugoio/hugo
|
||||
```
|
||||
|
||||
1. Create a new branch for your changes (the branch name is arbitrary):
|
||||
@@ -142,7 +142,7 @@ started:
|
||||
### Build Hugo with Your Changes
|
||||
|
||||
```bash
|
||||
cd $HOME/go/src/github.com/spf13/hugo
|
||||
cd $HOME/go/src/github.com/gohugoio/hugo
|
||||
make hugo
|
||||
# or to install in $HOME/go/bin:
|
||||
make install
|
||||
|
||||
+21
-9
@@ -1,15 +1,27 @@
|
||||
FROM golang:1.8-alpine
|
||||
FROM golang:alpine3.6
|
||||
|
||||
ENV GOPATH /go
|
||||
ENV USER root
|
||||
|
||||
RUN apk update && apk add git make
|
||||
RUN \
|
||||
adduser -h /site -s /sbin/nologin -u 1000 -D hugo && \
|
||||
apk add --no-cache dumb-init && \
|
||||
apk add --no-cache --virtual .build-deps \
|
||||
git \
|
||||
make && \
|
||||
go get github.com/kardianos/govendor && \
|
||||
govendor get github.com/gohugoio/hugo && \
|
||||
cd $GOPATH/src/github.com/gohugoio/hugo && \
|
||||
make install test && \
|
||||
rm -rf $GOPATH/src/* && \
|
||||
apk del .build-deps
|
||||
|
||||
# pre-install known dependencies before the source, so we don't redownload them whenever the source changes
|
||||
RUN go get github.com/kardianos/govendor \
|
||||
&& govendor get github.com/spf13/hugo
|
||||
USER hugo
|
||||
|
||||
COPY . $GOPATH/src/github.com/spf13/hugo
|
||||
WORKDIR /site
|
||||
|
||||
EXPOSE 1313
|
||||
|
||||
ENTRYPOINT ["/usr/bin/dumb-init", "--", "hugo"]
|
||||
|
||||
CMD [ "--help" ]
|
||||
|
||||
RUN cd $GOPATH/src/github.com/spf13/hugo \
|
||||
&& make install test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
||||
|
||||
PACKAGE = github.com/spf13/hugo
|
||||
PACKAGE = github.com/gohugoio/hugo
|
||||
COMMIT_HASH = `git rev-parse --short HEAD 2>/dev/null`
|
||||
BUILD_DATE = `date +%FT%T%z`
|
||||
LDFLAGS = -ldflags "-X ${PACKAGE}/hugolib.CommitHash=${COMMIT_HASH} -X ${PACKAGE}/hugolib.BuildDate=${BUILD_DATE}"
|
||||
@@ -50,14 +50,14 @@ test-race: ## Run tests with race detector
|
||||
govendor test -race +local
|
||||
|
||||
fmt: ## Run gofmt linter
|
||||
@for d in `govendor list -no-status +local | sed 's/github.com.spf13.hugo/./'` ; do \
|
||||
@for d in `govendor list -no-status +local | sed 's/github.com.gohugoio.hugo/./'` ; do \
|
||||
if [ "`gofmt -l $$d/*.go | tee /dev/stderr`" ]; then \
|
||||
echo "^ improperly formatted go files" && echo && exit 1; \
|
||||
fi \
|
||||
done
|
||||
|
||||
lint: ## Run golint linter
|
||||
@for d in `govendor list -no-status +local | sed 's/github.com.spf13.hugo/./'` ; do \
|
||||
@for d in `govendor list -no-status +local | sed 's/github.com.gohugoio.hugo/./'` ; do \
|
||||
if [ "`golint $$d | tee /dev/stderr`" ]; then \
|
||||
echo "^ golint errors!" && echo && exit 1; \
|
||||
fi \
|
||||
@@ -68,7 +68,7 @@ vet: ## Run go vet linter
|
||||
echo "^ go vet errors!" && echo && exit 1; \
|
||||
fi
|
||||
|
||||
test-cover-html: PACKAGES = $(shell govendor list -no-status +local | sed 's/github.com.spf13.hugo/./')
|
||||
test-cover-html: PACKAGES = $(shell govendor list -no-status +local | sed 's/github.com.gohugoio.hugo/./')
|
||||
test-cover-html: ## Generate test coverage report
|
||||
echo "mode: count" > coverage-all.out
|
||||
$(foreach pkg,$(PACKAGES),\
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||

|
||||

|
||||
|
||||
A Fast and Flexible Static Site Generator built with love by [spf13](http://spf13.com/) and [friends](https://github.com/spf13/hugo/graphs/contributors) in [Go][].
|
||||
A Fast and Flexible Static Site Generator built with love by [spf13](http://spf13.com/) and [friends](https://github.com/gohugoio/hugo/graphs/contributors) in [Go][].
|
||||
|
||||
[Website](https://gohugo.io) |
|
||||
[Forum](https://discuss.gohugo.io) |
|
||||
[Developer Chat (no support)](https://gitter.im/spf13/hugo) |
|
||||
[Forum](https://discourse.gohugo.io) |
|
||||
[Developer Chat (no support)](https://gitter.im/gohugoio/hugo) |
|
||||
[Documentation](https://gohugo.io/overview/introduction/) |
|
||||
[Installation Guide](https://gohugo.io/overview/installing/) |
|
||||
[Contribution Guide](CONTRIBUTING.md) |
|
||||
[Twitter](http://twitter.com/gohugoio)
|
||||
|
||||
[](https://godoc.org/github.com/spf13/hugo)
|
||||
[](https://travis-ci.org/spf13/hugo)
|
||||
[](https://ci.appveyor.com/project/spf13/hugo/branch/master)
|
||||
[](https://gitter.im/spf13/hugo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://goreportcard.com/report/github.com/spf13/hugo)
|
||||
[](https://godoc.org/github.com/gohugoio/hugo)
|
||||
[](https://travis-ci.org/gohugoio/hugo)
|
||||
[](https://ci.appveyor.com/project/bep/hugo/branch/master)
|
||||
[](https://gitter.im/spf13/hugo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://goreportcard.com/report/github.com/gohugoio/hugo)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -44,7 +44,7 @@ Hugo may also be compiled from source wherever the Go compiler tool chain can ru
|
||||
If you want to use Hugo as your site generator, simply install the Hugo binaries.
|
||||
The Hugo binaries have no external dependencies.
|
||||
|
||||
To contribute to the Hugo source code or documentation, you should [fork the Hugo GitHub project](https://github.com/spf13/hugo#fork-destination-box) and clone it to your local machine.
|
||||
To contribute to the Hugo source code or documentation, you should [fork the Hugo GitHub project](https://github.com/gohugoio/hugo#fork-destination-box) and clone it to your local machine.
|
||||
|
||||
Finally, you can install the Hugo source code with `go`, build the binaries yourself, and run Hugo that way.
|
||||
Building the binaries is an easy task for an experienced `go` getter.
|
||||
@@ -57,13 +57,13 @@ Use the [installation instructions in the Hugo documentation](https://gohugo.io/
|
||||
|
||||
Add Hugo and its package dependencies to your go `src` directory.
|
||||
|
||||
go get -v github.com/spf13/hugo
|
||||
go get -v github.com/gohugoio/hugo
|
||||
|
||||
Once the `get` completes, you should find your new `hugo` (or `hugo.exe`) executable sitting inside `$GOPATH/bin/`.
|
||||
|
||||
To update Hugo’s dependencies, use `go get` with the `-u` option.
|
||||
|
||||
go get -u -v github.com/spf13/hugo
|
||||
go get -u -v github.com/gohugoio/hugo
|
||||
|
||||
## Contributing to Hugo
|
||||
|
||||
@@ -74,18 +74,18 @@ organization, tutorials, blog posts, bug reports, issues, feature requests,
|
||||
feature implementations, pull requests, answering questions on the forum,
|
||||
helping to manage issues, etc.
|
||||
|
||||
The Hugo community and maintainers are [very active](https://github.com/spf13/hugo/pulse/monthly) and helpful, and the project benefits greatly from this activity.
|
||||
The Hugo community and maintainers are [very active](https://github.com/gohugoio/hugo/pulse/monthly) and helpful, and the project benefits greatly from this activity.
|
||||
|
||||
### Asking Support Questions
|
||||
|
||||
We have an active [discussion forum](http://discuss.gohugo.io) where users and developers can ask questions.
|
||||
We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions.
|
||||
Please don't use the GitHub issue tracker to ask questions.
|
||||
|
||||
### Reporting Issues
|
||||
|
||||
If you believe you have found a defect in Hugo or its documentation, use
|
||||
the GitHub issue tracker to report the problem to the Hugo maintainers.
|
||||
If you're not sure if it's a bug or not, start by asking in the [discussion forum](http://discuss.gohugo.io).
|
||||
If you're not sure if it's a bug or not, start by asking in the [discussion forum](https://discourse.gohugo.io).
|
||||
When reporting the issue, please provide the version of Hugo in use (`hugo version`).
|
||||
|
||||
### Submitting Patches
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ init:
|
||||
- go env
|
||||
|
||||
# clones and cd's to path
|
||||
clone_folder: C:\GOPATH\src\github.com\spf13\hugo
|
||||
clone_folder: C:\GOPATH\src\github.com\gohugoio\hugo
|
||||
|
||||
install:
|
||||
- gem install asciidoctor
|
||||
|
||||
Vendored
+46
@@ -15,6 +15,7 @@ package cache
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -90,3 +91,48 @@ func TestNewPartitionedLazyCache(t *testing.T) {
|
||||
assert.Error(err)
|
||||
|
||||
}
|
||||
|
||||
func TestConcurrentPartitionedLazyCache(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
assert := require.New(t)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
p1 := Partition{
|
||||
Key: "p1",
|
||||
Load: func() (map[string]interface{}, error) {
|
||||
return map[string]interface{}{
|
||||
"p1_1": "p1v1",
|
||||
"p1_2": "p1v2",
|
||||
"p1_nil": nil,
|
||||
}, nil
|
||||
},
|
||||
}
|
||||
|
||||
p2 := Partition{
|
||||
Key: "p2",
|
||||
Load: func() (map[string]interface{}, error) {
|
||||
return map[string]interface{}{
|
||||
"p2_1": "p2v1",
|
||||
"p2_2": "p2v2",
|
||||
"p2_3": "p2v3",
|
||||
}, nil
|
||||
},
|
||||
}
|
||||
|
||||
cache := NewPartitionedLazyCache(p1, p2)
|
||||
|
||||
for i := 0; i < 100; i++ {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for j := 0; j < 10; j++ {
|
||||
v, err := cache.Get("p1", "p1_1")
|
||||
assert.NoError(err)
|
||||
assert.Equal("p1v1", v)
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/spf13/hugo/deps"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
)
|
||||
|
||||
type commandeer struct {
|
||||
|
||||
+3
-3
@@ -19,10 +19,10 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/parser"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
"github.com/spf13/hugo/parser"
|
||||
)
|
||||
|
||||
var outputDir string
|
||||
@@ -136,7 +136,7 @@ func convertContents(mark rune) error {
|
||||
page.SetDir(filepath.Join(contentDir, file.Dir()))
|
||||
page.SetSourceContent(psr.Content())
|
||||
if err = page.SetSourceMetaData(metadata, mark); err != nil {
|
||||
site.Log.ERROR.Printf("Failed to set source metadata for file %q: %s. For more info see For more info see https://github.com/spf13/hugo/issues/2458", page.FullFilePath(), err)
|
||||
site.Log.ERROR.Printf("Failed to set source metadata for file %q: %s. For more info see For more info see https://github.com/gohugoio/hugo/issues/2458", page.FullFilePath(), err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -20,10 +20,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/cobra/doc"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gohugoio/hugo/docshelper"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/docshelper"
|
||||
)
|
||||
|
||||
type genDocsHelper struct {
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/cobra/doc"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
|
||||
+49
-12
@@ -19,33 +19,34 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/hugo/config"
|
||||
"github.com/gohugoio/hugo/config"
|
||||
|
||||
"github.com/spf13/hugo/parser"
|
||||
"github.com/gohugoio/hugo/parser"
|
||||
flag "github.com/spf13/pflag"
|
||||
|
||||
"regexp"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/livereload"
|
||||
"github.com/gohugoio/hugo/utils"
|
||||
"github.com/gohugoio/hugo/watcher"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/fsync"
|
||||
"github.com/spf13/hugo/deps"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
"github.com/spf13/hugo/livereload"
|
||||
"github.com/spf13/hugo/utils"
|
||||
"github.com/spf13/hugo/watcher"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
"github.com/spf13/nitro"
|
||||
"github.com/spf13/viper"
|
||||
@@ -655,7 +656,7 @@ func (c *commandeer) getDirList() []string {
|
||||
}
|
||||
|
||||
// Skip .git directories.
|
||||
// Related to https://github.com/spf13/hugo/issues/3468.
|
||||
// Related to https://github.com/gohugoio/hugo/issues/3468.
|
||||
if fi.Name() == ".git" {
|
||||
return nil
|
||||
}
|
||||
@@ -758,6 +759,10 @@ func (c *commandeer) rebuildSites(events []fsnotify.Event) error {
|
||||
|
||||
// newWatcher creates a new watcher to watch filesystem events.
|
||||
func (c *commandeer) newWatcher(port int) error {
|
||||
if runtime.GOOS == "darwin" {
|
||||
tweakLimit()
|
||||
}
|
||||
|
||||
watcher, err := watcher.New(1 * time.Second)
|
||||
var wg sync.WaitGroup
|
||||
|
||||
@@ -976,8 +981,28 @@ func (c *commandeer) newWatcher(port int) error {
|
||||
}
|
||||
|
||||
if !buildWatch && !c.Cfg.GetBool("disableLiveReload") {
|
||||
// Will block forever trying to write to a channel that nobody is reading if livereload isn't initialized
|
||||
livereload.ForceRefresh()
|
||||
|
||||
navigate := c.Cfg.GetBool("navigateToChanged")
|
||||
|
||||
var p *hugolib.Page
|
||||
|
||||
if navigate {
|
||||
|
||||
// It is probably more confusing than useful
|
||||
// to navigate to a new URL on RENAME etc.
|
||||
// so for now we use the WRITE and CREATE events only.
|
||||
name := pickOneWriteOrCreatePath(dynamicEvents)
|
||||
|
||||
if name != "" {
|
||||
p = Hugo.GetContentPage(name)
|
||||
}
|
||||
}
|
||||
|
||||
if p != nil {
|
||||
livereload.NavigateToPath(p.RelPermalink())
|
||||
} else {
|
||||
livereload.ForceRefresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
case err := <-watcher.Errors:
|
||||
@@ -1002,6 +1027,18 @@ func (c *commandeer) newWatcher(port int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func pickOneWriteOrCreatePath(events []fsnotify.Event) string {
|
||||
name := ""
|
||||
|
||||
for _, ev := range events {
|
||||
if (ev.Op&fsnotify.Write == fsnotify.Write || ev.Op&fsnotify.Create == fsnotify.Create) && len(ev.Name) > len(name) {
|
||||
name = ev.Name
|
||||
}
|
||||
}
|
||||
|
||||
return name
|
||||
}
|
||||
|
||||
func (c *commandeer) isStatic(path string) bool {
|
||||
return strings.HasPrefix(path, c.PathSpec().GetStaticDirPath()) || (len(c.PathSpec().GetThemesDirPath()) > 0 && strings.HasPrefix(path, c.PathSpec().GetThemesDirPath()))
|
||||
}
|
||||
|
||||
+77
-40
@@ -25,13 +25,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/parser"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
"github.com/spf13/hugo/parser"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
@@ -84,9 +84,17 @@ func importFromJekyll(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
forceImport, _ := cmd.Flags().GetBool("force")
|
||||
site, err := createSiteFromJekyll(jekyllRoot, targetDir, forceImport)
|
||||
|
||||
fs := afero.NewOsFs()
|
||||
jekyllPostDirs, hasAnyPost := getJekyllDirInfo(fs, jekyllRoot)
|
||||
if !hasAnyPost {
|
||||
return errors.New("Your Jekyll root contains neither posts nor drafts, aborting.")
|
||||
}
|
||||
|
||||
site, err := createSiteFromJekyll(jekyllRoot, targetDir, jekyllPostDirs, forceImport)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
return newUserError(err)
|
||||
}
|
||||
|
||||
jww.FEEDBACK.Println("Importing...")
|
||||
@@ -110,10 +118,10 @@ func importFromJekyll(cmd *cobra.Command, args []string) error {
|
||||
draft := false
|
||||
|
||||
switch {
|
||||
case strings.HasPrefix(relPath, "_posts/"):
|
||||
relPath = "content/post" + relPath[len("_posts"):]
|
||||
case strings.HasPrefix(relPath, "_drafts/"):
|
||||
relPath = "content/draft" + relPath[len("_drafts"):]
|
||||
case strings.Contains(relPath, "_posts/"):
|
||||
relPath = filepath.Join("content/post", strings.Replace(relPath, "_posts/", "", -1))
|
||||
case strings.Contains(relPath, "_drafts/"):
|
||||
relPath = filepath.Join("content/draft", strings.Replace(relPath, "_drafts/", "", -1))
|
||||
draft = true
|
||||
default:
|
||||
return nil
|
||||
@@ -123,11 +131,19 @@ func importFromJekyll(cmd *cobra.Command, args []string) error {
|
||||
return convertJekyllPost(site, path, relPath, targetDir, draft)
|
||||
}
|
||||
|
||||
err = helpers.SymbolicWalk(hugofs.Os, jekyllRoot, callback)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
for jekyllPostDir, hasAnyPostInDir := range jekyllPostDirs {
|
||||
if hasAnyPostInDir {
|
||||
if err = helpers.SymbolicWalk(hugofs.Os, filepath.Join(jekyllRoot, jekyllPostDir), callback); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jww.FEEDBACK.Println("Congratulations!", fileCount, "post(s) imported!")
|
||||
jww.FEEDBACK.Println("Now, start Hugo by yourself:\n" +
|
||||
"$ git clone https://github.com/spf13/herring-cove.git " + args[1] + "/themes/herring-cove")
|
||||
jww.FEEDBACK.Println("$ cd " + args[1] + "\n$ hugo server --theme=herring-cove")
|
||||
|
||||
jww.FEEDBACK.Println("Congratulations!", fileCount, "post(s) imported!")
|
||||
jww.FEEDBACK.Println("Now, start Hugo by yourself:\n" +
|
||||
"$ git clone https://github.com/spf13/herring-cove.git " + args[1] + "/themes/herring-cove")
|
||||
@@ -136,15 +152,52 @@ func importFromJekyll(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: Consider calling doNewSite() instead?
|
||||
func createSiteFromJekyll(jekyllRoot, targetDir string, force bool) (*hugolib.Site, error) {
|
||||
func getJekyllDirInfo(fs afero.Fs, jekyllRoot string) (map[string]bool, bool) {
|
||||
postDirs := make(map[string]bool)
|
||||
hasAnyPost := false
|
||||
if entries, err := ioutil.ReadDir(jekyllRoot); err == nil {
|
||||
for _, entry := range entries {
|
||||
if entry.IsDir() {
|
||||
subDir := filepath.Join(jekyllRoot, entry.Name())
|
||||
if isPostDir, hasAnyPostInDir := retrieveJekyllPostDir(fs, subDir); isPostDir {
|
||||
postDirs[entry.Name()] = hasAnyPostInDir
|
||||
if hasAnyPostInDir {
|
||||
hasAnyPost = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return postDirs, hasAnyPost
|
||||
}
|
||||
|
||||
func retrieveJekyllPostDir(fs afero.Fs, dir string) (bool, bool) {
|
||||
if strings.HasSuffix(dir, "_posts") || strings.HasSuffix(dir, "_drafts") {
|
||||
isEmpty, _ := helpers.IsEmpty(dir, fs)
|
||||
return true, !isEmpty
|
||||
}
|
||||
|
||||
if entries, err := ioutil.ReadDir(dir); err == nil {
|
||||
for _, entry := range entries {
|
||||
if entry.IsDir() {
|
||||
subDir := filepath.Join(dir, entry.Name())
|
||||
if isPostDir, hasAnyPost := retrieveJekyllPostDir(fs, subDir); isPostDir {
|
||||
return isPostDir, hasAnyPost
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false, true
|
||||
}
|
||||
|
||||
func createSiteFromJekyll(jekyllRoot, targetDir string, jekyllPostDirs map[string]bool, force bool) (*hugolib.Site, error) {
|
||||
s, err := hugolib.NewSiteDefaultLang()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fs := s.Fs.Source
|
||||
|
||||
if exists, _ := helpers.Exists(targetDir, fs); exists {
|
||||
if isDir, _ := helpers.IsDir(targetDir, fs); !isDir {
|
||||
return nil, errors.New("Target path \"" + targetDir + "\" already exists but not a directory")
|
||||
@@ -159,24 +212,6 @@ func createSiteFromJekyll(jekyllRoot, targetDir string, force bool) (*hugolib.Si
|
||||
|
||||
jekyllConfig := loadJekyllConfig(fs, jekyllRoot)
|
||||
|
||||
// Crude test to make sure at least one of _drafts/ and _posts/ exists
|
||||
// and is not empty.
|
||||
hasPostsOrDrafts := false
|
||||
postsDir := filepath.Join(jekyllRoot, "_posts")
|
||||
draftsDir := filepath.Join(jekyllRoot, "_drafts")
|
||||
for _, d := range []string{postsDir, draftsDir} {
|
||||
if exists, _ := helpers.Exists(d, fs); exists {
|
||||
if isDir, _ := helpers.IsDir(d, fs); isDir {
|
||||
if isEmpty, _ := helpers.IsEmpty(d, fs); !isEmpty {
|
||||
hasPostsOrDrafts = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if !hasPostsOrDrafts {
|
||||
return nil, errors.New("Your Jekyll root contains neither posts nor drafts, aborting.")
|
||||
}
|
||||
|
||||
mkdir(targetDir, "layouts")
|
||||
mkdir(targetDir, "content")
|
||||
mkdir(targetDir, "archetypes")
|
||||
@@ -186,7 +221,7 @@ func createSiteFromJekyll(jekyllRoot, targetDir string, force bool) (*hugolib.Si
|
||||
|
||||
createConfigFromJekyll(fs, targetDir, "yaml", jekyllConfig)
|
||||
|
||||
copyJekyllFilesAndFolders(jekyllRoot, filepath.Join(targetDir, "static"))
|
||||
copyJekyllFilesAndFolders(jekyllRoot, filepath.Join(targetDir, "static"), jekyllPostDirs)
|
||||
|
||||
return s, nil
|
||||
}
|
||||
@@ -318,7 +353,7 @@ func copyDir(source string, dest string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyJekyllFilesAndFolders(jekyllRoot string, dest string) error {
|
||||
func copyJekyllFilesAndFolders(jekyllRoot, dest string, jekyllPostDirs map[string]bool) (err error) {
|
||||
fi, err := os.Stat(jekyllRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -336,9 +371,11 @@ func copyJekyllFilesAndFolders(jekyllRoot string, dest string) error {
|
||||
dfp := filepath.Join(dest, entry.Name())
|
||||
if entry.IsDir() {
|
||||
if entry.Name()[0] != '_' && entry.Name()[0] != '.' {
|
||||
err = copyDir(sfp, dfp)
|
||||
if err != nil {
|
||||
jww.ERROR.Println(err)
|
||||
if _, ok := jekyllPostDirs[entry.Name()]; !ok {
|
||||
err = copyDir(sfp, dfp)
|
||||
if err != nil {
|
||||
jww.ERROR.Println(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
// Copyright 2015 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Copyright 2015 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package commands
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
func init() {
|
||||
checkCmd.AddCommand(limit)
|
||||
}
|
||||
|
||||
var limit = &cobra.Command{
|
||||
Use: "ulimit",
|
||||
Short: "Check system ulimit settings",
|
||||
Long: `Hugo will inspect the current ulimit settings on the system.
|
||||
This is primarily to ensure that Hugo can watch enough files on some OSs`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
var rLimit syscall.Rlimit
|
||||
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
if err != nil {
|
||||
return newSystemError("Error Getting Rlimit ", err)
|
||||
}
|
||||
|
||||
jww.FEEDBACK.Println("Current rLimit:", rLimit)
|
||||
|
||||
jww.FEEDBACK.Println("Attempting to increase limit")
|
||||
rLimit.Max = 999999
|
||||
rLimit.Cur = 999999
|
||||
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
if err != nil {
|
||||
return newSystemError("Error Setting rLimit ", err)
|
||||
}
|
||||
err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
if err != nil {
|
||||
return newSystemError("Error Getting rLimit ", err)
|
||||
}
|
||||
jww.FEEDBACK.Println("rLimit after change:", rLimit)
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func tweakLimit() {
|
||||
var rLimit syscall.Rlimit
|
||||
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
if err != nil {
|
||||
jww.ERROR.Println("Unable to obtain rLimit", err)
|
||||
}
|
||||
if rLimit.Cur < rLimit.Max {
|
||||
rLimit.Max = 64000
|
||||
rLimit.Cur = 64000
|
||||
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
if err != nil {
|
||||
jww.WARN.Println("Unable to increase number of open files limit", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright 2015 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !darwin
|
||||
// Copyright 2015 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package commands
|
||||
|
||||
func tweakLimit() {
|
||||
// nothing to do
|
||||
}
|
||||
+1
-1
@@ -16,8 +16,8 @@ package commands
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
|
||||
+45
-18
@@ -22,13 +22,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/create"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/parser"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/create"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
"github.com/spf13/hugo/parser"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@@ -42,7 +42,6 @@ var (
|
||||
func init() {
|
||||
newSiteCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "config & frontmatter format")
|
||||
newSiteCmd.Flags().Bool("force", false, "init inside non-empty directory")
|
||||
newCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "frontmatter format")
|
||||
newCmd.Flags().StringVarP(&contentType, "kind", "k", "", "content type to create")
|
||||
newCmd.PersistentFlags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from")
|
||||
newCmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
|
||||
@@ -98,10 +97,6 @@ func NewContent(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("format") {
|
||||
c.Set("metaDataFormat", configFormat)
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("editor") {
|
||||
c.Set("newContentEditor", contentEditor)
|
||||
}
|
||||
@@ -120,20 +115,48 @@ func NewContent(cmd *cobra.Command, args []string) error {
|
||||
kind = contentType
|
||||
}
|
||||
|
||||
s, err := hugolib.NewSite(*cfg)
|
||||
|
||||
ps, err := helpers.NewPathSpec(cfg.Fs, cfg.Cfg)
|
||||
if err != nil {
|
||||
return newSystemError(err)
|
||||
return err
|
||||
}
|
||||
|
||||
return create.NewContent(s, kind, createPath)
|
||||
// If a site isn't in use in the archetype template, we can skip the build.
|
||||
siteFactory := func(filename string, siteUsed bool) (*hugolib.Site, error) {
|
||||
if !siteUsed {
|
||||
return hugolib.NewSite(*cfg)
|
||||
}
|
||||
var s *hugolib.Site
|
||||
if err := c.initSites(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := Hugo.Build(hugolib.BuildCfg{SkipRender: true, PrintStats: false}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s = Hugo.Sites[0]
|
||||
|
||||
if len(Hugo.Sites) > 1 {
|
||||
// Find the best match.
|
||||
for _, ss := range Hugo.Sites {
|
||||
if strings.Contains(createPath, "."+ss.Language.Lang) {
|
||||
s = ss
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
return create.NewContent(ps, siteFactory, kind, createPath)
|
||||
}
|
||||
|
||||
func doNewSite(fs *hugofs.Fs, basepath string, force bool) error {
|
||||
archeTypePath := filepath.Join(basepath, "archetypes")
|
||||
dirs := []string{
|
||||
filepath.Join(basepath, "layouts"),
|
||||
filepath.Join(basepath, "content"),
|
||||
filepath.Join(basepath, "archetypes"),
|
||||
archeTypePath,
|
||||
filepath.Join(basepath, "static"),
|
||||
filepath.Join(basepath, "data"),
|
||||
filepath.Join(basepath, "themes"),
|
||||
@@ -168,6 +191,10 @@ func doNewSite(fs *hugofs.Fs, basepath string, force bool) error {
|
||||
|
||||
createConfig(fs, basepath, configFormat)
|
||||
|
||||
// Create a defaul archetype file.
|
||||
helpers.SafeWriteToDisk(filepath.Join(archeTypePath, "default.md"),
|
||||
strings.NewReader(create.ArchetypeTemplateTemplate), fs.Source)
|
||||
|
||||
jww.FEEDBACK.Printf("Congratulations! Your new Hugo site is created in %s.\n\n", basepath)
|
||||
jww.FEEDBACK.Println(nextStepsText())
|
||||
|
||||
@@ -311,16 +338,16 @@ func touchFile(fs afero.Fs, x ...string) {
|
||||
func createThemeMD(fs *hugofs.Fs, inpath string) (err error) {
|
||||
|
||||
by := []byte(`# theme.toml template for a Hugo theme
|
||||
# See https://github.com/spf13/hugoThemes#themetoml for an example
|
||||
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
|
||||
|
||||
name = "` + strings.Title(helpers.MakeTitle(filepath.Base(inpath))) + `"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE.md"
|
||||
description = ""
|
||||
homepage = "http://siteforthistheme.com/"
|
||||
homepage = "http://example.com/"
|
||||
tags = []
|
||||
features = []
|
||||
min_version = "0.22"
|
||||
min_version = "0.25.1"
|
||||
|
||||
[author]
|
||||
name = ""
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
+11
-5
@@ -16,8 +16,10 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gohugoio/hugo/releaser"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/releaser"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -27,10 +29,10 @@ func init() {
|
||||
type releaseCommandeer struct {
|
||||
cmd *cobra.Command
|
||||
|
||||
// Will be zero for main releases.
|
||||
patchLevel int
|
||||
version string
|
||||
|
||||
skipPublish bool
|
||||
try bool
|
||||
|
||||
step int
|
||||
}
|
||||
@@ -50,13 +52,17 @@ func createReleaser() *releaseCommandeer {
|
||||
return r.release()
|
||||
}
|
||||
|
||||
r.cmd.PersistentFlags().IntVarP(&r.patchLevel, "patch", "p", 0, "patch level, defaults to 0 for main releases")
|
||||
r.cmd.PersistentFlags().StringVarP(&r.version, "rel", "r", "", "new release version, i.e. 0.25.1")
|
||||
r.cmd.PersistentFlags().IntVarP(&r.step, "step", "s", -1, "release step, defaults to -1 for all steps.")
|
||||
r.cmd.PersistentFlags().BoolVarP(&r.skipPublish, "skip-publish", "", false, "skip all publishing pipes of the release")
|
||||
r.cmd.PersistentFlags().BoolVarP(&r.try, "try", "", false, "simulate a release, i.e. no changes")
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *releaseCommandeer) release() error {
|
||||
return releaser.New(r.patchLevel, r.step, r.skipPublish).Run()
|
||||
if r.version == "" {
|
||||
return errors.New("must set the --rel flag to the relevant version number")
|
||||
}
|
||||
return releaser.New(r.version, r.step, r.skipPublish, r.try).Run()
|
||||
}
|
||||
|
||||
+8
-2
@@ -24,15 +24,16 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/config"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
var (
|
||||
disableLiveReload bool
|
||||
navigateToChanged bool
|
||||
renderToDisk bool
|
||||
serverAppend bool
|
||||
serverInterface string
|
||||
@@ -87,6 +88,7 @@ func init() {
|
||||
serverCmd.Flags().BoolVarP(&serverWatch, "watch", "w", true, "watch filesystem for changes and recreate as needed")
|
||||
serverCmd.Flags().BoolVarP(&serverAppend, "appendPort", "", true, "append port to baseURL")
|
||||
serverCmd.Flags().BoolVar(&disableLiveReload, "disableLiveReload", false, "watch without enabling live browser reload on rebuild")
|
||||
serverCmd.Flags().BoolVar(&navigateToChanged, "navigateToChanged", false, "navigate to changed content file on live browser reload")
|
||||
serverCmd.Flags().BoolVar(&renderToDisk, "renderToDisk", false, "render to Destination path (default is render to memory & serve from there)")
|
||||
serverCmd.Flags().String("memstats", "", "log memory usage to this file")
|
||||
serverCmd.Flags().String("meminterval", "100ms", "interval to poll memory usage (requires --memstats), valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".")
|
||||
@@ -110,6 +112,10 @@ func server(cmd *cobra.Command, args []string) error {
|
||||
c.Set("disableLiveReload", disableLiveReload)
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("navigateToChanged") {
|
||||
c.Set("navigateToChanged", navigateToChanged)
|
||||
}
|
||||
|
||||
if serverWatch {
|
||||
c.Set("watch", true)
|
||||
}
|
||||
|
||||
+4
-6
@@ -19,14 +19,14 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/parser"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/parser"
|
||||
)
|
||||
|
||||
var undraftCmd = &cobra.Command{
|
||||
Use: "undraft path/to/content",
|
||||
Short: "Undraft changes the content's draft status from 'True' to 'False'",
|
||||
Long: `Undraft changes the content's draft status from 'True' to 'False'
|
||||
Short: "Undraft resets the content's draft status",
|
||||
Long: `Undraft resets the content's draft status
|
||||
and updates the date to the current date and time.
|
||||
If the content's draft status is 'False', nothing is done.`,
|
||||
RunE: Undraft,
|
||||
@@ -138,14 +138,12 @@ L:
|
||||
for _, v := range fmLines {
|
||||
pos := bytes.Index(v, []byte("draft"))
|
||||
if pos != -1 {
|
||||
v = bytes.Replace(v, []byte("true"), []byte("false"), 1)
|
||||
goto write
|
||||
continue
|
||||
}
|
||||
pos = bytes.Index(v, []byte("date"))
|
||||
if pos != -1 { // if date field wasn't found, add it
|
||||
v = bytes.Replace(v, []byte(date), []byte(time.Now().Format(time.RFC3339)), 1)
|
||||
}
|
||||
write:
|
||||
buff.Write(v)
|
||||
buff.Write(lineEnding)
|
||||
}
|
||||
|
||||
@@ -21,16 +21,17 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/hugo/parser"
|
||||
"github.com/gohugoio/hugo/parser"
|
||||
)
|
||||
|
||||
var (
|
||||
jsonFM = "{\n \"date\": \"12-04-06\",\n \"title\": \"test json\"\n}"
|
||||
jsonDraftFM = "{\n \"draft\": true,\n \"date\": \"12-04-06\",\n \"title\":\"test json\"\n}"
|
||||
tomlFM = "+++\n date= \"12-04-06\"\n title= \"test toml\"\n+++"
|
||||
tomlDraftFM = "+++\n draft= true\n date= \"12-04-06\"\n title=\"test toml\"\n+++"
|
||||
yamlFM = "---\n date: \"12-04-06\"\n title: \"test yaml\"\n---"
|
||||
yamlDraftFM = "---\n draft: true\n date: \"12-04-06\"\n title: \"test yaml\"\n---"
|
||||
jsonFM = "{\n \"date\": \"12-04-06\",\n \"title\": \"test json\"\n}"
|
||||
jsonDraftFM = "{\n \"draft\": true,\n \"date\": \"12-04-06\",\n \"title\":\"test json\"\n}"
|
||||
tomlFM = "+++\n date= \"12-04-06\"\n title= \"test toml\"\n+++"
|
||||
tomlDraftFM = "+++\n draft= true\n date= \"12-04-06\"\n title=\"test toml\"\n+++"
|
||||
yamlFM = "---\n date: \"12-04-06\"\n title: \"test yaml\"\n---"
|
||||
yamlDraftFM = "---\n draft: true\n date: \"12-04-06\"\n title: \"test yaml\"\n---"
|
||||
yamlYesDraftFM = "---\n draft: yes\n date: \"12-04-06\"\n title: \"test yaml\"\n---"
|
||||
)
|
||||
|
||||
func TestUndraftContent(t *testing.T) {
|
||||
@@ -44,6 +45,7 @@ func TestUndraftContent(t *testing.T) {
|
||||
{tomlDraftFM, ""},
|
||||
{yamlFM, "not a Draft: nothing was done"},
|
||||
{yamlDraftFM, ""},
|
||||
{yamlYesDraftFM, ""},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
|
||||
+2
-2
@@ -20,10 +20,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/kardianos/osext"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
|
||||
+43
-96
@@ -19,68 +19,61 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
"github.com/spf13/hugo/parser"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
// NewContent creates a new content file in the content directory based upon the
|
||||
// given kind, which is used to lookup an archetype.
|
||||
func NewContent(s *hugolib.Site, kind, name string) (err error) {
|
||||
jww.INFO.Println("attempting to create ", name, "of", kind)
|
||||
func NewContent(
|
||||
ps *helpers.PathSpec,
|
||||
siteFactory func(filename string, siteUsed bool) (*hugolib.Site, error), kind, targetPath string) error {
|
||||
ext := helpers.Ext(targetPath)
|
||||
|
||||
location := FindArchetype(s, kind)
|
||||
jww.INFO.Printf("attempting to create %q of %q of ext %q", targetPath, kind, ext)
|
||||
|
||||
var by []byte
|
||||
archetypeFilename := findArchetype(ps, kind, ext)
|
||||
|
||||
if location != "" {
|
||||
by, err = afero.ReadFile(s.Fs.Source, location)
|
||||
// Building the sites can be expensive, so only do it if really needed.
|
||||
siteUsed := false
|
||||
|
||||
if archetypeFilename != "" {
|
||||
f, err := ps.Fs.Source.Open(archetypeFilename)
|
||||
if err != nil {
|
||||
jww.ERROR.Println(err)
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
if helpers.ReaderContains(f, []byte(".Site")) {
|
||||
siteUsed = true
|
||||
}
|
||||
}
|
||||
if location == "" || err != nil {
|
||||
by = []byte("+++\ndraft = true \n+++\n")
|
||||
}
|
||||
|
||||
psr, err := parser.ReadFrom(bytes.NewReader(by))
|
||||
s, err := siteFactory(targetPath, siteUsed)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
metadata, err := createMetadata(psr, name)
|
||||
if err != nil {
|
||||
jww.ERROR.Printf("Error processing archetype file %s: %s\n", location, err)
|
||||
return err
|
||||
}
|
||||
var content []byte
|
||||
|
||||
page, err := s.NewPage(name)
|
||||
content, err = executeArcheTypeAsTemplate(s, kind, targetPath, archetypeFilename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = page.SetSourceMetaData(metadata, parser.FormatToLeadRune(s.Cfg.GetString("metaDataFormat"))); err != nil {
|
||||
return
|
||||
contentPath := s.PathSpec.AbsPathify(filepath.Join(s.Cfg.GetString("contentDir"), targetPath))
|
||||
|
||||
if err := helpers.SafeWriteToDisk(contentPath, bytes.NewReader(content), s.Fs.Source); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
page.SetSourceContent(psr.Content())
|
||||
|
||||
contentPath := s.PathSpec.AbsPathify(filepath.Join(s.Cfg.GetString("contentDir"), name))
|
||||
|
||||
if err = page.SafeSaveSourceAs(contentPath); err != nil {
|
||||
return
|
||||
}
|
||||
jww.FEEDBACK.Println(contentPath, "created")
|
||||
|
||||
editor := s.Cfg.GetString("newContentEditor")
|
||||
if editor != "" {
|
||||
jww.FEEDBACK.Printf("Editing %s with %q ...\n", name, editor)
|
||||
jww.FEEDBACK.Printf("Editing %s with %q ...\n", targetPath, editor)
|
||||
|
||||
cmd := exec.Command(editor, contentPath)
|
||||
cmd.Stdin = os.Stdin
|
||||
@@ -93,65 +86,16 @@ func NewContent(s *hugolib.Site, kind, name string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// createMetadata generates Metadata for a new page based upon the metadata
|
||||
// found in an archetype.
|
||||
func createMetadata(archetype parser.Page, name string) (map[string]interface{}, error) {
|
||||
archMetadata, err := archetype.Metadata()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
metadata, err := cast.ToStringMapE(archMetadata)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var date time.Time
|
||||
|
||||
for k, v := range metadata {
|
||||
if v == "" {
|
||||
continue
|
||||
}
|
||||
lk := strings.ToLower(k)
|
||||
switch lk {
|
||||
case "date":
|
||||
date, err = cast.ToTimeE(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
case "title":
|
||||
// Use the archetype title as is
|
||||
metadata[lk] = v
|
||||
}
|
||||
}
|
||||
|
||||
if metadata == nil {
|
||||
metadata = make(map[string]interface{})
|
||||
}
|
||||
|
||||
if date.IsZero() {
|
||||
date = time.Now()
|
||||
}
|
||||
|
||||
if _, ok := metadata["title"]; !ok {
|
||||
metadata["title"] = helpers.MakeTitle(helpers.Filename(name))
|
||||
}
|
||||
|
||||
metadata["date"] = date.Format(time.RFC3339)
|
||||
|
||||
return metadata, nil
|
||||
}
|
||||
|
||||
// FindArchetype takes a given kind/archetype of content and returns an output
|
||||
// path for that archetype. If no archetype is found, an empty string is
|
||||
// returned.
|
||||
func FindArchetype(s *hugolib.Site, kind string) (outpath string) {
|
||||
search := []string{s.PathSpec.AbsPathify(s.Cfg.GetString("archetypeDir"))}
|
||||
func findArchetype(ps *helpers.PathSpec, kind, ext string) (outpath string) {
|
||||
search := []string{ps.AbsPathify(ps.Cfg.GetString("archetypeDir"))}
|
||||
|
||||
if s.Cfg.GetString("theme") != "" {
|
||||
themeDir := filepath.Join(s.PathSpec.AbsPathify(s.Cfg.GetString("themesDir")+"/"+s.Cfg.GetString("theme")), "/archetypes/")
|
||||
if _, err := s.Fs.Source.Stat(themeDir); os.IsNotExist(err) {
|
||||
jww.ERROR.Printf("Unable to find archetypes directory for theme %q at %q", s.Cfg.GetString("theme"), themeDir)
|
||||
if ps.Cfg.GetString("theme") != "" {
|
||||
themeDir := filepath.Join(ps.AbsPathify(ps.Cfg.GetString("themesDir")+"/"+ps.Cfg.GetString("theme")), "/archetypes/")
|
||||
if _, err := ps.Fs.Source.Stat(themeDir); os.IsNotExist(err) {
|
||||
jww.ERROR.Printf("Unable to find archetypes directory for theme %q at %q", ps.Cfg.GetString("theme"), themeDir)
|
||||
} else {
|
||||
search = append(search, themeDir)
|
||||
}
|
||||
@@ -160,18 +104,21 @@ func FindArchetype(s *hugolib.Site, kind string) (outpath string) {
|
||||
for _, x := range search {
|
||||
// If the new content isn't in a subdirectory, kind == "".
|
||||
// Therefore it should be excluded otherwise `is a directory`
|
||||
// error will occur. github.com/spf13/hugo/issues/411
|
||||
var pathsToCheck []string
|
||||
// error will occur. github.com/gohugoio/hugo/issues/411
|
||||
var pathsToCheck = []string{"default"}
|
||||
|
||||
if kind == "" {
|
||||
pathsToCheck = []string{"default.md", "default"}
|
||||
} else {
|
||||
pathsToCheck = []string{kind + ".md", kind, "default.md", "default"}
|
||||
if ext != "" {
|
||||
if kind != "" {
|
||||
pathsToCheck = append([]string{kind + ext, "default" + ext}, pathsToCheck...)
|
||||
} else {
|
||||
pathsToCheck = append([]string{"default" + ext}, pathsToCheck...)
|
||||
}
|
||||
}
|
||||
|
||||
for _, p := range pathsToCheck {
|
||||
curpath := filepath.Join(x, p)
|
||||
jww.DEBUG.Println("checking", curpath, "for archetypes")
|
||||
if exists, _ := helpers.Exists(curpath, s.Fs.Source); exists {
|
||||
if exists, _ := helpers.Exists(curpath, ps.Fs.Source); exists {
|
||||
jww.INFO.Println("curpath: " + curpath)
|
||||
return curpath
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
// Copyright 2017 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package create
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/source"
|
||||
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/tpl"
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
// ArchetypeFileData represents the data available to an archetype template.
|
||||
type ArchetypeFileData struct {
|
||||
// The archetype content type, either given as --kind option or extracted
|
||||
// from the target path's section, i.e. "blog/mypost.md" will resolve to
|
||||
// "blog".
|
||||
Type string
|
||||
|
||||
// The current date and time as a RFC3339 formatted string, suitable for use in front matter.
|
||||
Date string
|
||||
|
||||
// The Site, fully equipped with all the pages etc. Note: This will only be set if it is actually
|
||||
// used in the archetype template. Also, if this is a multilingual setup,
|
||||
// this site is the site that best matches the target content file, based
|
||||
// on the presence of language code in the filename.
|
||||
Site *hugolib.Site
|
||||
|
||||
// The target content file. Note that the .Content will be empty, as that
|
||||
// has not been created yet.
|
||||
*source.File
|
||||
}
|
||||
|
||||
const (
|
||||
ArchetypeTemplateTemplate = `---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
||||
`
|
||||
)
|
||||
|
||||
var (
|
||||
archetypeShortcodeReplacementsPre = strings.NewReplacer(
|
||||
"{{<", "{x{<",
|
||||
"{{%", "{x{%",
|
||||
">}}", ">}x}",
|
||||
"%}}", "%}x}")
|
||||
|
||||
archetypeShortcodeReplacementsPost = strings.NewReplacer(
|
||||
"{x{<", "{{<",
|
||||
"{x{%", "{{%",
|
||||
">}x}", ">}}",
|
||||
"%}x}", "%}}")
|
||||
)
|
||||
|
||||
func executeArcheTypeAsTemplate(s *hugolib.Site, kind, targetPath, archetypeFilename string) ([]byte, error) {
|
||||
|
||||
var (
|
||||
archetypeContent []byte
|
||||
archetypeTemplate []byte
|
||||
err error
|
||||
)
|
||||
|
||||
sp := source.NewSourceSpec(s.Deps.Cfg, s.Deps.Fs)
|
||||
f := sp.NewFile(targetPath)
|
||||
|
||||
data := ArchetypeFileData{
|
||||
Type: kind,
|
||||
Date: time.Now().Format(time.RFC3339),
|
||||
File: f,
|
||||
Site: s,
|
||||
}
|
||||
|
||||
if archetypeFilename == "" {
|
||||
// TODO(bep) archetype revive the issue about wrong tpl funcs arg order
|
||||
archetypeTemplate = []byte(ArchetypeTemplateTemplate)
|
||||
} else {
|
||||
archetypeTemplate, err = afero.ReadFile(s.Fs.Source, archetypeFilename)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to read archetype file %q: %s", archetypeFilename, err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// The archetype template may contain shortcodes, and these does not play well
|
||||
// with the Go templates. Need to set some temporary delimiters.
|
||||
archetypeTemplate = []byte(archetypeShortcodeReplacementsPre.Replace(string(archetypeTemplate)))
|
||||
|
||||
// Reuse the Hugo template setup to get the template funcs properly set up.
|
||||
templateHandler := s.Deps.Tmpl.(tpl.TemplateHandler)
|
||||
templateName := "_text/" + helpers.Filename(archetypeFilename)
|
||||
if err := templateHandler.AddTemplate(templateName, string(archetypeTemplate)); err != nil {
|
||||
return nil, fmt.Errorf("Failed to parse archetype file %q: %s", archetypeFilename, err)
|
||||
}
|
||||
|
||||
templ := templateHandler.Lookup(templateName)
|
||||
|
||||
var buff bytes.Buffer
|
||||
if err := templ.Execute(&buff, data); err != nil {
|
||||
return nil, fmt.Errorf("Failed to process archetype file %q: %s", archetypeFilename, err)
|
||||
}
|
||||
|
||||
archetypeContent = []byte(archetypeShortcodeReplacementsPost.Replace(buff.String()))
|
||||
|
||||
if !bytes.Contains(archetypeContent, []byte("date")) || !bytes.Contains(archetypeContent, []byte("title")) {
|
||||
// TODO(bep) remove some time in the future.
|
||||
s.Log.FEEDBACK.Println(fmt.Sprintf(`WARNING: date and/or title missing from archetype file %q.
|
||||
From Hugo 0.24 this must be provided in the archetype file itself, if needed. Example:
|
||||
%s
|
||||
`, archetypeFilename, ArchetypeTemplateTemplate))
|
||||
|
||||
}
|
||||
|
||||
return archetypeContent, nil
|
||||
|
||||
}
|
||||
+46
-12
@@ -19,17 +19,17 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/hugo/deps"
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
|
||||
"github.com/spf13/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
"github.com/gohugoio/hugo/create"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/hugo/create"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -44,21 +44,31 @@ func TestNewContent(t *testing.T) {
|
||||
expected []string
|
||||
}{
|
||||
{"post", "post/sample-1.md", []string{`title = "Post Arch title"`, `test = "test1"`, "date = \"2015-01-12T19:20:04-07:00\""}},
|
||||
{"post", "post/org-1.org", []string{`#+title: ORG-1`}},
|
||||
{"emptydate", "post/sample-ed.md", []string{`title = "Empty Date Arch title"`, `test = "test1"`}},
|
||||
{"stump", "stump/sample-2.md", []string{`title = "sample 2"`}}, // no archetype file
|
||||
{"", "sample-3.md", []string{`title = "sample 3"`}}, // no archetype
|
||||
{"product", "product/sample-4.md", []string{`title = "sample 4"`}}, // empty archetype front matter
|
||||
{"stump", "stump/sample-2.md", []string{`title: "Sample 2"`}}, // no archetype file
|
||||
{"", "sample-3.md", []string{`title: "Sample 3"`}}, // no archetype
|
||||
{"product", "product/sample-4.md", []string{`title = "SAMPLE-4"`}}, // empty archetype front matter
|
||||
{"shortcodes", "shortcodes/go.md", []string{
|
||||
`title = "GO"`,
|
||||
"{{< myshortcode >}}",
|
||||
"{{% myshortcode %}}",
|
||||
"{{</* comment */>}}\n{{%/* comment */%}}"}}, // shortcodes
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
cfg, fs := newTestCfg()
|
||||
ps, err := helpers.NewPathSpec(fs, cfg)
|
||||
require.NoError(t, err)
|
||||
h, err := hugolib.NewHugoSites(deps.DepsCfg{Cfg: cfg, Fs: fs})
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, initFs(fs))
|
||||
|
||||
s := h.Sites[0]
|
||||
siteFactory := func(filename string, siteUsed bool) (*hugolib.Site, error) {
|
||||
return h.Sites[0], nil
|
||||
}
|
||||
|
||||
require.NoError(t, create.NewContent(s, c.kind, c.path))
|
||||
require.NoError(t, create.NewContent(ps, siteFactory, c.kind, c.path))
|
||||
|
||||
fname := filepath.Join("content", filepath.FromSlash(c.path))
|
||||
content := readFileFromFs(t, fs.Source, fname)
|
||||
@@ -108,13 +118,37 @@ func initFs(fs *hugofs.Fs) error {
|
||||
content: "+++\ndate = \"2015-01-12T19:20:04-07:00\"\ntitle = \"Post Arch title\"\ntest = \"test1\"\n+++\n",
|
||||
},
|
||||
{
|
||||
path: filepath.Join("archetypes", "product.md"),
|
||||
content: "+++\n+++\n",
|
||||
path: filepath.Join("archetypes", "post.org"),
|
||||
content: "#+title: {{ .BaseFileName | upper }}",
|
||||
},
|
||||
{
|
||||
path: filepath.Join("archetypes", "product.md"),
|
||||
content: `+++
|
||||
title = "{{ .BaseFileName | upper }}"
|
||||
+++`,
|
||||
},
|
||||
{
|
||||
path: filepath.Join("archetypes", "emptydate.md"),
|
||||
content: "+++\ndate =\"\"\ntitle = \"Empty Date Arch title\"\ntest = \"test1\"\n+++\n",
|
||||
},
|
||||
// #3623x
|
||||
{
|
||||
path: filepath.Join("archetypes", "shortcodes.md"),
|
||||
content: `+++
|
||||
title = "{{ .BaseFileName | upper }}"
|
||||
+++
|
||||
|
||||
{{< myshortcode >}}
|
||||
|
||||
Some text.
|
||||
|
||||
{{% myshortcode %}}
|
||||
{{</* comment */>}}
|
||||
{{%/* comment */%}}
|
||||
|
||||
|
||||
`,
|
||||
},
|
||||
} {
|
||||
f, err := fs.Source.Create(v.path)
|
||||
if err != nil {
|
||||
|
||||
Vendored
+5
-5
@@ -5,11 +5,11 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/hugo/config"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/spf13/hugo/output"
|
||||
"github.com/spf13/hugo/tpl"
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/output"
|
||||
"github.com/gohugoio/hugo/tpl"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
/.idea
|
||||
/public
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# Hugo Docs
|
||||
|
||||
Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast and flexible static site generator built with love in GoLang.
|
||||
|
||||
## Branches
|
||||
|
||||
* The `master` branch is the **current Hugo version** and will be auto-deployed to [gohugo.io/](https://gohugo.io/).
|
||||
* Anything not relevant to the current Hugo version goes into the `dev` branch.
|
||||
* Changes in [hugo/docs](https://github.com/gohugoio/hugo/tree/master/docs) will, in general, be merged once every release, but can be manually merged/cherry picked if needed. This goes both ways.
|
||||
* All contributions that is not tightly coupled with code changes, should be made directly to `hugoDocs`.
|
||||
* But we also merge PRs into [hugo/docs](https://github.com/gohugoio/hugo/tree/master/docs), but preferably changes that is related to the code in the PR itself
|
||||
|
||||
To summarize, we have two branches in this repository: `master` (current Hugo) and `dev` (next Hugo).
|
||||
+21
-4
@@ -2,14 +2,31 @@ title = "Hugo: A Fast and Flexible Website Generator"
|
||||
baseurl = "http://gohugo.io/"
|
||||
MetaDataFormat = "yaml"
|
||||
pluralizeListTitles = false
|
||||
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
|
||||
disableAliases = true
|
||||
|
||||
[blackfriday]
|
||||
plainIDAnchors = true
|
||||
|
||||
[outputs]
|
||||
home = [ "HTML", "RSS", "REDIR" ]
|
||||
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/netlify"]
|
||||
suffix = ""
|
||||
delimiter = ""
|
||||
|
||||
[outputFormats]
|
||||
[outputFormats.REDIR]
|
||||
mediatype = "text/netlify"
|
||||
baseName = "_redirects"
|
||||
isPlainText = true
|
||||
notAlternative = true
|
||||
|
||||
[params]
|
||||
description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13, bep and friends in Go"
|
||||
author = "Steve Francia (spf13) and friends"
|
||||
release = "0.22"
|
||||
release = "0.25.1"
|
||||
|
||||
[taxonomies]
|
||||
tag = "tags"
|
||||
@@ -18,7 +35,7 @@ pluralizeListTitles = false
|
||||
[[menu.main]]
|
||||
name = "Download Hugo"
|
||||
pre = "<i class='fa fa-download'></i>"
|
||||
url = "https://github.com/spf13/hugo/releases"
|
||||
url = "https://github.com/gohugoio/hugo/releases"
|
||||
weight = -200
|
||||
[[menu.main]]
|
||||
name = "Site Showcase"
|
||||
@@ -38,7 +55,7 @@ pluralizeListTitles = false
|
||||
[[menu.main]]
|
||||
name = "Discuss Hugo"
|
||||
pre = "<i class='fa fa-comments'></i>"
|
||||
url = "http://discuss.gohugo.io/"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
weight = -150
|
||||
[[menu.main]]
|
||||
name = "About Hugo"
|
||||
@@ -93,7 +110,7 @@ pluralizeListTitles = false
|
||||
[[menu.main]]
|
||||
parent = "community"
|
||||
name = "Discussion Forum"
|
||||
url = "http://discuss.gohugo.io"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
weight = 150
|
||||
[[menu.main]]
|
||||
name = "Tutorials"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo"
|
||||
slug: hugo
|
||||
url: /commands/hugo/
|
||||
@@ -65,6 +65,7 @@ hugo [flags]
|
||||
|
||||
### SEE ALSO
|
||||
* [hugo benchmark](/commands/hugo_benchmark/) - Benchmark Hugo by building a site a number of times.
|
||||
* [hugo check](/commands/hugo_check/) - Contains some verification checks
|
||||
* [hugo config](/commands/hugo_config/) - Print the site configuration
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
* [hugo env](/commands/hugo_env/) - Print Hugo version and environment info
|
||||
@@ -73,7 +74,7 @@ hugo [flags]
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
* [hugo server](/commands/hugo_server/) - A high performance webserver
|
||||
* [hugo undraft](/commands/hugo_undraft/) - Undraft changes the content's draft status from 'True' to 'False'
|
||||
* [hugo undraft](/commands/hugo_undraft/) - Undraft resets the content's draft status
|
||||
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo benchmark"
|
||||
slug: hugo_benchmark
|
||||
url: /commands/hugo_benchmark/
|
||||
@@ -69,4 +69,4 @@ hugo benchmark [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-04-26T22:40:07+02:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo check"
|
||||
slug: hugo_check
|
||||
url: /commands/hugo_check/
|
||||
@@ -13,6 +13,12 @@ Contains some verification checks
|
||||
|
||||
Contains some verification checks
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for check
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
@@ -28,4 +34,4 @@ Contains some verification checks
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings
|
||||
|
||||
###### Auto generated by spf13/cobra on 26-Apr-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-04-26T22:40:07+02:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo check ulimit"
|
||||
slug: hugo_check_ulimit
|
||||
url: /commands/hugo_check_ulimit/
|
||||
@@ -15,7 +15,13 @@ Hugo will inspect the current ulimit settings on the system.
|
||||
This is primarily to ensure that Hugo can watch enough files on some OSs
|
||||
|
||||
```
|
||||
hugo check ulimit
|
||||
hugo check ulimit [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for ulimit
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -32,4 +38,4 @@ hugo check ulimit
|
||||
### SEE ALSO
|
||||
* [hugo check](/commands/hugo_check/) - Contains some verification checks
|
||||
|
||||
###### Auto generated by spf13/cobra on 26-Apr-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo config"
|
||||
slug: hugo_config
|
||||
url: /commands/hugo_config/
|
||||
@@ -37,4 +37,4 @@ hugo config [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo convert"
|
||||
slug: hugo_convert
|
||||
url: /commands/hugo_convert/
|
||||
@@ -41,4 +41,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
|
||||
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo convert toJSON"
|
||||
slug: hugo_convert_toJSON
|
||||
url: /commands/hugo_convert_tojson/
|
||||
@@ -41,4 +41,4 @@ hugo convert toJSON [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo convert toTOML"
|
||||
slug: hugo_convert_toTOML
|
||||
url: /commands/hugo_convert_totoml/
|
||||
@@ -41,4 +41,4 @@ hugo convert toTOML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo convert toYAML"
|
||||
slug: hugo_convert_toYAML
|
||||
url: /commands/hugo_convert_toyaml/
|
||||
@@ -41,4 +41,4 @@ hugo convert toYAML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo env"
|
||||
slug: hugo_env
|
||||
url: /commands/hugo_env/
|
||||
@@ -37,4 +37,4 @@ hugo env [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo gen"
|
||||
slug: hugo_gen
|
||||
url: /commands/hugo_gen/
|
||||
@@ -36,4 +36,4 @@ A collection of several useful generators.
|
||||
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
|
||||
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo gen autocomplete"
|
||||
slug: hugo_gen_autocomplete
|
||||
url: /commands/hugo_gen_autocomplete/
|
||||
@@ -55,4 +55,4 @@ hugo gen autocomplete [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo gen doc"
|
||||
slug: hugo_gen_doc
|
||||
url: /commands/hugo_gen_doc/
|
||||
@@ -44,4 +44,4 @@ hugo gen doc [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo gen man"
|
||||
slug: hugo_gen_man
|
||||
url: /commands/hugo_gen_man/
|
||||
@@ -40,4 +40,4 @@ hugo gen man [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo import"
|
||||
slug: hugo_import
|
||||
url: /commands/hugo_import/
|
||||
@@ -36,4 +36,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo import jekyll"
|
||||
slug: hugo_import_jekyll
|
||||
url: /commands/hugo_import_jekyll/
|
||||
@@ -40,4 +40,4 @@ hugo import jekyll [flags]
|
||||
### SEE ALSO
|
||||
* [hugo import](/commands/hugo_import/) - Import your site from others.
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo list"
|
||||
slug: hugo_list
|
||||
url: /commands/hugo_list/
|
||||
@@ -39,4 +39,4 @@ List requires a subcommand, e.g. `hugo list drafts`.
|
||||
* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
|
||||
* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo list drafts"
|
||||
slug: hugo_list_drafts
|
||||
url: /commands/hugo_list_drafts/
|
||||
@@ -38,4 +38,4 @@ hugo list drafts [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo list expired"
|
||||
slug: hugo_list_expired
|
||||
url: /commands/hugo_list_expired/
|
||||
@@ -39,4 +39,4 @@ hugo list expired [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo list future"
|
||||
slug: hugo_list_future
|
||||
url: /commands/hugo_list_future/
|
||||
@@ -39,4 +39,4 @@ hugo list future [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo new"
|
||||
slug: hugo_new
|
||||
url: /commands/hugo_new/
|
||||
@@ -26,7 +26,6 @@ hugo new [path] [flags]
|
||||
|
||||
```
|
||||
--editor string edit new content with this editor, if provided
|
||||
-f, --format string frontmatter format (default "toml")
|
||||
-h, --help help for new
|
||||
-k, --kind string content type to create
|
||||
-s, --source string filesystem path to read files relative from
|
||||
@@ -48,4 +47,4 @@ hugo new [path] [flags]
|
||||
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
|
||||
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo new site"
|
||||
slug: hugo_new_site
|
||||
url: /commands/hugo_new_site/
|
||||
@@ -42,4 +42,4 @@ hugo new site [path] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo new theme"
|
||||
slug: hugo_new_theme
|
||||
url: /commands/hugo_new_theme/
|
||||
@@ -41,4 +41,4 @@ hugo new theme [name] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo server"
|
||||
slug: hugo_server
|
||||
url: /commands/hugo_server/
|
||||
@@ -55,6 +55,7 @@ hugo server [flags]
|
||||
-l, --layoutDir string filesystem path to layout directory
|
||||
--meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
|
||||
--memstats string log memory usage to this file
|
||||
--navigateToChanged navigate to changed content file on live browser reload
|
||||
--noChmod don't sync permission mode of files
|
||||
--noTimes don't sync modification time of files
|
||||
--pluralizeListTitles pluralize titles in lists using inflect (default true)
|
||||
@@ -83,4 +84,4 @@ hugo server [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo undraft"
|
||||
slug: hugo_undraft
|
||||
url: /commands/hugo_undraft/
|
||||
---
|
||||
## hugo undraft
|
||||
|
||||
Undraft changes the content's draft status from 'True' to 'False'
|
||||
Undraft resets the content's draft status
|
||||
|
||||
### Synopsis
|
||||
|
||||
|
||||
Undraft changes the content's draft status from 'True' to 'False'
|
||||
Undraft resets the content's draft status
|
||||
and updates the date to the current date and time.
|
||||
If the content's draft status is 'False', nothing is done.
|
||||
|
||||
@@ -39,4 +39,4 @@ hugo undraft path/to/content [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-05-23T20:59:46+03:00
|
||||
date: 2017-07-06T10:34:39+02:00
|
||||
title: "hugo version"
|
||||
slug: hugo_version
|
||||
url: /commands/hugo_version/
|
||||
@@ -37,4 +37,4 @@ hugo version [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 23-May-2017
|
||||
###### Auto generated by spf13/cobra on 6-Jul-2017
|
||||
|
||||
@@ -13,7 +13,7 @@ title: Contributing to Hugo
|
||||
weight: 30
|
||||
---
|
||||
|
||||
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]({{< relref "meta/roadmap.md" >}}) or contact the dev team via the [Forums](https://discuss.gohugo.io/) or [Gitter](https://gitter.im/spf13/hugo) about what may make sense to do next.
|
||||
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]({{< relref "meta/roadmap.md" >}}) or contact the dev team via the [Forums](https://discourse.gohugo.io/) or [Gitter](https://gitter.im/gohugoio/hugo) about what may make sense to do next.
|
||||
|
||||
You should fork the project and make your changes. *We encourage pull requests to discuss code changes.*
|
||||
|
||||
@@ -23,7 +23,7 @@ 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.
|
||||
* Run `make check` and ensure it succeeds. [Travis CI](https://travis-ci.org/spf13/hugo) and [Appveyor](https://ci.appveyor.com/project/spf13/hugo) will runs these checks and fail the build if `make check` fails.
|
||||
* Run `make check` and ensure it succeeds. [Travis CI](https://travis-ci.org/gohugoio/hugo) and [Appveyor](https://ci.appveyor.com/project/gohugoio/hugo) will runs these checks and fail the build if `make check` fails.
|
||||
|
||||
## Contribution Overview
|
||||
|
||||
@@ -41,16 +41,16 @@ You **must use govendor** to fetch Hugo's dependencies.
|
||||
## Fetch the Sources
|
||||
|
||||
go get github.com/kardianos/govendor
|
||||
govendor get github.com/spf13/hugo
|
||||
govendor get github.com/gohugoio/hugo
|
||||
|
||||
## Running Hugo
|
||||
|
||||
cd $HOME/go/src/github.com/spf13/hugo
|
||||
cd $HOME/go/src/github.com/gohugoio/hugo
|
||||
go run main.go
|
||||
|
||||
## Building Hugo
|
||||
|
||||
cd $HOME/go/src/github.com/spf13/hugo
|
||||
cd $HOME/go/src/github.com/gohugoio/hugo
|
||||
make build
|
||||
# or to install to $HOME/go/bin:
|
||||
make install
|
||||
@@ -60,7 +60,7 @@ You **must use govendor** to fetch Hugo's dependencies.
|
||||
|
||||
You got your new website running and it's powered by Hugo? Great. You can add your website with a few steps to the [showcase](/showcase/).
|
||||
|
||||
First, make sure that you created a [fork](https://help.github.com/articles/fork-a-repo/) of Hugo on GitHub and cloned your fork on your local computer. Next, create a separate branch for your additions:
|
||||
First, make sure that you created a [fork](https://help.github.com/articles/fork-a-repo/) of the [`hugoDocs`](https://github.com/gohugoio/hugodocs) repository on GitHub and cloned your fork on your local computer. **Next, create a separate branch for your additions**:
|
||||
|
||||
```
|
||||
# You can choose a different descriptive branch name if you like
|
||||
@@ -94,17 +94,17 @@ title: example
|
||||
|
||||
Add at least values for `sitelink`, `title`, `description` and a path for `thumbnail`.
|
||||
|
||||
Furthermore, we need to create the thumbnail of your website. **It's important that the thumbnail has the required dimensions of 600px by 400px.** Give your thumbnail a name like `example-tn.png`. Save it under `docs/static/img/`.
|
||||
Furthermore, we need to create the thumbnail of your website. **It's important that the thumbnail has the required dimensions of 600px by 400px.** Give your thumbnail a name like `example-tn.png`. Save it under `static/img/`.
|
||||
|
||||
Check a last time that everything works as expected. Start Hugo's built-in server in order to inspect your local copy of the showcase in the browser:
|
||||
|
||||
hugo server
|
||||
|
||||
If everything looks fine, we are ready to commit your additions. For the sake of best practices, please make sure that your commit follows our [code contribution guideline](https://github.com/spf13/hugo#code-contribution-guideline).
|
||||
If everything looks fine, we are ready to commit your additions. For the sake of best practices, please make sure that your commit follows our [code contribution guideline](https://github.com/gohugoio/hugo#code-contribution-guideline).
|
||||
|
||||
git commit -m"docs: Add example.com to the showcase"
|
||||
git commit -m"Add example.com to the showcase"
|
||||
|
||||
Last but not least, we're ready to create a [pull request](https://github.com/spf13/hugo/compare).
|
||||
Last but not least, we're ready to create a [pull request](https://github.com/gohugoio/hugoDocs/compare).
|
||||
|
||||
Don't forget to accept the contributor license agreement. Click on the yellow badge in the automatically added comment in the pull request.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ weight: 10
|
||||
|
||||
## Discussion Forum
|
||||
|
||||
Hugo has its own [discussion forum](http://discuss.gohugo.io/) powered by [Discourse](http://www.discourse.org/).
|
||||
Hugo has its own [discussion forum](https://discourse.gohugo.io/) powered by [Discourse](http://www.discourse.org/).
|
||||
|
||||
Please use this for all discussions, questions, etc.
|
||||
|
||||
@@ -31,7 +31,7 @@ https://groups.google.com/forum/#!forum/hugo-announce
|
||||
|
||||
### Discussion (Archive)
|
||||
|
||||
**This has been replaced with the [Hugo discussion forum](http://discuss.gohugo.io/).**
|
||||
**This has been replaced with the [Hugo discussion forum](https://discourse.gohugo.io/).**
|
||||
|
||||
It is available for archival purposes.
|
||||
|
||||
@@ -48,4 +48,4 @@ https://groups.google.com/forum/#!forum/golang-nuts
|
||||
|
||||
### GitHub Issues
|
||||
|
||||
https://github.com/spf13/hugo/issues
|
||||
https://github.com/gohugoio/hugo/issues
|
||||
|
||||
@@ -9,7 +9,7 @@ weight: 20
|
||||
|
||||
### Help keep this list up to date
|
||||
|
||||
Know of a post, article or tutorial on Hugo? [Add it to this list](https://github.com/spf13/hugo/edit/master/docs/content/community/press.md).
|
||||
Know of a post, article or tutorial on Hugo? [Add it to this list](https://github.com/gohugoio/hugo/edit/master/docs/content/community/press.md).
|
||||
|
||||
## Press and Articles
|
||||
|
||||
@@ -18,6 +18,7 @@ Hugo has been featured in the following Blog Posts, Press and Media.
|
||||
|
||||
| Title | Author | Date |
|
||||
| ------ | ------ | -----: |
|
||||
| [Build, Test, And Deploy Statically Generated Websites With Hugo & CircleCI](https://circleci.com/blog/build-test-deploy-hugo-sites/)| Ricardo N Feliciano | 2017-05-31 |
|
||||
| [Hugo Easy Gallery - Automagical PhotoSwipe image gallery with a one-line shortcode](https://www.liwen.id.au/heg/)| Li-Wen Yip | 2017-03-25 |
|
||||
| [Hugo Tutorial: How to Build & Host a (Very Fast) Static E-Commerce Site](https://snipcart.com/blog/hugo-tutorial-static-site-ecommerce) | Snipcart | 2017-03-12 |
|
||||
| [Automagical image gallery in Hugo with PhotoSwipe and jQuery](https://www.liwen.id.au/photoswipe/)| Li-Wen Yip | 2017-03-04 |
|
||||
|
||||
@@ -106,7 +106,7 @@ title = "my archetype example"
|
||||
|
||||
As we can see, the file contains the `title` and `date` property that Hugo created for us, along with the front matter that we defined in the `archetypes/default.md` file.
|
||||
|
||||
You'll also notice that the fields have been sorted into alphabetical order. This is an unintentional side-effect that stems from the underlying code libraries that Hugo relies upon. It is, however, [a known issue that is actively being discussed](https://github.com/spf13/hugo/issues/452).
|
||||
You'll also notice that the fields have been sorted into alphabetical order. This is an unintentional side-effect that stems from the underlying code libraries that Hugo relies upon. It is, however, [a known issue that is actively being discussed](https://github.com/gohugoio/hugo/issues/452).
|
||||
|
||||
## Section Archetypes
|
||||
|
||||
@@ -327,4 +327,4 @@ It's a subtle yet important detail to remember.
|
||||
|
||||
## Notes
|
||||
|
||||
* Prior to Hugo v0.13, some users received [an "EOF" error when using archetypes](https://github.com/spf13/hugo/issues/776), related to what text editor they used to create the archetype. As of Hugo v0.13, this error has been [resolved](https://github.com/spf13/hugo/pull/785).
|
||||
* Prior to Hugo v0.13, some users received [an "EOF" error when using archetypes](https://github.com/gohugoio/hugo/issues/776), related to what text editor they used to create the archetype. As of Hugo v0.13, this error has been [resolved](https://github.com/gohugoio/hugo/pull/785).
|
||||
|
||||
@@ -13,7 +13,7 @@ weight: 15
|
||||
toc: true
|
||||
---
|
||||
|
||||
Since 0.14, Hugo has defined a new concept called _external helpers_. It means that you can write your content using Asciidoc[tor], reStructuredText or Org-Mode. If you have files with associated extensions ([details](https://github.com/spf13/hugo/blob/77c60a3440806067109347d04eb5368b65ea0fe8/helpers/general.go#L65)), then Hugo will call external commands to generate the content (the exception being Org-Mode content, which is parsed natively).
|
||||
Since 0.14, Hugo has defined a new concept called _external helpers_. It means that you can write your content using Asciidoc[tor], reStructuredText or Org-Mode. If you have files with associated extensions ([details](https://github.com/gohugoio/hugo/blob/77c60a3440806067109347d04eb5368b65ea0fe8/helpers/general.go#L65)), then Hugo will call external commands to generate the content (the exception being Org-Mode content, which is parsed natively).
|
||||
|
||||
This means that you will have to install the associated tool on your machine to be able to use those formats.
|
||||
|
||||
|
||||
@@ -95,5 +95,5 @@ It is in early development but shows promise. If you have interest, please help
|
||||
|
||||
## Discourse
|
||||
|
||||
Additionally, you may recognize [Discourse](http://www.discourse.org) as the system that powers the [Hugo Discussion Forum](http://discuss.gohugo.io).
|
||||
Additionally, you may recognize [Discourse](http://www.discourse.org) as the system that powers the [Hugo Discussion Forum](https://discourse.gohugo.io).
|
||||
|
||||
|
||||
@@ -44,7 +44,11 @@ Subject
|
||||
: commit message subject, e.g. `tpl: Add custom index function`
|
||||
|
||||
|
||||
## Performance Considerations
|
||||
## Other Considerations
|
||||
|
||||
The Git integrations should be fairly performant, but it does add some time to the build, which depends somewhat on the Git history size.
|
||||
|
||||
The accuracy of data depends on the underlying local git respository. If the local repository is a *shallow clone*, then any file that hasn't been modified in the truncated history will default to data in the oldest commit. In particular, if the respository has been cloned using `--depth=1` then every file will the exact same `GitInfo` data -- that of the only commit in the repository.
|
||||
|
||||
In particular, many CI/CD systems such as [travis-ci.org](https://travis-ci.org) default to a clone depth of 50 which is unlikely to be deep enough. You can explicitly add back the missing history using using `git fetch --unshallow` or [make the initial checkout deeper](https://docs.travis-ci.com/user/customizing-the-build#Git-Clone-Depth).
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ The following is an example:
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
<li> <a href="https://github.com/spf13/hugo/issues" target="blank">Questions and Issues</a> </li>
|
||||
<li> <a href="https://github.com/gohugoio/hugo/issues" target="blank">Questions and Issues</a> </li>
|
||||
<li> <a href="#" target="blank">Edit this Page</a> </li>
|
||||
</ul>
|
||||
<!-- sidebar menu end-->
|
||||
|
||||
@@ -28,6 +28,7 @@ This is the full set of built-in media types in Hugo:
|
||||
* It is possible to add custom media types or change the defaults (if you, say, want to change the suffix to `asp` for `text/html`).
|
||||
* The `Suffix` is the value that will be used for URLs and filenames for that media type in Hugo.
|
||||
* The `Type` is the identifier that must be used when defining new `Output Formats` (see below).
|
||||
* The `Delimiter` defaults to ".", but can be changed or even blanked out to support, as an example, Netlify's `_redirect` files.
|
||||
* The full set of media types will be registered in Hugo's built-in development server to make sure they are recognized by the browser.
|
||||
|
||||
To add or modify a media type, define it in a `mediaTypes` section in your site config (either for all sites or for a given language).
|
||||
@@ -171,13 +172,13 @@ Hugo will now also detect the media type and output format of partials, if possi
|
||||
|
||||
Hugo will look for the name given, so you can name it whatever you want. But if you want it treated as plain text, you should use the file suffix and, if needed, the name of the Output Format (`[partial name].[OutputFormat].[suffix])`.
|
||||
|
||||
The partial below is a plain text template (Outpuf Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`):
|
||||
The partial below is a plain text template (Output Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`):
|
||||
|
||||
```
|
||||
{{ partial "mytextpartial.csv" . }}
|
||||
```
|
||||
|
||||
Also note that plain text partials can currently only be included in plain text templates, and vice versa. See [this issue](https://github.com/spf13/hugo/issues/3273) for some background.
|
||||
Also note that plain text partials can currently only be included in plain text templates, and vice versa. See [this issue](https://github.com/gohugoio/hugo/issues/3273) for some background.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ prev: /extras/crossreferences
|
||||
title: Custom robots.txt
|
||||
---
|
||||
|
||||
Hugo can generated a customized [robots.txt](http://www.robotstxt.org/) in the
|
||||
Hugo can generate a customized [robots.txt](http://www.robotstxt.org/) in the
|
||||
[same way as any other templates]({{< ref "templates/go-templates.md" >}}).
|
||||
|
||||
To enable it, just set `enableRobotsTXT` option to `true` in the [configuration file]({{< ref "overview/configuration.md" >}}). By default, it generates a robots.txt, which allows everything, with the following content:
|
||||
|
||||
@@ -190,7 +190,7 @@ Copy the ID from behind `v=` and pass it to the shortcode:
|
||||
|
||||
{{</* youtube w7Ft2ymGmfc */>}}
|
||||
|
||||
Furthermore, you can autoplay the embedded video by setting the `autoplay` parameter to true. Remember that you can't mix named an unamed parameters. Assign the yet unamed video id to the parameter `id` like below too.
|
||||
Furthermore, you can autoplay the embedded video by setting the `autoplay` parameter to true. Remember that you can't mix named and unnamed parameters. Assign the yet unnamed video id to the parameter `id` like below too.
|
||||
|
||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||
|
||||
|
||||
@@ -17,17 +17,17 @@ In no particular order, here is what we are working on:
|
||||
* Intelligently related posts ([#98][])
|
||||
* Even easier deployment to S3, SSH, GitHub, rsync. Give the [tools section](https://gohugo.io/tools/#deployment) a shot or read one of the related tutorials.
|
||||
* Import from other website systems. There are already existing [migration tools](https://gohugo.io/tools/#migration) but they don't cover all major platforms.
|
||||
* An interactive web based editor (See https://discuss.gohugo.io/t/web-based-editor/155)
|
||||
* Additional [themes](https://github.com/spf13/hugoThemes) (always on-going, contributions welcome!)
|
||||
* An interactive web based editor (See https://discourse.gohugo.io/t/web-based-editor/155)
|
||||
* Additional [themes](https://github.com/gohugoio/hugoThemes) (always on-going, contributions welcome!)
|
||||
* Dynamic image resizing via shortcodes ([#1014][])
|
||||
* Native support for additional content formats (AsciiDoc [#1435][], reST [#1436][])
|
||||
* And, last but not least, ***Your best ideas***!
|
||||
|
||||
[#100]: https://github.com/spf13/hugo/issues/100 "hugo import from wordpress · Issue #100 · spf13/hugo"
|
||||
[#101]: https://github.com/spf13/hugo/issues/101 "hugo import from jekyll · Issue #101 · spf13/hugo"
|
||||
[#1435]: https://github.com/spf13/hugo/issues/1435 "Add support for native Go implementation of AsciiDoc · Issue #1435 · spf13/hugo"
|
||||
[#1436]: https://github.com/spf13/hugo/issues/1436 "Add support for native Go implementation of reStructuredText (reST) · Issue #1436 · spf13/hugo"
|
||||
[#1014]: https://github.com/spf13/hugo/issues/1014 "Image Resizing and Cropping · Issue #1014 · spf13/hugo"
|
||||
[#98]: https://github.com/spf13/hugo/issues/98 "Add support for related content · Issue #98 · spf13/hugo"
|
||||
[#100]: https://github.com/gohugoio/hugo/issues/100 "hugo import from wordpress · Issue #100 · gohugoio/hugo"
|
||||
[#101]: https://github.com/gohugoio/hugo/issues/101 "hugo import from jekyll · Issue #101 · gohugoio/hugo"
|
||||
[#1435]: https://github.com/gohugoio/hugo/issues/1435 "Add support for native Go implementation of AsciiDoc · Issue #1435 · gohugoio/hugo"
|
||||
[#1436]: https://github.com/gohugoio/hugo/issues/1436 "Add support for native Go implementation of reStructuredText (reST) · Issue #1436 · gohugoio/hugo"
|
||||
[#1014]: https://github.com/gohugoio/hugo/issues/1014 "Image Resizing and Cropping · Issue #1014 · gohugoio/hugo"
|
||||
[#98]: https://github.com/gohugoio/hugo/issues/98 "Add support for related content · Issue #98 · gohugoio/hugo"
|
||||
|
||||
> Feel free to [contribute]({{< relref "tutorials/how-to-contribute-to-hugo.md" >}}) or open a [new issue](https://github.com/spf13/hugo/issues/new) if you have an idea for a new feature.)
|
||||
> Feel free to [contribute]({{< relref "tutorials/how-to-contribute-to-hugo.md" >}}) or open a [new issue](https://github.com/gohugoio/hugo/issues/new) if you have an idea for a new feature.)
|
||||
|
||||
@@ -15,7 +15,7 @@ weight: 20
|
||||
|
||||
Hugo is written in [Go][] with support for multiple platforms.
|
||||
|
||||
The latest release can be found at [Hugo Releases](https://github.com/spf13/hugo/releases).
|
||||
The latest release can be found at [Hugo Releases](https://github.com/gohugoio/hugo/releases).
|
||||
We currently provide pre-built binaries for
|
||||
<i class="fa fa-windows"></i> Windows,
|
||||
<i class="fa fa-linux"></i> Linux,
|
||||
@@ -28,7 +28,7 @@ Hugo may also be compiled from source wherever the Go compiler tool chain can ru
|
||||
## Installing Hugo (binary)
|
||||
|
||||
Installation is very easy. Simply download the appropriate version for your
|
||||
platform from [Hugo Releases](https://github.com/spf13/hugo/releases).
|
||||
platform from [Hugo Releases](https://github.com/gohugoio/hugo/releases).
|
||||
Once downloaded it can be run from anywhere. You don't need to install
|
||||
it into a global location. This works well for shared hosts and other systems
|
||||
where you don't have a privileged account.
|
||||
@@ -56,6 +56,9 @@ you need to install the Python-based Pygments program. The procedure is outlined
|
||||
Upgrading Hugo is as easy as downloading and replacing the executable you’ve
|
||||
placed in your `PATH`.
|
||||
|
||||
On macOS, if you have [Homebrew](http://brew.sh/), upgrading is even
|
||||
easier: just run `brew upgrade hugo`.
|
||||
|
||||
## Installing Hugo on Linux from native packages
|
||||
|
||||
### Arch Linux
|
||||
@@ -83,21 +86,27 @@ Cons:
|
||||
* Might not be the latest version, especially if you are using an older stable version (e.g., Ubuntu 16.04 LTS).
|
||||
Until backports and PPA are available, you may consider installing the Hugo snap package to get the latest version of Hugo, as described below.
|
||||
|
||||
### Fedora and Red Hat
|
||||
### Fedora, CentOS and Red Hat
|
||||
|
||||
* https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/ : updated as soon as possible after the official Hugo release.
|
||||
* https://copr.fedorainfracloud.org/coprs/spf13/Hugo/ (updated to Hugo v0.16)
|
||||
* https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/ (updated to Hugo v0.19)
|
||||
|
||||
See also [this discussion](https://discuss.gohugo.io/t/solved-fedora-copr-repository-out-of-service/2491).
|
||||
See also [this discussion](https://discourse.gohugo.io/t/solved-fedora-copr-repository-out-of-service/2491).
|
||||
|
||||
### Snap package for Hugo
|
||||
## Alternate Installation Methods
|
||||
|
||||
### Snap Package
|
||||
|
||||
In any of the [Linux distributions that support snaps](http://snapcraft.io/docs/core/install):
|
||||
|
||||
snap install hugo
|
||||
|
||||
> Note: Hugo-as-a-snap can write only inside the user’s `$HOME` directory—and gvfs-mounted directories owned by the user—because of Snaps’ confinement and security model.
|
||||
> More information is also available [in this related GitHub issue](https://github.com/spf13/hugo/issues/3143).
|
||||
> More information is also available [in this related GitHub issue](https://github.com/gohugoio/hugo/issues/3143).
|
||||
|
||||
### Docker Image (unofficial)
|
||||
|
||||
[Docker Hugo](https://hub.docker.com/r/felicianotech/docker-hugo/) is a Docker image that can be used for local development but more importantly, can be easily used for continuous integration builds of your Hugo site on [CircleCI](https://circleci.com/) or [Travis CI](https://travis-ci.org/). Source available on [GitHub](https://github.com/felicianotech/docker-hugo).
|
||||
|
||||
## Installing from source
|
||||
|
||||
@@ -114,14 +123,16 @@ Therefore, a simple `go get` is not supported since `go get` is not vendor-aware
|
||||
You **must use govendor** to fetch Hugo's dependencies.
|
||||
|
||||
### Fetch from GitHub
|
||||
|
||||
The commands below assume that you have [Go](https://golang.org/dl/) installed with your `$GOPATH` set.
|
||||
|
||||
go get github.com/kardianos/govendor
|
||||
govendor get github.com/spf13/hugo
|
||||
govendor get github.com/gohugoio/hugo
|
||||
|
||||
`govendor get` will fetch Hugo and all its dependent libraries to
|
||||
`$HOME/go/src/github.com/spf13/hugo`, and compile everything into a final `hugo`
|
||||
`$GOPATH/src/github.com/gohugoio/hugo`, and compile everything into a final `hugo`
|
||||
(or `hugo.exe`) executable, which you will find sitting inside
|
||||
`$HOME/go/bin/`, all ready to go!
|
||||
`$GOPATH/go/bin/`, all ready to go!
|
||||
|
||||
*Windows users: where you see the `$HOME` environment variable above, replace it with `%USERPROFILE%`.*
|
||||
|
||||
|
||||
@@ -193,5 +193,5 @@ as I have writing it.
|
||||
* [Install Hugo](/overview/installing/)
|
||||
* [Quick start](/overview/quickstart/)
|
||||
* [Join the Mailing List](/community/mailing-list/)
|
||||
* [Star us on GitHub](https://github.com/spf13/hugo)
|
||||
* [Discussion Forum](http://discuss.gohugo.io/)
|
||||
* [Star us on GitHub](https://github.com/gohugoio/hugo)
|
||||
* [Discussion Forum](https://discourse.gohugo.io/)
|
||||
|
||||
@@ -22,7 +22,7 @@ In this quickstart, we will build an online bookshelf that will list books and t
|
||||
|
||||
## Step 1. Install Hugo
|
||||
|
||||
Go to [Hugo Releases](https://github.com/spf13/hugo/releases) and download the
|
||||
Go to [Hugo Releases](https://github.com/gohugoio/hugo/releases) and download the
|
||||
appropriate version for your OS and architecture.
|
||||
|
||||
Save the main executable as `hugo` (or `hugo.exe` on Windows) somewhere in your `PATH` as we will be using it in the next step.
|
||||
|
||||
@@ -6,18 +6,18 @@ title: 0.20.3
|
||||
|
||||
|
||||
|
||||
This is a bug-fix relase with one important fix. But it also adds some harness around [GoReleaser](https://github.com/goreleaser/goreleaser) to automate the Hugo release process. Big thanks to [@caarlos0](https://github.com/caarlos0) for great and super-fast support fixing issues along the way.
|
||||
This is a bug-fix release with one important fix. But it also adds some harness around [GoReleaser](https://github.com/goreleaser/goreleaser) to automate the Hugo release process. Big thanks to [@caarlos0](https://github.com/caarlos0) for great and super-fast support fixing issues along the way.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 16619+ [stars](https://github.com/spf13/hugo/stargazers)
|
||||
* 458+ [contributors](https://github.com/spf13/hugo/graphs/contributors)
|
||||
* 16619+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 458+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 156+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Enhancement
|
||||
|
||||
* Automate the Hugo release process [550eba64](https://github.com/spf13/hugo/commit/550eba64705725eb54fdb1042e0fb4dbf6f29fd0) [@bep](https://github.com/bep) [#3358](https://github.com/spf13/hugo/issues/3358)
|
||||
* Automate the Hugo release process [550eba64](https://github.com/gohugoio/hugo/commit/550eba64705725eb54fdb1042e0fb4dbf6f29fd0) [@bep](https://github.com/bep) [#3358](https://github.com/gohugoio/hugo/issues/3358)
|
||||
|
||||
## Fix
|
||||
|
||||
* Fix handling of zero-length files [9bf5c381](https://github.com/spf13/hugo/commit/9bf5c381b6b3e69d4d8dbfd7a40074ac44792bbf) [@bep](https://github.com/bep) [#3355](https://github.com/spf13/hugo/issues/3355)
|
||||
* Fix handling of zero-length files [9bf5c381](https://github.com/gohugoio/hugo/commit/9bf5c381b6b3e69d4d8dbfd7a40074ac44792bbf) [@bep](https://github.com/bep) [#3355](https://github.com/gohugoio/hugo/issues/3355)
|
||||
|
||||
@@ -6,20 +6,20 @@ title: 0.20.4
|
||||
|
||||
|
||||
|
||||
This is the second bug-fix relase of the day, fixing a couple of issues related to the new release scripts.
|
||||
This is the second bug-fix release of the day, fixing a couple of issues related to the new release scripts.
|
||||
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 16626+ [stars](https://github.com/spf13/hugo/stargazers)
|
||||
* 457+ [contributors](https://github.com/spf13/hugo/graphs/contributors)
|
||||
* 16626+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 457+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 156+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix statically linked binaries [275bcf56](https://github.com/spf13/hugo/commit/275bcf566c7cb72367d4423cf4810319311ff680) [@munnerz](https://github.com/munnerz) [#3382](https://github.com/spf13/hugo/issues/3382)
|
||||
* Filename change in Hugo 0.20.3 binaries [#3385](https://github.com/spf13/hugo/issues/3385)
|
||||
* Fix version calculation [cb3c6b6f](https://github.com/spf13/hugo/commit/cb3c6b6f7670f85189a4a3637e7132901d1ed6e9) [@bep](https://github.com/bep)
|
||||
* Fix statically linked binaries [275bcf56](https://github.com/gohugoio/hugo/commit/275bcf566c7cb72367d4423cf4810319311ff680) [@munnerz](https://github.com/munnerz) [#3382](https://github.com/gohugoio/hugo/issues/3382)
|
||||
* Filename change in Hugo 0.20.3 binaries [#3385](https://github.com/gohugoio/hugo/issues/3385)
|
||||
* Fix version calculation [cb3c6b6f](https://github.com/gohugoio/hugo/commit/cb3c6b6f7670f85189a4a3637e7132901d1ed6e9) [@bep](https://github.com/bep)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,4 +6,4 @@ title: 0.20.5
|
||||
|
||||
|
||||
|
||||
This is a bug-fix relase which fixes the version number of `0.20.4` (which wrongly shows up as `0.21-DEV`) ([#3388](https://github.com/spf13/hugo/issues/3388)).
|
||||
This is a bug-fix release which fixes the version number of `0.20.4` (which wrongly shows up as `0.21-DEV`) ([#3388](https://github.com/gohugoio/hugo/issues/3388)).
|
||||
|
||||
@@ -6,19 +6,19 @@ title: 0.20.6
|
||||
|
||||
|
||||
|
||||
There have been some [shouting on discuss.gohugo.io](https://discuss.gohugo.io/t/index-md-is-generated-in-subfolder-index-index-html-hugo-0-20/6338/15) about some broken sites after the release of Hugo `0.20`. This release reintroduces the old behaviour, making `/my-blog-post/index.md` work as expected.
|
||||
There have been some [shouting on discuss.gohugo.io](https://discourse.gohugo.io/t/index-md-is-generated-in-subfolder-index-index-html-hugo-0-20/6338/15) about some broken sites after the release of Hugo `0.20`. This release reintroduces the old behaviour, making `/my-blog-post/index.md` work as expected.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 16675+ [stars](https://github.com/spf13/hugo/stargazers)
|
||||
* 456+ [contributors](https://github.com/spf13/hugo/graphs/contributors)
|
||||
* 16675+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 456+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 156+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Avoid index.md in /index/index.html [#3396](https://github.com/spf13/hugo/issues/3396)
|
||||
* Make missing GitInfo a WARNING [b30ca4be](https://github.com/spf13/hugo/commit/b30ca4bec811dbc17e9fd05925544db2b75e0e49) [@bep](https://github.com/bep) [#3376](https://github.com/spf13/hugo/issues/3376)
|
||||
* Fix some of the fpm fields for deb [3bd1d057](https://github.com/spf13/hugo/commit/3bd1d0571d5f2f6bf0dc8f90a8adf2dbfcb2fdfd) [@anthonyfok](https://github.com/anthonyfok)
|
||||
* Avoid index.md in /index/index.html [#3396](https://github.com/gohugoio/hugo/issues/3396)
|
||||
* Make missing GitInfo a WARNING [b30ca4be](https://github.com/gohugoio/hugo/commit/b30ca4bec811dbc17e9fd05925544db2b75e0e49) [@bep](https://github.com/bep) [#3376](https://github.com/gohugoio/hugo/issues/3376)
|
||||
* Fix some of the fpm fields for deb [3bd1d057](https://github.com/gohugoio/hugo/commit/3bd1d0571d5f2f6bf0dc8f90a8adf2dbfcb2fdfd) [@anthonyfok](https://github.com/anthonyfok)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,100 +4,100 @@ date: 2017-05-22
|
||||
title: 0.21
|
||||
---
|
||||
|
||||
Hugo `0.21` brings full support for shortcodes per [Output Format](https://gohugo.io/extras/output-formats/) ([#3220](https://github.com/spf13/hugo/issues/3220)), the last vital piece of that puzzle. This is especially useful for `Google AMP` with its many custom media tags.
|
||||
Hugo `0.21` brings full support for shortcodes per [Output Format](https://gohugo.io/extras/output-formats/) ([#3220](https://github.com/gohugoio/hugo/issues/3220)), the last vital piece of that puzzle. This is especially useful for `Google AMP` with its many custom media tags.
|
||||
|
||||
This release represents **126 contributions by 29 contributors** to the main Hugo code base. Since last main release Hugo has **gained 850 stars and 7 additional themes**.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 17156+ [stars](https://github.com/spf13/hugo/stargazers)
|
||||
* 457+ [contributors](https://github.com/spf13/hugo/graphs/contributors)
|
||||
* 17156+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 457+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 163+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@moorereason](https://github.com/moorereason), [@bogem](https://github.com/bogem), and [@munnerz](https://github.com/munnerz) for their ongoing contributions. And as always a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the documentation and the themes site in pristine condition.
|
||||
|
||||
## Other Highlights
|
||||
|
||||
On a more technical side, [@moorereason](https://github.com/moorereason) and [@bep](https://github.com/bep) have introduced namespaces for Hugo's many template funcs ([#3042](https://github.com/spf13/hugo/issues/3042) ). There are so many now, and adding more into that big pile would be a sure path toward losing control. Now they are nicely categorised into namespaces with its own tests and examples, with an API that the documentation site can use to make sure it is correct and up-to-date.
|
||||
On a more technical side, [@moorereason](https://github.com/moorereason) and [@bep](https://github.com/bep) have introduced namespaces for Hugo's many template funcs ([#3042](https://github.com/gohugoio/hugo/issues/3042) ). There are so many now, and adding more into that big pile would be a sure path toward losing control. Now they are nicely categorised into namespaces with its own tests and examples, with an API that the documentation site can use to make sure it is correct and up-to-date.
|
||||
|
||||
## Notes
|
||||
|
||||
* The deprecated `.Extension`, `.Now` and `.TargetPath` will now `ERROR` [544f0a63](https://github.com/spf13/hugo/commit/544f0a6394b0e085d355e8217fc5bb3d96c12a98) [@bep](https://github.com/bep)
|
||||
* The config settings and flags `disable404`, `disableRSS`, `disableSitemap`, `disableRobotsTXT` are now deprecated. Use `disableKinds`. [5794a265](https://github.com/spf13/hugo/commit/5794a265b41ffdeebfd8485eecf65cf4088d49d6) [@bep](https://github.com/bep) [#3345](https://github.com/spf13/hugo/issues/3345)
|
||||
* The deprecated `.Extension`, `.Now` and `.TargetPath` will now `ERROR` [544f0a63](https://github.com/gohugoio/hugo/commit/544f0a6394b0e085d355e8217fc5bb3d96c12a98) [@bep](https://github.com/bep)
|
||||
* The config settings and flags `disable404`, `disableRSS`, `disableSitemap`, `disableRobotsTXT` are now deprecated. Use `disableKinds`. [5794a265](https://github.com/gohugoio/hugo/commit/5794a265b41ffdeebfd8485eecf65cf4088d49d6) [@bep](https://github.com/bep) [#3345](https://github.com/gohugoio/hugo/issues/3345)
|
||||
|
||||
## Enhancements
|
||||
|
||||
### Templates
|
||||
|
||||
* Log a WARNING on wrong usage of `IsSet` [38661c17](https://github.com/spf13/hugo/commit/38661c17bb8c31c9f31ee18f8eba5e3bfddd5574) [@moorereason](https://github.com/moorereason) [#3092](https://github.com/spf13/hugo/issues/3092)
|
||||
* Add support for ellipsed paginator navigator, making paginators with lots of pages more compact [b6ea492b](https://github.com/spf13/hugo/commit/b6ea492b7a6325d04d44eeb00a990a3a0e29e0c0) [@bep](https://github.com/bep) [#3466](https://github.com/spf13/hugo/issues/3466)
|
||||
* Add support for interfaces to `intersect` [f1c29b01](https://github.com/spf13/hugo/commit/f1c29b017bbd88e701cd5151dd186e868672ef89) [@moorereason](https://github.com/moorereason) [#1952](https://github.com/spf13/hugo/issues/1952)
|
||||
* Add `NumFmt` function [93b3b138](https://github.com/spf13/hugo/commit/93b3b1386714999d716e03b131f77234248f1724) [@moorereason](https://github.com/moorereason) [#1444](https://github.com/spf13/hugo/issues/1444)
|
||||
* Add template function namespaces [#3418](https://github.com/spf13/hugo/issues/3418) [#3042](https://github.com/spf13/hugo/issues/3042) [@moorereason](https://github.com/moorereason) [@bep](https://github.com/bep)
|
||||
* Add translation links to the default sitemap template [90d3fbf1](https://github.com/spf13/hugo/commit/90d3fbf1da93a279cfe994a226ae82cf5441deab) [@rayjolt](https://github.com/rayjolt) [#2569](https://github.com/spf13/hugo/issues/2569)
|
||||
* Allow text partials in HTML templates and the other way around [1cf29200](https://github.com/spf13/hugo/commit/1cf29200b4bb0a9c006155ec76759b7f4b1ad925) [@bep](https://github.com/bep) [#3273](https://github.com/spf13/hugo/issues/3273)
|
||||
* Log a WARNING on wrong usage of `IsSet` [38661c17](https://github.com/gohugoio/hugo/commit/38661c17bb8c31c9f31ee18f8eba5e3bfddd5574) [@moorereason](https://github.com/moorereason) [#3092](https://github.com/gohugoio/hugo/issues/3092)
|
||||
* Add support for ellipsed paginator navigator, making paginators with lots of pages more compact [b6ea492b](https://github.com/gohugoio/hugo/commit/b6ea492b7a6325d04d44eeb00a990a3a0e29e0c0) [@bep](https://github.com/bep) [#3466](https://github.com/gohugoio/hugo/issues/3466)
|
||||
* Add support for interfaces to `intersect` [f1c29b01](https://github.com/gohugoio/hugo/commit/f1c29b017bbd88e701cd5151dd186e868672ef89) [@moorereason](https://github.com/moorereason) [#1952](https://github.com/gohugoio/hugo/issues/1952)
|
||||
* Add `NumFmt` function [93b3b138](https://github.com/gohugoio/hugo/commit/93b3b1386714999d716e03b131f77234248f1724) [@moorereason](https://github.com/moorereason) [#1444](https://github.com/gohugoio/hugo/issues/1444)
|
||||
* Add template function namespaces [#3418](https://github.com/gohugoio/hugo/issues/3418) [#3042](https://github.com/gohugoio/hugo/issues/3042) [@moorereason](https://github.com/moorereason) [@bep](https://github.com/bep)
|
||||
* Add translation links to the default sitemap template [90d3fbf1](https://github.com/gohugoio/hugo/commit/90d3fbf1da93a279cfe994a226ae82cf5441deab) [@rayjolt](https://github.com/rayjolt) [#2569](https://github.com/gohugoio/hugo/issues/2569)
|
||||
* Allow text partials in HTML templates and the other way around [1cf29200](https://github.com/gohugoio/hugo/commit/1cf29200b4bb0a9c006155ec76759b7f4b1ad925) [@bep](https://github.com/bep) [#3273](https://github.com/gohugoio/hugo/issues/3273)
|
||||
|
||||
### Output
|
||||
|
||||
* Refactor site rendering with an "output format context". In this release, this is used for shortcode handling only, but this paves the way for future niceness [1e4d082c](https://github.com/spf13/hugo/commit/1e4d082cf5b92fedbc60b1b4f0e9d1ee6ec45e33) [@bep](https://github.com/bep) [#3397](https://github.com/spf13/hugo/issues/3397) [2bcbf104](https://github.com/spf13/hugo/commit/2bcbf104006e0ec03be4fd500f2519301d460f8c) [@bep](https://github.com/bep) [#3220](https://github.com/spf13/hugo/issues/3220)
|
||||
* Refactor site rendering with an "output format context". In this release, this is used for shortcode handling only, but this paves the way for future niceness [1e4d082c](https://github.com/gohugoio/hugo/commit/1e4d082cf5b92fedbc60b1b4f0e9d1ee6ec45e33) [@bep](https://github.com/bep) [#3397](https://github.com/gohugoio/hugo/issues/3397) [2bcbf104](https://github.com/gohugoio/hugo/commit/2bcbf104006e0ec03be4fd500f2519301d460f8c) [@bep](https://github.com/bep) [#3220](https://github.com/gohugoio/hugo/issues/3220)
|
||||
|
||||
|
||||
### Core
|
||||
|
||||
* Handle `shortcode` per `Output Format` [af72db80](https://github.com/spf13/hugo/commit/af72db806f2c1c0bf1dfe5832275c41eeba89906) [@bep](https://github.com/bep) [#3220](https://github.com/spf13/hugo/issues/3220)
|
||||
* Improve shortcode error message [58d9cbd3](https://github.com/spf13/hugo/commit/58d9cbd31bcf7c296a39860fd7e566d10faaff28) [@bep](https://github.com/bep)
|
||||
* Avoid `index.md` in `/index/index.html` [fea4fd86](https://github.com/spf13/hugo/commit/fea4fd86a324bf9679df23f8289887d91b42e919) [@bep](https://github.com/bep) [#3396](https://github.com/spf13/hugo/issues/3396)
|
||||
* Make missing `GitInfo` a `WARNING` [5ad2f176](https://github.com/spf13/hugo/commit/5ad2f17693a9860be76ef8089c8728d2b59d6b04) [@bep](https://github.com/bep) [#3376](https://github.com/spf13/hugo/issues/3376)
|
||||
* Prevent decoding `pageParam` in common cases [e98f885b](https://github.com/spf13/hugo/commit/e98f885b8af27f5473a89d31d0b1f02e61e8a5ec) [@bogem](https://github.com/bogem)
|
||||
* Ignore non-source files on partial rebuild [b5b6e81c](https://github.com/spf13/hugo/commit/b5b6e81c0269abf9b0f4bc6a127744a25344e5c6) [@xofyarg](https://github.com/xofyarg) [#3325](https://github.com/spf13/hugo/issues/3325)
|
||||
* Log `WARNING` only on unknown `/data` files [ab692e73](https://github.com/spf13/hugo/commit/ab692e73dea3ddfe979c88ee236cc394e47e82f1) [@bep](https://github.com/bep) [#3361](https://github.com/spf13/hugo/issues/3361)
|
||||
* Avoid processing the same notify event twice [3b677594](https://github.com/spf13/hugo/commit/3b67759495c9268c30e6ba2d8c7e3b75d52d2960) [@bep](https://github.com/bep)
|
||||
* Only show `rssURI` deprecation `WARNING` if it is actually set [cfd3af8e](https://github.com/spf13/hugo/commit/cfd3af8e691119461effa4385251b9d3818e2291) [@bep](https://github.com/bep) [#3319](https://github.com/spf13/hugo/issues/3319)
|
||||
* Handle `shortcode` per `Output Format` [af72db80](https://github.com/gohugoio/hugo/commit/af72db806f2c1c0bf1dfe5832275c41eeba89906) [@bep](https://github.com/bep) [#3220](https://github.com/gohugoio/hugo/issues/3220)
|
||||
* Improve shortcode error message [58d9cbd3](https://github.com/gohugoio/hugo/commit/58d9cbd31bcf7c296a39860fd7e566d10faaff28) [@bep](https://github.com/bep)
|
||||
* Avoid `index.md` in `/index/index.html` [fea4fd86](https://github.com/gohugoio/hugo/commit/fea4fd86a324bf9679df23f8289887d91b42e919) [@bep](https://github.com/bep) [#3396](https://github.com/gohugoio/hugo/issues/3396)
|
||||
* Make missing `GitInfo` a `WARNING` [5ad2f176](https://github.com/gohugoio/hugo/commit/5ad2f17693a9860be76ef8089c8728d2b59d6b04) [@bep](https://github.com/bep) [#3376](https://github.com/gohugoio/hugo/issues/3376)
|
||||
* Prevent decoding `pageParam` in common cases [e98f885b](https://github.com/gohugoio/hugo/commit/e98f885b8af27f5473a89d31d0b1f02e61e8a5ec) [@bogem](https://github.com/bogem)
|
||||
* Ignore non-source files on partial rebuild [b5b6e81c](https://github.com/gohugoio/hugo/commit/b5b6e81c0269abf9b0f4bc6a127744a25344e5c6) [@xofyarg](https://github.com/xofyarg) [#3325](https://github.com/gohugoio/hugo/issues/3325)
|
||||
* Log `WARNING` only on unknown `/data` files [ab692e73](https://github.com/gohugoio/hugo/commit/ab692e73dea3ddfe979c88ee236cc394e47e82f1) [@bep](https://github.com/bep) [#3361](https://github.com/gohugoio/hugo/issues/3361)
|
||||
* Avoid processing the same notify event twice [3b677594](https://github.com/gohugoio/hugo/commit/3b67759495c9268c30e6ba2d8c7e3b75d52d2960) [@bep](https://github.com/bep)
|
||||
* Only show `rssURI` deprecation `WARNING` if it is actually set [cfd3af8e](https://github.com/gohugoio/hugo/commit/cfd3af8e691119461effa4385251b9d3818e2291) [@bep](https://github.com/bep) [#3319](https://github.com/gohugoio/hugo/issues/3319)
|
||||
|
||||
### Docs
|
||||
|
||||
* Add documentation on slug translation [635b3bb4](https://github.com/spf13/hugo/commit/635b3bb4eb873978c7d52e6c0cb85da0c4d25299) [@xavib](https://github.com/xavib)
|
||||
* Replace `cdn.mathjax.org` with `cdnjs.cloudflare.com` [4b637ac0](https://github.com/spf13/hugo/commit/4b637ac041d17b22187f5ccd0f65461f0065aaa9) [@takuti](https://github.com/takuti)
|
||||
* Add notes about some output format behaviour [162d3a58](https://github.com/spf13/hugo/commit/162d3a586d36cabf6376a76b096fd8b6414487ae) [@jpatters](https://github.com/jpatters)
|
||||
* Add `txtpen` as alternative commenting service [7cdc244a](https://github.com/spf13/hugo/commit/7cdc244a72de4c08edc0008e37aec83d945dccdf) [@rickyhan](https://github.com/rickyhan)
|
||||
* Add documentation on slug translation [635b3bb4](https://github.com/gohugoio/hugo/commit/635b3bb4eb873978c7d52e6c0cb85da0c4d25299) [@xavib](https://github.com/xavib)
|
||||
* Replace `cdn.mathjax.org` with `cdnjs.cloudflare.com` [4b637ac0](https://github.com/gohugoio/hugo/commit/4b637ac041d17b22187f5ccd0f65461f0065aaa9) [@takuti](https://github.com/takuti)
|
||||
* Add notes about some output format behaviour [162d3a58](https://github.com/gohugoio/hugo/commit/162d3a586d36cabf6376a76b096fd8b6414487ae) [@jpatters](https://github.com/jpatters)
|
||||
* Add `txtpen` as alternative commenting service [7cdc244a](https://github.com/gohugoio/hugo/commit/7cdc244a72de4c08edc0008e37aec83d945dccdf) [@rickyhan](https://github.com/rickyhan)
|
||||
|
||||
### Other
|
||||
|
||||
* Embed `Page` in `WeightedPage` [ebf677a5](https://github.com/spf13/hugo/commit/ebf677a58360126d8b9a1e98d086aa4279f53181) [@bep](https://github.com/bep) [#3435](https://github.com/spf13/hugo/issues/3435)
|
||||
* Improve the detection of untranslated strings [a40d1f6e](https://github.com/spf13/hugo/commit/a40d1f6ed2aedddc99725658993258cd557640ed) [@bogem](https://github.com/bogem) [#2607](https://github.com/spf13/hugo/issues/2607)
|
||||
* Make first letter of the Hugo commands flags' usage lowercase [f0f69d03](https://github.com/spf13/hugo/commit/f0f69d03c551acb8ac2eeedaad579cf0b596f9ef) [@bogem](https://github.com/bogem)
|
||||
* Import `Octopress` image tag in `Jekyll importer` [5f3ad1c3](https://github.com/spf13/hugo/commit/5f3ad1c31985450fab8d6772e9cbfcb57cf5cc53) [@buynov](https://github.com/buynov)
|
||||
* Embed `Page` in `WeightedPage` [ebf677a5](https://github.com/gohugoio/hugo/commit/ebf677a58360126d8b9a1e98d086aa4279f53181) [@bep](https://github.com/bep) [#3435](https://github.com/gohugoio/hugo/issues/3435)
|
||||
* Improve the detection of untranslated strings [a40d1f6e](https://github.com/gohugoio/hugo/commit/a40d1f6ed2aedddc99725658993258cd557640ed) [@bogem](https://github.com/bogem) [#2607](https://github.com/gohugoio/hugo/issues/2607)
|
||||
* Make first letter of the Hugo commands flags' usage lowercase [f0f69d03](https://github.com/gohugoio/hugo/commit/f0f69d03c551acb8ac2eeedaad579cf0b596f9ef) [@bogem](https://github.com/bogem)
|
||||
* Import `Octopress` image tag in `Jekyll importer` [5f3ad1c3](https://github.com/gohugoio/hugo/commit/5f3ad1c31985450fab8d6772e9cbfcb57cf5cc53) [@buynov](https://github.com/buynov)
|
||||
|
||||
## Fixes
|
||||
|
||||
### Templates
|
||||
|
||||
* Do not lower case template names [6d2ea0f7](https://github.com/spf13/hugo/commit/6d2ea0f7d7e8a54b8edfc36e52ff74266c30dc27) [@bep](https://github.com/bep) [#3333](https://github.com/spf13/hugo/issues/3333)
|
||||
* Do not lower case template names [6d2ea0f7](https://github.com/gohugoio/hugo/commit/6d2ea0f7d7e8a54b8edfc36e52ff74266c30dc27) [@bep](https://github.com/bep) [#3333](https://github.com/gohugoio/hugo/issues/3333)
|
||||
|
||||
### Output
|
||||
|
||||
* Fix output format mixup in example [10287263](https://github.com/spf13/hugo/commit/10287263f529181d3169668b044cb84e2e3b049a) [@bep](https://github.com/bep) [#3481](https://github.com/spf13/hugo/issues/3481)
|
||||
* Fix base theme vs project base template logic [077005e5](https://github.com/spf13/hugo/commit/077005e514b1ed50d84ceb90c7c72f184cb04521) [@bep](https://github.com/bep) [#3323](https://github.com/spf13/hugo/issues/3323)
|
||||
* Fix output format mixup in example [10287263](https://github.com/gohugoio/hugo/commit/10287263f529181d3169668b044cb84e2e3b049a) [@bep](https://github.com/bep) [#3481](https://github.com/gohugoio/hugo/issues/3481)
|
||||
* Fix base theme vs project base template logic [077005e5](https://github.com/gohugoio/hugo/commit/077005e514b1ed50d84ceb90c7c72f184cb04521) [@bep](https://github.com/bep) [#3323](https://github.com/gohugoio/hugo/issues/3323)
|
||||
|
||||
### Core
|
||||
* Render `404` in default language only [154e18dd](https://github.com/spf13/hugo/commit/154e18ddb9ad205055d5bd4827c87f3f0daf499f) [@mitchchn](https://github.com/mitchchn) [#3075](https://github.com/spf13/hugo/issues/3075)
|
||||
* Fix `RSSLink` vs `RSS` `Output Format` [e682fcc6](https://github.com/spf13/hugo/commit/e682fcc62233b47cf5bdcaf598ac0657ef089471) [@bep](https://github.com/bep) [#3450](https://github.com/spf13/hugo/issues/3450)
|
||||
* Add default config for `ignoreFiles`, making that option work when running in server mode [42f4ce15](https://github.com/spf13/hugo/commit/42f4ce15a9d68053da36f9efcf7a7d975cc59559) [@chaseadamsio](https://github.com/chaseadamsio)
|
||||
* Fix output formats override when no outputs definition given [6e2f2dd8](https://github.com/spf13/hugo/commit/6e2f2dd8d3ca61c92a2ee8824fbf05cadef08425) [@bep](https://github.com/bep) [#3447](https://github.com/spf13/hugo/issues/3447)
|
||||
* Fix handling of zero-length files [0e87b18b](https://github.com/spf13/hugo/commit/0e87b18b66d2c8ba9e2abc429630cb03f5b093d6) [@bep](https://github.com/bep) [#3355](https://github.com/spf13/hugo/issues/3355)
|
||||
* Must recreate `Paginator` on live-reload [45c74526](https://github.com/spf13/hugo/commit/45c74526686f6a2afa02bcee767d837d6b9dd028) [@bep](https://github.com/bep) [#3315](https://github.com/spf13/hugo/issues/3315)
|
||||
* Render `404` in default language only [154e18dd](https://github.com/gohugoio/hugo/commit/154e18ddb9ad205055d5bd4827c87f3f0daf499f) [@mitchchn](https://github.com/mitchchn) [#3075](https://github.com/gohugoio/hugo/issues/3075)
|
||||
* Fix `RSSLink` vs `RSS` `Output Format` [e682fcc6](https://github.com/gohugoio/hugo/commit/e682fcc62233b47cf5bdcaf598ac0657ef089471) [@bep](https://github.com/bep) [#3450](https://github.com/gohugoio/hugo/issues/3450)
|
||||
* Add default config for `ignoreFiles`, making that option work when running in server mode [42f4ce15](https://github.com/gohugoio/hugo/commit/42f4ce15a9d68053da36f9efcf7a7d975cc59559) [@chaseadamsio](https://github.com/chaseadamsio)
|
||||
* Fix output formats override when no outputs definition given [6e2f2dd8](https://github.com/gohugoio/hugo/commit/6e2f2dd8d3ca61c92a2ee8824fbf05cadef08425) [@bep](https://github.com/bep) [#3447](https://github.com/gohugoio/hugo/issues/3447)
|
||||
* Fix handling of zero-length files [0e87b18b](https://github.com/gohugoio/hugo/commit/0e87b18b66d2c8ba9e2abc429630cb03f5b093d6) [@bep](https://github.com/bep) [#3355](https://github.com/gohugoio/hugo/issues/3355)
|
||||
* Must recreate `Paginator` on live-reload [45c74526](https://github.com/gohugoio/hugo/commit/45c74526686f6a2afa02bcee767d837d6b9dd028) [@bep](https://github.com/bep) [#3315](https://github.com/gohugoio/hugo/issues/3315)
|
||||
|
||||
### Docs
|
||||
|
||||
* Fix incorrect path in `templates/list` [27e88154](https://github.com/spf13/hugo/commit/27e88154af2dd9af6d0523d6e67b612e6336f91c) [@MunifTanjim](https://github.com/MunifTanjim)
|
||||
* Fixed incorrect specification of directory structure [a28fbca6](https://github.com/spf13/hugo/commit/a28fbca6dcfa80b6541f5ef6c8c12cd1804ae9ed) [@TejasQ](https://github.com/TejasQ)
|
||||
* Fix `bash` command in `tutorials/github-pages-blog` [c9976155](https://github.com/spf13/hugo/commit/c99761555c014e4d041438d5d7e53a6cbaee4492) [@hansott](https://github.com/hansott)
|
||||
* Fix `.Data.Pages` range in example [b5e32eb6](https://github.com/spf13/hugo/commit/b5e32eb60993b4656918af2c959ae217a68c461e) [@hxlnt](https://github.com/hxlnt)
|
||||
* Fix incorrect path in `templates/list` [27e88154](https://github.com/gohugoio/hugo/commit/27e88154af2dd9af6d0523d6e67b612e6336f91c) [@MunifTanjim](https://github.com/MunifTanjim)
|
||||
* Fixed incorrect specification of directory structure [a28fbca6](https://github.com/gohugoio/hugo/commit/a28fbca6dcfa80b6541f5ef6c8c12cd1804ae9ed) [@TejasQ](https://github.com/TejasQ)
|
||||
* Fix `bash` command in `tutorials/github-pages-blog` [c9976155](https://github.com/gohugoio/hugo/commit/c99761555c014e4d041438d5d7e53a6cbaee4492) [@hansott](https://github.com/hansott)
|
||||
* Fix `.Data.Pages` range in example [b5e32eb6](https://github.com/gohugoio/hugo/commit/b5e32eb60993b4656918af2c959ae217a68c461e) [@hxlnt](https://github.com/hxlnt)
|
||||
|
||||
### Other
|
||||
|
||||
* Fix data race in live-reload close, avoiding some rare panics [355736ec](https://github.com/spf13/hugo/commit/355736ec357c81dfb2eb6851ee019d407090c5ec) [@bep](https://github.com/bep) [#2625](https://github.com/spf13/hugo/issues/2625)
|
||||
* Skip `.git` directories in file scan [94b5be67](https://github.com/spf13/hugo/commit/94b5be67fc73b87d114d94a7bb1a33ab997f30f1) [@bogem](https://github.com/bogem) [#3468](https://github.com/spf13/hugo/issues/3468)
|
||||
* Fix data race in live-reload close, avoiding some rare panics [355736ec](https://github.com/gohugoio/hugo/commit/355736ec357c81dfb2eb6851ee019d407090c5ec) [@bep](https://github.com/bep) [#2625](https://github.com/gohugoio/hugo/issues/2625)
|
||||
* Skip `.git` directories in file scan [94b5be67](https://github.com/gohugoio/hugo/commit/94b5be67fc73b87d114d94a7bb1a33ab997f30f1) [@bogem](https://github.com/bogem) [#3468](https://github.com/gohugoio/hugo/issues/3468)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ title: 0.22
|
||||
---
|
||||
|
||||
|
||||
Hugo `0.22` brings **nested sections**, by popular demand and a long sought after feature ([#465](https://github.com/spf13/hugo/issues/465)). We are still low on documentation for this great feature, but [@bep](https://github.com/bep) has been kind enough to accompany his implementation with a [demo site](http://hugotest.bep.is/).
|
||||
Hugo `0.22` brings **nested sections**, by popular demand and a long sought after feature ([#465](https://github.com/gohugoio/hugo/issues/465)). We are still low on documentation for this great feature, but [@bep](https://github.com/bep) has been kind enough to accompany his implementation with a [demo site](http://hugotest.bep.is/).
|
||||
|
||||
This release represents **58 contributions by 10 contributors** to the main Hugo code base. Since last release Hugo has **gained 420 stars and 2 additional themes.**
|
||||
|
||||
@@ -13,13 +13,13 @@ This release represents **58 contributions by 10 contributors** to the main Hugo
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 17576+ [stars](https://github.com/spf13/hugo/stargazers)
|
||||
* 455+ [contributors](https://github.com/spf13/hugo/graphs/contributors)
|
||||
* 17576+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 455+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 165+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Other Highlights
|
||||
|
||||
`.Site.GetPage` can now also be used to get regular pages ([#2844](https://github.com/spf13/hugo/issues/2844)):
|
||||
`.Site.GetPage` can now also be used to get regular pages ([#2844](https://github.com/gohugoio/hugo/issues/2844)):
|
||||
|
||||
```go
|
||||
{{ (.Site.GetPage "page" "blog" "mypost.md" ).Title }}
|
||||
@@ -37,49 +37,49 @@ Also, considerable work has been put into writing automated benchmark tests for
|
||||
|
||||
### Templates
|
||||
|
||||
* Add `uint` support to `In` [b82cd82f](https://github.com/spf13/hugo/commit/b82cd82f1198a371ed94bda7faafe22813f4cb29) [@moorereason](https://github.com/moorereason)
|
||||
* Support interfaces in `union` [204c3a9e](https://github.com/spf13/hugo/commit/204c3a9e32fcf6617ede978e35d3e2e89a5b491c) [@moorereason](https://github.com/moorereason) [#3411](https://github.com/spf13/hugo/issues/3411)
|
||||
* Add `uniq` function [e28d9aa4](https://github.com/spf13/hugo/commit/e28d9aa42c3429d22fe254e69e4605aaf1e684f3) [@adiabatic](https://github.com/adiabatic)
|
||||
* Handle `template.HTML` and friends in `ToInt` [4113693a](https://github.com/spf13/hugo/commit/4113693ac1b275f3a40aa5c248269340ef9b57f6) [@moorereason](https://github.com/moorereason) [#3308](https://github.com/spf13/hugo/issues/3308)
|
||||
* Add `uint` support to `In` [b82cd82f](https://github.com/gohugoio/hugo/commit/b82cd82f1198a371ed94bda7faafe22813f4cb29) [@moorereason](https://github.com/moorereason)
|
||||
* Support interfaces in `union` [204c3a9e](https://github.com/gohugoio/hugo/commit/204c3a9e32fcf6617ede978e35d3e2e89a5b491c) [@moorereason](https://github.com/moorereason) [#3411](https://github.com/gohugoio/hugo/issues/3411)
|
||||
* Add `uniq` function [e28d9aa4](https://github.com/gohugoio/hugo/commit/e28d9aa42c3429d22fe254e69e4605aaf1e684f3) [@adiabatic](https://github.com/adiabatic)
|
||||
* Handle `template.HTML` and friends in `ToInt` [4113693a](https://github.com/gohugoio/hugo/commit/4113693ac1b275f3a40aa5c248269340ef9b57f6) [@moorereason](https://github.com/moorereason) [#3308](https://github.com/gohugoio/hugo/issues/3308)
|
||||
|
||||
|
||||
### Core
|
||||
|
||||
* Make the `RSS feed` use the date for the node it represents [f1da5a15](https://github.com/spf13/hugo/commit/f1da5a15a37666ee59350d6600a8c14c1383f5bc) [@bep](https://github.com/bep) [#2708](https://github.com/spf13/hugo/issues/2708)
|
||||
* Enable `nested sections` [b3968939](https://github.com/spf13/hugo/commit/b39689393ccb8434d9a57658a64b77568c718e99) [@bep](https://github.com/bep) [#465](https://github.com/spf13/hugo/issues/465)
|
||||
* Add test for "no 404" in `sitemap` [8aaec644](https://github.com/spf13/hugo/commit/8aaec644a90d09bd7f079d35d382f76bb4ed35db) [@bep](https://github.com/bep) [#3563](https://github.com/spf13/hugo/issues/3563)
|
||||
* Support regular pages in `.Site.GetPage` [e0c2e798](https://github.com/spf13/hugo/commit/e0c2e798201f75ae6e9a81a7442355288c2d141b) [@bep](https://github.com/bep) [#2844](https://github.com/spf13/hugo/issues/2844)
|
||||
[#3082](https://github.com/spf13/hugo/issues/3082)
|
||||
* Make the `RSS feed` use the date for the node it represents [f1da5a15](https://github.com/gohugoio/hugo/commit/f1da5a15a37666ee59350d6600a8c14c1383f5bc) [@bep](https://github.com/bep) [#2708](https://github.com/gohugoio/hugo/issues/2708)
|
||||
* Enable `nested sections` [b3968939](https://github.com/gohugoio/hugo/commit/b39689393ccb8434d9a57658a64b77568c718e99) [@bep](https://github.com/bep) [#465](https://github.com/gohugoio/hugo/issues/465)
|
||||
* Add test for "no 404" in `sitemap` [8aaec644](https://github.com/gohugoio/hugo/commit/8aaec644a90d09bd7f079d35d382f76bb4ed35db) [@bep](https://github.com/bep) [#3563](https://github.com/gohugoio/hugo/issues/3563)
|
||||
* Support regular pages in `.Site.GetPage` [e0c2e798](https://github.com/gohugoio/hugo/commit/e0c2e798201f75ae6e9a81a7442355288c2d141b) [@bep](https://github.com/bep) [#2844](https://github.com/gohugoio/hugo/issues/2844)
|
||||
[#3082](https://github.com/gohugoio/hugo/issues/3082)
|
||||
|
||||
### Performance
|
||||
* Add site building benchmarks [8930e259](https://github.com/spf13/hugo/commit/8930e259d78cba4041b550cc51a7f40bc91d7c20) [@bep](https://github.com/bep) [#3535](https://github.com/spf13/hugo/issues/3535)
|
||||
* Add a cache to `GetPage` which makes it much faster [50d11138](https://github.com/spf13/hugo/commit/50d11138f3e18b545c15fadf52f7b0b744bf3e7c) [@bep](https://github.com/bep)
|
||||
* Speed up `GetPage` [fbb78b89](https://github.com/spf13/hugo/commit/fbb78b89df8ccef8f0ab26af00aa45d35c1ee2cf) [@bep](https://github.com/bep) [#3503](https://github.com/spf13/hugo/issues/3503)
|
||||
* Add BenchmarkFrontmatterTags [3d9c4f51](https://github.com/spf13/hugo/commit/3d9c4f513b0443648d7e88995e351df1739646d2) [@bep](https://github.com/bep) [#3464](https://github.com/spf13/hugo/issues/3464)
|
||||
* Add `benchSite.sh` to make it easy to run Hugo performance benchmarks [d74452cf](https://github.com/spf13/hugo/commit/d74452cfe8f69a85ec83e05481e16bebf199a5cb) [@bep](https://github.com/bep)
|
||||
* Cache language config [4aff2b6e](https://github.com/spf13/hugo/commit/4aff2b6e7409a308f30cff1825fec02991e0d56a) [@bep](https://github.com/bep)
|
||||
* Temporarily revert to BurntSushi for `TOML` front matter handling; it is currently much faster [0907a5c1](https://github.com/spf13/hugo/commit/0907a5c1c293755e6bf297246f07888448d81f8b) [@bep](https://github.com/bep) [#3541](https://github.com/spf13/hugo/issues/3541) [#3464](https://github.com/spf13/hugo/issues/3464)
|
||||
* Add a simple partitioned lazy cache [87203139](https://github.com/spf13/hugo/commit/87203139c38e0b992c96d7b8a23c7730649c68e5) [@bep](https://github.com/bep)
|
||||
* Add site building benchmarks [8930e259](https://github.com/gohugoio/hugo/commit/8930e259d78cba4041b550cc51a7f40bc91d7c20) [@bep](https://github.com/bep) [#3535](https://github.com/gohugoio/hugo/issues/3535)
|
||||
* Add a cache to `GetPage` which makes it much faster [50d11138](https://github.com/gohugoio/hugo/commit/50d11138f3e18b545c15fadf52f7b0b744bf3e7c) [@bep](https://github.com/bep)
|
||||
* Speed up `GetPage` [fbb78b89](https://github.com/gohugoio/hugo/commit/fbb78b89df8ccef8f0ab26af00aa45d35c1ee2cf) [@bep](https://github.com/bep) [#3503](https://github.com/gohugoio/hugo/issues/3503)
|
||||
* Add BenchmarkFrontmatterTags [3d9c4f51](https://github.com/gohugoio/hugo/commit/3d9c4f513b0443648d7e88995e351df1739646d2) [@bep](https://github.com/bep) [#3464](https://github.com/gohugoio/hugo/issues/3464)
|
||||
* Add `benchSite.sh` to make it easy to run Hugo performance benchmarks [d74452cf](https://github.com/gohugoio/hugo/commit/d74452cfe8f69a85ec83e05481e16bebf199a5cb) [@bep](https://github.com/bep)
|
||||
* Cache language config [4aff2b6e](https://github.com/gohugoio/hugo/commit/4aff2b6e7409a308f30cff1825fec02991e0d56a) [@bep](https://github.com/bep)
|
||||
* Temporarily revert to BurntSushi for `TOML` front matter handling; it is currently much faster [0907a5c1](https://github.com/gohugoio/hugo/commit/0907a5c1c293755e6bf297246f07888448d81f8b) [@bep](https://github.com/bep) [#3541](https://github.com/gohugoio/hugo/issues/3541) [#3464](https://github.com/gohugoio/hugo/issues/3464)
|
||||
* Add a simple partitioned lazy cache [87203139](https://github.com/gohugoio/hugo/commit/87203139c38e0b992c96d7b8a23c7730649c68e5) [@bep](https://github.com/bep)
|
||||
|
||||
### Other
|
||||
|
||||
* Add `noindex` tag to HTML generated by Hugo aliases [d5ab7f08](https://github.com/spf13/hugo/commit/d5ab7f087d967b30e7de7d789e6ad3091b42f1f7) [@onedrawingperday](https://github.com/onedrawingperday)
|
||||
* Update Go versions [bde807bd](https://github.com/spf13/hugo/commit/bde807bd1e560fb4cc765c0fc22132db7f8a0801) [@bep](https://github.com/bep)
|
||||
* Remove the `rlimit` tweaking on `macOS` [bcd32f10](https://github.com/spf13/hugo/commit/bcd32f1086c8c604fb22a7496924e41cc46b1605) [@bep](https://github.com/bep) [#3512](https://github.com/spf13/hugo/issues/3512)
|
||||
* Add `noindex` tag to HTML generated by Hugo aliases [d5ab7f08](https://github.com/gohugoio/hugo/commit/d5ab7f087d967b30e7de7d789e6ad3091b42f1f7) [@onedrawingperday](https://github.com/onedrawingperday)
|
||||
* Update Go versions [bde807bd](https://github.com/gohugoio/hugo/commit/bde807bd1e560fb4cc765c0fc22132db7f8a0801) [@bep](https://github.com/bep)
|
||||
* Remove the `rlimit` tweaking on `macOS` [bcd32f10](https://github.com/gohugoio/hugo/commit/bcd32f1086c8c604fb22a7496924e41cc46b1605) [@bep](https://github.com/bep) [#3512](https://github.com/gohugoio/hugo/issues/3512)
|
||||
|
||||
### Docs
|
||||
* Rewrite “Archetypes” article [@davidturnbull](https://github.com/davidturnbull) [#3543](https://github.com/spf13/hugo/pull/3543/)
|
||||
* Remove Unmaintaned Frontends from Tools. [f41f7282](https://github.com/spf13/hugo/commit/f41f72822251c9a31031fd5b3dda585c57c8b028) [@onedrawingperday](https://github.com/onedrawingperday)
|
||||
* Rewrite “Archetypes” article [@davidturnbull](https://github.com/davidturnbull) [#3543](https://github.com/gohugoio/hugo/pull/3543/)
|
||||
* Remove Unmaintaned Frontends from Tools. [f41f7282](https://github.com/gohugoio/hugo/commit/f41f72822251c9a31031fd5b3dda585c57c8b028) [@onedrawingperday](https://github.com/onedrawingperday)
|
||||
|
||||
## Fixes
|
||||
|
||||
### Core
|
||||
* Improve `live-reload` on directory structure changes making removal of directories or pasting new content directories into `/content` just work [fe901b81](https://github.com/spf13/hugo/commit/fe901b81191860b60e6fcb29f8ebf87baef2ee79) [@bep](https://github.com/bep) [#3570](https://github.com/spf13/hugo/issues/3570)
|
||||
* Respect `disableKinds=["sitemap"]` [69d92dc4](https://github.com/spf13/hugo/commit/69d92dc49cb8ab9276ab013d427ba2d9aaf9135d) [@bep](https://github.com/bep) [#3544](https://github.com/spf13/hugo/issues/3544)
|
||||
* Fix `disablePathToLower` regression [5be04486](https://github.com/spf13/hugo/commit/5be0448635fdf5fe6b1ee673e869f2b9baf1a5c6) [@bep](https://github.com/bep) [#3374](https://github.com/spf13/hugo/issues/3374)
|
||||
* Fix `ref`/`relref` issue with duplicate base filenames [612f6e3a](https://github.com/spf13/hugo/commit/612f6e3afe0510c31f70f3621f3dc8ba609dade4) [@bep](https://github.com/bep) [#2507](https://github.com/spf13/hugo/issues/2507)
|
||||
* Improve `live-reload` on directory structure changes making removal of directories or pasting new content directories into `/content` just work [fe901b81](https://github.com/gohugoio/hugo/commit/fe901b81191860b60e6fcb29f8ebf87baef2ee79) [@bep](https://github.com/bep) [#3570](https://github.com/gohugoio/hugo/issues/3570)
|
||||
* Respect `disableKinds=["sitemap"]` [69d92dc4](https://github.com/gohugoio/hugo/commit/69d92dc49cb8ab9276ab013d427ba2d9aaf9135d) [@bep](https://github.com/bep) [#3544](https://github.com/gohugoio/hugo/issues/3544)
|
||||
* Fix `disablePathToLower` regression [5be04486](https://github.com/gohugoio/hugo/commit/5be0448635fdf5fe6b1ee673e869f2b9baf1a5c6) [@bep](https://github.com/bep) [#3374](https://github.com/gohugoio/hugo/issues/3374)
|
||||
* Fix `ref`/`relref` issue with duplicate base filenames [612f6e3a](https://github.com/gohugoio/hugo/commit/612f6e3afe0510c31f70f3621f3dc8ba609dade4) [@bep](https://github.com/bep) [#2507](https://github.com/gohugoio/hugo/issues/2507)
|
||||
|
||||
### Docs
|
||||
|
||||
* Fix parameter name in `YouTube` shortcode section [37e37877](https://github.com/spf13/hugo/commit/37e378773fbc127863f2b7a389d5ce3a14674c73) [@zivbk1](https://github.com/zivbk1)
|
||||
* Fix parameter name in `YouTube` shortcode section [37e37877](https://github.com/gohugoio/hugo/commit/37e378773fbc127863f2b7a389d5ce3a14674c73) [@zivbk1](https://github.com/zivbk1)
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
---
|
||||
date: 2017-06-13
|
||||
title: 0.22.1
|
||||
---
|
||||
|
||||
|
||||
|
||||
Hugo `0.22.1` fixes a couple of issues reported after the [0.22 release](https://github.com/gohugoio/hugo/releases/tag/v0.22) Monday. Most importantly a fix for detecting regular subfolders below the root-sections.
|
||||
|
||||
Also, we forgot to adapt the `permalink settings` with support for nested sections, which made that feature less useful than it could be.
|
||||
|
||||
With this release you can configure **permalinks with sections** like this:
|
||||
|
||||
**First level only:**
|
||||
|
||||
```toml
|
||||
[permalinks]
|
||||
blog = ":section/:title"
|
||||
```
|
||||
|
||||
**Nested (all levels):**
|
||||
|
||||
```toml
|
||||
[permalinks]
|
||||
blog = ":sections/:title"
|
||||
```
|
||||
## Fixes
|
||||
|
||||
* Fix section logic for root folders with subfolders [a30023f5](https://github.com/gohugoio/hugo/commit/a30023f5cbafd06034807255181a5b7b17f3c25f) [@bep](https://github.com/bep) [#3586](https://github.com/gohugoio/hugo/issues/3586)
|
||||
* Support sub-sections in permalink settings [1f26420d](https://github.com/gohugoio/hugo/commit/1f26420d392a5ab4c7b7fe1911c0268b45d01ab8) [@bep](https://github.com/bep) [#3580](https://github.com/gohugoio/hugo/issues/3580)
|
||||
* Adjust rlimit to 64000 [ff54b6bd](https://github.com/gohugoio/hugo/commit/ff54b6bddcefab45339d8dc2b13776b92bdc04b9) [@bep](https://github.com/bep) [#3582](https://github.com/gohugoio/hugo/issues/3582)
|
||||
* Make error on setting rlimit a warning only [629e1439](https://github.com/gohugoio/hugo/commit/629e1439e819a7118ae483381d4634f16d3474dd) [@bep](https://github.com/bep) [#3582](https://github.com/gohugoio/hugo/issues/3582)
|
||||
* Revert: Remove the rlimit tweaking on macOS" [26aa06a3](https://github.com/gohugoio/hugo/commit/26aa06a3db57ab7134a900d641fa2976f7971520) [@bep](https://github.com/bep) [#3582](https://github.com/gohugoio/hugo/issues/3582)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
---
|
||||
date: 2017-06-16
|
||||
title: 0.23
|
||||
---
|
||||
|
||||
|
||||
Hugo `0.23` is mainly a release that handles all the small changes needed to get Hugo moved to a GitHub organisation: [gohugoio](https://github.com/gohugoio), but it also contains a couple of important fixes that makes this an update worth-while for all.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 17739+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 494+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 165+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix handling of duplicate footnotes [a9e551a1](https://github.com/gohugoio/hugo/commit/a9e551a100e60a603210ee083103dd73369d6a98) [@bep](https://github.com/bep) [#1912](https://github.com/gohugoio/hugo/issues/1912)
|
||||
* Add support for spaces in project folder for `GitInfo` #3533 #3552
|
||||
|
||||
## GitHub organisation related changes
|
||||
|
||||
* Update layout references to gohugoio/hugo [66d4850b](https://github.com/gohugoio/hugo/commit/66d4850b89db293dc58e828de784037f06c6c8dc) [@bep](https://github.com/bep)
|
||||
* Update content references to gohugoio/hugo [715ff1f8](https://github.com/gohugoio/hugo/commit/715ff1f87406edf27738c8c0f52fe185fa974ee8) [@bep](https://github.com/bep)
|
||||
* Add note on updates for rpm-based distros [52a0cea6](https://github.com/gohugoio/hugo/commit/52a0cea65de7b75ae1662abe3dec36fca3604617) [@daftaupe](https://github.com/daftaupe)
|
||||
* Update logo link in README [ccb8300d](https://github.com/gohugoio/hugo/commit/ccb8300d380636d75a39f4133284eb0109e836c3) [@bep](https://github.com/bep)
|
||||
* Remove docs building from CI builds [214dbdfb](https://github.com/gohugoio/hugo/commit/214dbdfb6f016d21415bc1ed511a37a084238878) [@bep](https://github.com/bep)
|
||||
* Adjust docs path [729be807](https://github.com/gohugoio/hugo/commit/729be8074bddb58c9111f32c55cc769e49cd0d5a) [@bep](https://github.com/bep)
|
||||
* Add docs as submodule [6cee0dfe](https://github.com/gohugoio/hugo/commit/6cee0dfe53899d433afc3c173a87d56265904cb0) [@bep](https://github.com/bep)
|
||||
* Update Gitter link in README [fbb25014](https://github.com/gohugoio/hugo/commit/fbb25014e1306ce7127d53e5fc4fc49867790336) [@bep](https://github.com/bep)
|
||||
* Change Windows build badge link, take #3 [86543d6a](https://github.com/gohugoio/hugo/commit/86543d6a50251b40540ebd0b851d45eb99d017c7) [@bep](https://github.com/bep)
|
||||
* Update Windows build link [e6ae32a0](https://github.com/gohugoio/hugo/commit/e6ae32a0ba75b9894418227e87391defbb1b3b49) [@bep](https://github.com/bep)
|
||||
* Update links in CONTRIBUTING.md due to the org transition [95386544](https://github.com/gohugoio/hugo/commit/95386544e858949a2baa414f395f30aaf66a6257) [@digitalcraftsman](https://github.com/digitalcraftsman)
|
||||
* Update source path in Dockerfile due to the org transition [7b99fb9f](https://github.com/gohugoio/hugo/commit/7b99fb9f1ca8381457afe9d8e953a388b8ada182) [@digitalcraftsman](https://github.com/digitalcraftsman)
|
||||
* Update clone folder in appveyor.yml due to the org transition [d531d17b](https://github.com/gohugoio/hugo/commit/d531d17b3be0b14faf4934611e01ac3289e37835) [@digitalcraftsman](https://github.com/digitalcraftsman)
|
||||
* Update import path in snapcraft.yaml due to the org transition [9266bf9d](https://github.com/gohugoio/hugo/commit/9266bf9d4c24592b875a7f6b92f761b4cea40879) [@digitalcraftsman](https://github.com/digitalcraftsman)
|
||||
* Run gofmt to get imports in line vs gohugoio/hugo [873a6f18](https://github.com/gohugoio/hugo/commit/873a6f18851bcda79d562ff6c02e1109e8e31a88) [@bep](https://github.com/bep)
|
||||
* Update Makefile vs gohugoio/hugo [f503d76a](https://github.com/gohugoio/hugo/commit/f503d76a3b2719bbb65ab9df5595d0dbc871fae9) [@bep](https://github.com/bep)
|
||||
* Update README to point to gohugoio/hugo [93643860](https://github.com/gohugoio/hugo/commit/93643860c9db10c6c32176b17cc83f1c317279bd) [@bep](https://github.com/bep)
|
||||
* Update examples to point to gohugoio/hugo [db46bcf8](https://github.com/gohugoio/hugo/commit/db46bcf82d060656d4bc731550e63ec9cf8576f2) [@bep](https://github.com/bep)
|
||||
* Update textual references in Go source to point to gohugoio/hugo [c17ad675](https://github.com/gohugoio/hugo/commit/c17ad675e8fcdb2db40fc50816b8f016bc14294c) [@bep](https://github.com/bep)
|
||||
* Update import paths to gohugoio/hugo [d8717cd4](https://github.com/gohugoio/hugo/commit/d8717cd4c74e80ea8e20adead9321412a2d76022) [@bep](https://github.com/bep)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
---
|
||||
date: 2017-06-21
|
||||
title: 0.24
|
||||
---
|
||||
|
||||
|
||||
This is **The Revival of the Archetypes!**
|
||||
|
||||
> "A feature that could be the name of the next Indiana Jones movie deserves its own release," says [@bep](https://github.com/bep).
|
||||
|
||||
Hugo now handles the **archetype files as Go templates**. This means that the issues with sorting and lost comments are long gone. This also means that you will have to supply all values, including title and date. But this also opens up a lot of new windows.
|
||||
|
||||
A fictional example for the section `newsletter` and the archetype file `archetypes/newsletter.md`:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: "{{ replace .TranslationBaseName "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
||||
**Insert Lead paragraph here.**
|
||||
|
||||
<!--more-->
|
||||
|
||||
## New Cool Posts
|
||||
|
||||
{{ range first 10 ( where .Site.RegularPages "Type" "cool" ) }}
|
||||
* {{ .Title }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
And then create a new post with:
|
||||
|
||||
```bash
|
||||
hugo new newsletter/the-latest-cool.stuff.md
|
||||
```
|
||||
|
||||
**Note:** the site will only be built if the `.Site` is in use in the archetype file, and this can be time consuming for big sites.
|
||||
|
||||
**Hot Tip:** If you set the `newContentEditor` configuration variable to an editor on your `PATH`, the newly created article will be opened.
|
||||
|
||||
The above _newsletter type archetype_ illustrates the possibilities: The full Hugo `.Site` and all of Hugo's template funcs can be used in the archetype file.
|
||||
|
||||
**Also, Hugo now supports archetype files for all content formats, not just markdown.**
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 17839+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 493+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 166+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Notes
|
||||
|
||||
Archetype files now need to be complete, including `title` and `date`.
|
||||
|
||||
## Enhancements
|
||||
|
||||
* Support extension-less media types. The motivation behind this change is to support Netlify's `_redirects` files, so we can generate server-side redirects for the Hugo docs site. See [this commit](https://github.com/gohugoio/hugoDocs/commit/c1ab9894e8292e0a74c43bbca2263b1fb3840f9e) to see how we configured that. [0f40e1fa](https://github.com/gohugoio/hugo/commit/0f40e1fadfca2276f65adefa6d7d5d63aef9160a) [@bep](https://github.com/bep) [#3614](https://github.com/gohugoio/hugo/issues/3614)
|
||||
* Add `disableAliases` [516e6c6d](https://github.com/gohugoio/hugo/commit/516e6c6dc5733cdaf985317d58eedbc6ec0ef2f7) [@bep](https://github.com/bep) [#3613](https://github.com/gohugoio/hugo/issues/3613)
|
||||
* Support non-md files as archetype files [19f2e729](https://github.com/gohugoio/hugo/commit/19f2e729135af700c5d4aa06e7b3540e6d4847fd) [@bep](https://github.com/bep) [#3597](https://github.com/gohugoio/hugo/issues/3597) [#3618](https://github.com/gohugoio/hugo/issues/3618)
|
||||
* Identify extension-less text types as text [c43b512b](https://github.com/gohugoio/hugo/commit/c43b512b4700f76ac77f12d632bb030c3a241393) [@bep](https://github.com/bep) [#3614](https://github.com/gohugoio/hugo/issues/3614)
|
||||
* Add `.Site` to the archetype templates [662e12f3](https://github.com/gohugoio/hugo/commit/662e12f348a638a6fcc92a416ee7f7c2a7ef8792) [@bep](https://github.com/bep) [#1629](https://github.com/gohugoio/hugo/issues/1629)
|
||||
* Use archetype template as-is as a Go template [422057f6](https://github.com/gohugoio/hugo/commit/422057f60709696bbbd1c38c9ead2bf114d47e31) [@bep](https://github.com/bep) [#452](https://github.com/gohugoio/hugo/issues/452) [#1629](https://github.com/gohugoio/hugo/issues/1629)
|
||||
* Update links to new discuss URL [4aa12390](https://github.com/gohugoio/hugo/commit/4aa1239070bb9d4324d3582f3e809b702a59d3ac) [@bep](https://github.com/bep)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix error handling for `JSON` front matter [fb53987a](https://github.com/gohugoio/hugo/commit/fb53987a4ff2acb9da8dec6ec7b11924d37352ce) [@bep](https://github.com/bep) [#3610](https://github.com/gohugoio/hugo/issues/3610)
|
||||
* Fix handling of quoted brackets in `JSON` front matter [3183b9a2](https://github.com/gohugoio/hugo/commit/3183b9a29d8adac962fbc73f79b04542f4c4c55d) [@bep](https://github.com/bep) [#3511](https://github.com/gohugoio/hugo/issues/3511)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
---
|
||||
date: 2017-06-24
|
||||
title: 0.24.1
|
||||
---
|
||||
|
||||
|
||||
|
||||
This release fixes some important **archetype-related regressions** from the recent Hugo 0.24-release.
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix archetype regression when no archetype file [4294dd8d](https://github.com/gohugoio/hugo/commit/4294dd8d9d22bd8107b7904d5389967da1f83f27) [@bep](https://github.com/bep) [#3626](https://github.com/gohugoio/hugo/issues/3626)
|
||||
* Preserve shortcodes in archetype templates [b63e4ee1](https://github.com/gohugoio/hugo/commit/b63e4ee198c875b73a6a9af6bb809589785ed589) [@bep](https://github.com/bep) [#3623](https://github.com/gohugoio/hugo/issues/3623)
|
||||
* Fix handling of timezones with positive UTC offset (e.g., +0800) in TOML [0744f81e](https://github.com/gohugoio/hugo/commit/0744f81ec00bb8888f59d6c8b5f57096e07e70b1) [@bep](https://github.com/bep) [#3628](https://github.com/gohugoio/hugo/issues/3628)
|
||||
|
||||
## Enhancements
|
||||
|
||||
* Create default archetype on new site [bfa336d9](https://github.com/gohugoio/hugo/commit/bfa336d96173377b9bbe2298dbd101f6a718c174) [@bep](https://github.com/bep) [#3626](https://github.com/gohugoio/hugo/issues/3626)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
|
||||
---
|
||||
date: 2017-07-07
|
||||
title: 0.25
|
||||
---
|
||||
|
||||
Hugo `0.25` is the **Kinder Surprise**: It automatically opens the page you're working on in the browser, it adds full `AND` and `OR` support in page queries, and you can now have templates per language.
|
||||
|
||||

|
||||
|
||||
If you start with `hugo server --navigateToChanged`, Hugo will navigate to the relevant page on save (see animated GIF). This is extremely useful for site-wide edits. Another very useful feature in this version is the added support for `AND` (`intersect`) and `OR` (`union`) filters when combined with `where`.
|
||||
|
||||
Example:
|
||||
|
||||
```go
|
||||
{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
|
||||
{{ $pages := $pages | union (where .Site.RegularPages "Params.pinned" true) }}
|
||||
{{ $pages := $pages | intersect (where .Site.RegularPages "Params.images" "!=" nil) }}
|
||||
```
|
||||
|
||||
The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page params.
|
||||
|
||||
This release represents **36 contributions by 12 contributors** to the main Hugo code base. [@bep](https://github.com/bep) still leads the Hugo development with his witty Norwegian humor, and once again contributed a significant amount of additions. But also a big shoutout to [@yihui](https://github.com/yihui), [@anthonyfok](https://github.com/anthonyfok), and [@kropp](https://github.com/kropp) for their ongoing contributions. And as always a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the documentation and the themes site in pristine condition.
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 18209+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 455+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 168+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Enhancements
|
||||
|
||||
### Templates
|
||||
|
||||
* Add `Pages` support to `intersect` (`AND`) and `union`(`ÒR`). This makes the `where` template func even more powerful. [ccdd08d5](https://github.com/gohugoio/hugo/commit/ccdd08d57ab64441e93d6861ae126b5faacdb92f) [@bep](https://github.com/bep) [#3174](https://github.com/gohugoio/hugo/issues/3174)
|
||||
* Add `math.Log` function. This is very handy for creating tag clouds. [34c56677](https://github.com/gohugoio/hugo/commit/34c566773a1364077e1397daece85b22948dc721) [@artem-sidorenko](https://github.com/artem-sidorenko)
|
||||
* Add `WebP` images support [8431c8d3](https://github.com/gohugoio/hugo/commit/8431c8d39d878c18c6b5463d9091a953608df10b) [@bep](https://github.com/bep) [#3529](https://github.com/gohugoio/hugo/issues/3529)
|
||||
* Only show post's own keywords in schema.org [da72805a](https://github.com/gohugoio/hugo/commit/da72805a4304a57362e8e79a01cc145767b027c5) [@brunoamaral](https://github.com/brunoamaral) [#2635](https://github.com/gohugoio/hugo/issues/2635)[#2646](https://github.com/gohugoio/hugo/issues/2646)
|
||||
* Simplify the `Disqus` template a little bit (#3655) [eccb0647](https://github.com/gohugoio/hugo/commit/eccb0647821e9db20ba9800da1b4861807cc5205) [@yihui](https://github.com/yihui)
|
||||
* Improve the built-in Disqus template (#3639) [2e1e4934](https://github.com/gohugoio/hugo/commit/2e1e4934b60ce8081a7f3a79191ed204f3098481) [@yihui](https://github.com/yihui)
|
||||
|
||||
### Output
|
||||
|
||||
* Support templates per site/language. This is for both regular templates and shortcode templates. [aa6b1b9b](https://github.com/gohugoio/hugo/commit/aa6b1b9be7c9d7322333893b642aaf8c7a5f2c2e) [@bep](https://github.com/bep) [#3360](https://github.com/gohugoio/hugo/issues/3360)
|
||||
|
||||
### Core
|
||||
|
||||
* Extend the sections API [a1d260b4](https://github.com/gohugoio/hugo/commit/a1d260b41a6673adef679ec4e262c5f390432cf5) [@bep](https://github.com/bep) [#3591](https://github.com/gohugoio/hugo/issues/3591)
|
||||
* Make `.Site.Sections` return the top level sections [dd9b1baa](https://github.com/gohugoio/hugo/commit/dd9b1baab0cb860a3eb32fd9043bac18cab3f9f0) [@bep](https://github.com/bep) [#3591](https://github.com/gohugoio/hugo/issues/3591)
|
||||
* Render `404.html` for all languages [41805dca](https://github.com/gohugoio/hugo/commit/41805dca9e40e9b0952e04d06074e6fc91140495) [@mitchchn](https://github.com/mitchchn) [#3598](https://github.com/gohugoio/hugo/issues/3598)
|
||||
|
||||
### Other
|
||||
|
||||
* Support human-readable `YAML` boolean values in `undraft` [1039356e](https://github.com/gohugoio/hugo/commit/1039356edf747f044c989a5bc0e85d792341ed5d) [@kropp](https://github.com/kropp)
|
||||
* `hugo import jekyll` support nested `_posts` directories [7ee1f25e](https://github.com/gohugoio/hugo/commit/7ee1f25e9ef3be8f99c171e8e7982f4f82c13e16) [@coderzh](https://github.com/coderzh) [#1890](https://github.com/gohugoio/hugo/issues/1890)[#1911](https://github.com/gohugoio/hugo/issues/1911)
|
||||
* Update `Dockerfile` and add Docker optimizations [118f8f7c](https://github.com/gohugoio/hugo/commit/118f8f7cf22d756d8a894ff93551974a806f2155) [@ellerbrock](https://github.com/ellerbrock)
|
||||
* Add Blackfriday `joinLines` extension support (#3574) [a5440496](https://github.com/gohugoio/hugo/commit/a54404968a4b36579797f2e7ff7f5eada94866d9) [@choueric](https://github.com/choueric)
|
||||
* add `--initial-header-level=2` to rst2html (#3528) [bfce30d8](https://github.com/gohugoio/hugo/commit/bfce30d85972c27c27e8a2caac9db6315f813298) [@frankbraun](https://github.com/frankbraun)
|
||||
* Support open "current content page" in browser [c825a731](https://github.com/gohugoio/hugo/commit/c825a7312131b4afa67ee90d593640dee3525d98) [@bep](https://github.com/bep) [#3643](https://github.com/gohugoio/hugo/issues/3643)
|
||||
* Make `--navigateToChanged` more robust on Windows [30e14cc3](https://github.com/gohugoio/hugo/commit/30e14cc31678ddc204b082ab362f86b6b8063881) [@anthonyfok](https://github.com/anthonyfok) [#3645](https://github.com/gohugoio/hugo/issues/3645)
|
||||
* Remove the docs submodule [31393f60](https://github.com/gohugoio/hugo/commit/31393f6024416ea1b2e61d1080dfd7104df36eda) [@bep](https://github.com/bep) [#3647](https://github.com/gohugoio/hugo/issues/3647)
|
||||
* Use `example.com` as homepage for new theme [aff1ac32](https://github.com/gohugoio/hugo/commit/aff1ac3235b6c075d01f7237addf44fecdd36d82) [@anthonyfok](https://github.com/anthonyfok)
|
||||
|
||||
## Fixes
|
||||
|
||||
### Templates
|
||||
|
||||
* Fix `in` function for JSON arrays [d12cf5a2](https://github.com/gohugoio/hugo/commit/d12cf5a25df00fa16c59f0b2ae282187a398214c) [@bep](https://github.com/bep) [#1468](https://github.com/gohugoio/hugo/issues/1468)
|
||||
|
||||
### Other
|
||||
|
||||
* Fix handling of `JSON` front matter with escaped quotes [e10e51a0](https://github.com/gohugoio/hugo/commit/e10e51a00827b9fdc1bee51439fef05afc529831) [@bep](https://github.com/bep) [#3661](https://github.com/gohugoio/hugo/issues/3661)
|
||||
* Fix typo in code comment [56d82aa0](https://github.com/gohugoio/hugo/commit/56d82aa025f4d2edb1dc6315132cd7ab52df649a) [@dvic](https://github.com/dvic)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
---
|
||||
date: 2017-07-10
|
||||
title: 0.25.1
|
||||
---
|
||||
|
||||
|
||||
|
||||
This is a bug-fix release with a couple of important fixes.
|
||||
|
||||
|
||||
Hugo now has:
|
||||
|
||||
* 18277+ [stars](https://github.com/gohugoio/hugo/stargazers)
|
||||
* 456+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
|
||||
* 170+ [themes](http://themes.gohugo.io/)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fix union when the first slice is empty [dbbc5c48](https://github.com/gohugoio/hugo/commit/dbbc5c4810a04ac06fad7500d88cf5c3bfe0c7fd) [@bep](https://github.com/bep) [#3686](https://github.com/gohugoio/hugo/issues/3686)
|
||||
* Navigate to changed on CREATE When working with content from IntelliJ IDE, like WebStorm, every file save is followed by two events: "RENAME" and then "CREATE". [7bcc1ce6](https://github.com/gohugoio/hugo/commit/7bcc1ce659710f2220b400ce3b76e50d2e48b241) [@miltador](https://github.com/miltador)
|
||||
* Final (!) fix for issue with escaped JSON front matter [7f82b41a](https://github.com/gohugoio/hugo/commit/7f82b41a24af0fd04d28fbfebf9254766a3c6e6f) [@bep](https://github.com/bep) [#3682](https://github.com/gohugoio/hugo/issues/3682)
|
||||
* Fix issue with escaped JSON front matter [84db6c74](https://github.com/gohugoio/hugo/commit/84db6c74a084d2b52117b999d4ec343cd3389a68) [@bep](https://github.com/bep) [#3682](https://github.com/gohugoio/hugo/issues/3682)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ Hugo `0.20.1` is a bug fix release, fixing some important regressions introduced
|
||||
* Live-reload fails with `_index.md` with paginator {{< gh 3315 >}}
|
||||
* `rssURI` WARNING always shown {{< gh 3319 >}}
|
||||
|
||||
See the [full list](https://github.com/spf13/hugo/milestone/16?closed=1).
|
||||
See the [full list](https://github.com/gohugoio/hugo/milestone/16?closed=1).
|
||||
|
||||
# **0.20** April 10th 2017
|
||||
|
||||
@@ -143,7 +143,7 @@ Furthermore, Hugo has its own Twitter account ([@gohugoio](https://twitter.com/g
|
||||
## Highlights
|
||||
Hugo `0.19` brings native Emacs Org-mode content support ({{<gh 1483>}}), big thanks to {{< gh "@chaseadamsio" >}}.
|
||||
|
||||
Also, a considerably amount of work have been put into cleaning up the Hugo source code, in an issue titled [Refactor the globals out of site build](https://github.com/spf13/hugo/issues/2701). This is not immediately visible to the Hugo end user, but will speed up future development.
|
||||
Also, a considerably amount of work have been put into cleaning up the Hugo source code, in an issue titled [Refactor the globals out of site build](https://github.com/gohugoio/hugo/issues/2701). This is not immediately visible to the Hugo end user, but will speed up future development.
|
||||
|
||||
Hugo `0.18` was bringing full-parallel page rendering, so workarounds depending on rendering order did not work anymore, and pages with duplicate target paths (common examples would be `/index.md` or `/about/index.md`) would now conflict with the home page or the section listing.
|
||||
|
||||
@@ -629,8 +629,8 @@ Huge thanks to all who participated in this release. A special thanks to
|
||||
|
||||
Using the Hugo v0.15 32-bit Windows or ARM binary, running `hugo server` would crash or hang due to a [memory alignment issue](https://golang.org/pkg/sync/atomic/#pkg-note-BUG) in [Afero](https://github.com/spf13/afero). The bug was discovered shortly after the v0.15.0 release and has since been [fixed](https://github.com/spf13/afero/pull/23) by {{< gh "@tpng" >}}. If you encounter this bug, you may either compile Hugo v0.16-DEV from source, or use the following solution/workaround:
|
||||
|
||||
* **64-bit Windows users: Please use [hugo_0.15_windows_amd64.zip](https://github.com/spf13/hugo/releases/download/v0.15/hugo_0.15_windows_amd64.zip)** (amd64 == x86-64). It is only the 32-bit hugo_0.15_windows_386.zip that crashes/hangs (see {{< gh 1621 >}} and {{< gh 1628 >}}).
|
||||
* **32-bit Windows and ARM users: Please run `hugo server --renderToDisk` as a workaround** until Hugo v0.16 is released (see [“hugo server” returns runtime error on armhf](https://discuss.gohugo.io/t/hugo-server-returns-runtime-error-on-armhf/2293) and {{< gh 1716 >}}).
|
||||
* **64-bit Windows users: Please use [hugo_0.15_windows_amd64.zip](https://github.com/gohugoio/hugo/releases/download/v0.15/hugo_0.15_windows_amd64.zip)** (amd64 == x86-64). It is only the 32-bit hugo_0.15_windows_386.zip that crashes/hangs (see {{< gh 1621 >}} and {{< gh 1628 >}}).
|
||||
* **32-bit Windows and ARM users: Please run `hugo server --renderToDisk` as a workaround** until Hugo v0.16 is released (see [“hugo server” returns runtime error on armhf](https://discourse.gohugo.io/t/hugo-server-returns-runtime-error-on-armhf/2293) and {{< gh 1716 >}}).
|
||||
|
||||
----
|
||||
|
||||
@@ -667,14 +667,14 @@ and {{< gh "@tatsushid" >}} for his continuous improvements
|
||||
to the templates. Also a big thanks to all the theme creators. 11 new themes
|
||||
have been added since last release and the [hugoThemes repo now has previews of
|
||||
all of
|
||||
them](https://github.com/spf13/hugoThemes/blob/master/README.md#theme-list).
|
||||
them](https://github.com/gohugoio/hugoThemes/blob/master/README.md#theme-list).
|
||||
|
||||
Hugo also depends on a lot of other great projects. A big thanks to all of our dependencies including:
|
||||
[cobra](https://github.com/spf13/cobra),
|
||||
[viper](https://github.com/spf13/viper),
|
||||
[blackfriday](https://github.com/russross/blackfriday),
|
||||
[pflag](https://github.com/spf13/pflag),
|
||||
[HugoThemes](https://github.com/spf13/hugothemes),
|
||||
[HugoThemes](https://github.com/gohugoio/hugothemes),
|
||||
[BurntSushi](https://github.com/BurntSushi/toml),
|
||||
[goYaml](https://github.com/go-yaml/yaml/tree/v2), and the Go standard library.
|
||||
|
||||
@@ -813,7 +813,7 @@ maintainers and their tremendous contributions this release.
|
||||
* Enabled soft LiveReload of CSS and images ({{< gh 490 >}})
|
||||
* Various fixes in RSS feed generation ({{< gh 789 >}})
|
||||
* `HasMenuCurrent` and `IsMenuCurrent` is now supported on Nodes
|
||||
* A bunch of [bug fixes](https://github.com/spf13/hugo/commits/master)
|
||||
* A bunch of [bug fixes](https://github.com/gohugoio/hugo/commits/master)
|
||||
|
||||
----
|
||||
|
||||
@@ -825,7 +825,7 @@ templates.
|
||||
|
||||
This release represents over 90 code commits from 28 different contributors.
|
||||
|
||||
* 10 [new themes](https://github.com/spf13/hugoThemes) created by the community
|
||||
* 10 [new themes](https://github.com/gohugoio/hugoThemes) created by the community
|
||||
* Fully themable [Partials](/templates/partials/)
|
||||
* [404 template](/templates/404/) support in themes
|
||||
* [Shortcode](/extras/shortcodes/) support in themes
|
||||
@@ -850,7 +850,7 @@ This release represents over 110 code commits from 29 different contributors.
|
||||
|
||||
* Considerably faster... about 3 - 4x faster on average
|
||||
* [LiveReload](/extras/livereload/). Hugo will automatically reload the browser when the build is complete
|
||||
* Theme engine w/[Theme Repository](https://github.com/spf13/hugoThemes)
|
||||
* Theme engine w/[Theme Repository](https://github.com/gohugoio/hugoThemes)
|
||||
* [Menu system](/extras/menus/) with support for active page
|
||||
* [Builders](/extras/builders/) to quickly create a new site, content or theme
|
||||
* [XML sitemap](/templates/sitemap/) generation
|
||||
@@ -884,7 +884,7 @@ This release represents over 110 code commits from 29 different contributors.
|
||||
* RSS generation improved. Limited to 50 items by default, can limit further in [template](/layout/rss/)
|
||||
* Boolean params now supported in [frontmatter](/content/front-matter/)
|
||||
* Launched website [showcase](/showcase/). Show off your own hugo site!
|
||||
* A bunch of [bug fixes](https://github.com/spf13/hugo/commits/master)
|
||||
* A bunch of [bug fixes](https://github.com/gohugoio/hugo/commits/master)
|
||||
|
||||
----
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
lastmod: 2017-06-30
|
||||
date: 2016-10-16T13:30:47-04:00
|
||||
date: 2016-12-20T17:21:00-05:00
|
||||
description: "Personal site"
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: https://christianmendoza.me/
|
||||
sitelink: https://www.christianmendoza.me/
|
||||
sourceLink: https://github.com/christianmendoza/christianmendoza.me
|
||||
tags:
|
||||
- personal
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
date: 2017-06-22T07:32:00Z
|
||||
description: ""
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: https://horeaporutiu.github.io/
|
||||
sourceLink: https://github.com/horeaporutiu/hugo-horeaporutiu
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
thumbnail: /img/horeaporutiu-tn.jpg
|
||||
title: horeaporutiu.github.io
|
||||
---
|
||||
@@ -5,7 +5,7 @@ description: This site
|
||||
license: Simpl
|
||||
licenseLink: ""
|
||||
sitelink: http://gohugo.io/
|
||||
sourceLink: https://github.com/spf13/hugo/tree/master/docs
|
||||
sourceLink: https://github.com/gohugoio/hugo/tree/master/docs
|
||||
tags:
|
||||
- documentation
|
||||
- bootstrap
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
date: 2017-07-01T01:11:00Z
|
||||
description: "The Invincible: The tale of a disillusioned prince"
|
||||
license: "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License"
|
||||
licenseLink: "https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode"
|
||||
sitelink: https://invincible.site/
|
||||
sourceLink: https://github.com/shazic/the_invincible
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
- graphic novel
|
||||
thumbnail: /img/invincible-tn.jpg
|
||||
title: Invincible
|
||||
---
|
||||
|
||||
@@ -13,14 +13,28 @@ title: Taxonomy Templates
|
||||
weight: 30
|
||||
---
|
||||
|
||||
There are two different templates that the use of taxonomies will require you to provide.
|
||||
Taxonomy templates should be placed in the folder `layouts/taxonomy`.
|
||||
When Taxonomy term template is provided for a Taxonomy, a section is rendered for it at `/SINGULAR/`. (eg. `/tag/` or `/category/`)
|
||||
|
||||
Both templates are covered in detail in the templates section.
|
||||
There are two different templates that the use of taxonomies will require you to provide:
|
||||
|
||||
A [list template](/templates/list/) is any template that will be used to render multiple pieces of
|
||||
content in a single html page. This template will be used to generate
|
||||
all the automatically created taxonomy pages.
|
||||
### All content attached to taxonomy
|
||||
|
||||
A [taxonomy terms template](/templates/terms/) is a template used to
|
||||
generate the list of terms for a given template.
|
||||
A [taxonomy terms template](/templates/terms/) is a template which has access to all the full Taxonomy structure.
|
||||
This Template is commonly used to generate the list of terms for a given template.
|
||||
|
||||
|
||||
#### layouts/taxonomy/SINGULAR.terms.html
|
||||
|
||||
For example: `tag.terms.html`, `category.terms.html`, or your custom Taxonomy: `actor.terms.html`
|
||||
|
||||
### All content attached to term
|
||||
|
||||
A [list template](/templates/list/) is used to automatically generate pages for each unique term found.
|
||||
|
||||
|
||||
#### layouts/taxonomy/SINGULAR.html
|
||||
|
||||
For example: `tag.html`, `category.html`, or your custom Taxonomy: `actor.html`
|
||||
|
||||
Terms are rendered at `SINGULAR/TERM/`. (eg. `/tag/book/` or `/category/news/`)
|
||||
|
||||
@@ -78,7 +78,7 @@ tags = [ "Development", "Go", "fast", "Blogging" ]
|
||||
categories = [ "Development" ]
|
||||
series = [ "Go Web Dev" ]
|
||||
slug = "hugo"
|
||||
project_url = "https://github.com/spf13/hugo"
|
||||
project_url = "https://github.com/gohugoio/hugo"
|
||||
+++
|
||||
```
|
||||
|
||||
@@ -100,7 +100,7 @@ project_url = "https://github.com/spf13/hugo"
|
||||
"Go Web Dev"
|
||||
],
|
||||
"slug": "hugo",
|
||||
"project_url": "https://github.com/spf13/hugo"
|
||||
"project_url": "https://github.com/gohugoio/hugo"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -54,5 +54,5 @@ Some examples for the layout files above:
|
||||
**Note:** An Ace template without a reference to a base section, e.g. `= content`, will be handled as a standalone template.
|
||||
|
||||
|
||||
[^ace-theme]: Note that the `html` suffix is needed, even if the filename is suffixed `ace`. This does not work from inside a theme, see [issue 763](https://github.com/spf13/hugo/issues/763).
|
||||
[^ace-theme]: Note that the `html` suffix is needed, even if the filename is suffixed `ace`. This does not work from inside a theme, see [issue 763](https://github.com/gohugoio/hugo/issues/763).
|
||||
|
||||
|
||||
@@ -432,6 +432,12 @@ favicon.ico: {{.Width}} x {{.Height}}
|
||||
<td><code>{{div 6 3}}</code> → 2</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>math.Log</code></td>
|
||||
<td>Natural logarithm of one float.</td>
|
||||
<td><code>{{math.Log 1.0}}</code> → 0</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>mod</code></td>
|
||||
<td>Modulus of two integers.</td>
|
||||
@@ -714,7 +720,7 @@ e.g.
|
||||
|
||||
* `{{ "this is a text" | truncate 10 " ..." }}` → `this is a ...`
|
||||
* `{{ "<em>Keep my HTML</em>" | safeHTML | truncate 10 }}` → `<em>Keep my …</em>`
|
||||
* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}` → `With <a href='#markdown'>Markdown …</a>`
|
||||
* `{{ "With [Markdown](#markdown) inside." | markdownify | truncate 10 }}` → `With <a href='#markdown'>Markdown …</a>`
|
||||
|
||||
### split
|
||||
|
||||
@@ -1064,10 +1070,10 @@ to convert them. Now we use an integer instead of a string:
|
||||
**Tip:** Using base64 to decode and encode becomes really powerful if we have to handle
|
||||
responses of APIs.
|
||||
|
||||
{{ $resp := getJSON "https://api.github.com/repos/spf13/hugo/readme" }}
|
||||
{{ $resp := getJSON "https://api.github.com/repos/gohugoio/hugo/readme" }}
|
||||
{{ $resp.content | base64Decode | markdownify }}
|
||||
|
||||
The response of the GitHub API contains the base64-encoded version of the [README.md](https://github.com/spf13/hugo/blob/master/README.md) in the Hugo repository. Now we can decode it and parse the Markdown. The final output will look similar to the rendered version on GitHub.
|
||||
The response of the GitHub API contains the base64-encoded version of the [README.md](https://github.com/gohugoio/hugo/blob/master/README.md) in the Hugo repository. Now we can decode it and parse the Markdown. The final output will look similar to the rendered version on GitHub.
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
<description>{{ .Summary | html }}</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
|
||||
@@ -12,8 +12,8 @@ weight: 20
|
||||
|
||||
Community-contributed [Hugo themes](http://themes.gohugo.io/), showcased
|
||||
at [themes.gohugo.io](//themes.gohugo.io/), are hosted in a centralized
|
||||
GitHub repository. The [Hugo Themes Repo](https://github.com/spf13/hugoThemes)
|
||||
itself at [github.com/spf13/hugoThemes](https://github.com/spf13/hugoThemes) is
|
||||
GitHub repository. The [Hugo Themes Repo](https://github.com/gohugoio/hugoThemes)
|
||||
itself at [github.com/gohugoio/hugoThemes](https://github.com/gohugoio/hugoThemes) is
|
||||
really a meta repository which contains pointers to set of contributed themes.
|
||||
|
||||
## Installing all themes
|
||||
@@ -26,7 +26,7 @@ on your internet connection the download of all themes might take a while.
|
||||
Otherwise you will not be able to clone the theme repositories.
|
||||
|
||||
```bash
|
||||
$ git clone --depth 1 --recursive https://github.com/spf13/hugoThemes.git themes
|
||||
$ git clone --depth 1 --recursive https://github.com/gohugoio/hugoThemes.git themes
|
||||
```
|
||||
Before you use a theme, remove the .git folder in that theme's root folder. Otherwise, this will cause problem if you deploy using Git.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ weight: 120
|
||||
|
||||
This section highlights some projects around Hugo that are independently developed. These tools try to extend the functionality of our static site generator or help you to get started.
|
||||
|
||||
> **Note:** Do you know or maintain a similar project around Hugo? Feel free to open a [pull request](https://github.com/spf13/hugo/pulls) on GitHub if you think it should be added.
|
||||
> **Note:** Do you know or maintain a similar project around Hugo? Feel free to open a [pull request](https://github.com/gohugoio/hugo/pulls) on GitHub if you think it should be added.
|
||||
|
||||
|
||||
## Migration
|
||||
|
||||
@@ -39,7 +39,7 @@ Please make sure you have the latest version rsync 3.x installed. The rsync tha
|
||||
|
||||
### References
|
||||
|
||||
* http://discuss.gohugo.io/t/categories-with-accented-characters/505
|
||||
* https://discourse.gohugo.io/t/categories-with-accented-characters/505
|
||||
* [Converting UTF-8 NFD filenames to UTF-8 NFC, in either rsync or afpd](http://serverfault.com/questions/397420/converting-utf-8-nfd-filenames-to-utf-8-nfc-in-either-rsync-or-afpd) (Server Fault)
|
||||
* http://wiki.apache.org/subversion/NonNormalizingUnicodeCompositionAwareness
|
||||
* https://en.wikipedia.org/wiki/Unicode_equivalence#Example
|
||||
|
||||
@@ -10,23 +10,23 @@ weight: 0
|
||||
|
||||
Got stuck? Worry not! Chances are other users have encountered
|
||||
the exact same problem as you have, brought it up for
|
||||
[discussion](http://discuss.gohugo.io/), and have likely found a solution
|
||||
[discussion](https://discourse.gohugo.io/), and have likely found a solution
|
||||
through the collective wisdom of our vibrant Hugo community!
|
||||
|
||||
Here are some examples:
|
||||
|
||||
* [`hugo new` aborts with cryptic EOF error](/troubleshooting/strange-eof-error/) (affects v0.12 and lower)
|
||||
* [Categories with accented characters inaccessible](/troubleshooting/categories-with-accented-characters/) (affects Mac OS X users)
|
||||
* [My CSS files aren't loaded!](http://discuss.gohugo.io/t/deployment-workflow/90/15)
|
||||
* [How do I include an image gallery on my website?](http://discuss.gohugo.io/t/image-gallery/594)
|
||||
* [My CSS files aren't loaded!](https://discourse.gohugo.io/t/deployment-workflow/90/15)
|
||||
* [How do I include an image gallery on my website?](https://discourse.gohugo.io/t/image-gallery/594)
|
||||
* ... And a lot more!
|
||||
|
||||
{{% youtube c8fJIRNChmU %}}
|
||||
|
||||
Indeed, you may find many questions and solutions
|
||||
to problems in our [discussion forum](http://discuss.gohugo.io/),
|
||||
and you may find the [support](http://discuss.gohugo.io/category/support)
|
||||
and [tips & tricks](http://discuss.gohugo.io/category/tips-tricks)
|
||||
to problems in our [discussion forum](https://discourse.gohugo.io/),
|
||||
and you may find the [support](https://discourse.gohugo.io/category/support)
|
||||
and [tips & tricks](https://discourse.gohugo.io/category/tips-tricks)
|
||||
categories particularly helpful.
|
||||
|
||||
Can't find anything? Please write on the forum and post your questions
|
||||
|
||||
@@ -27,8 +27,8 @@ weight: 5
|
||||
|
||||
Thank you for reporting this issue. The solution is to add a final newline (i.e. EOL) to the end of your default.md archetype file of your theme. More discussions happened on the forum here:
|
||||
|
||||
* http://discuss.gohugo.io/t/archetypes-not-properly-working-in-0-12/544
|
||||
* http://discuss.gohugo.io/t/eol-f-in-archetype-files/554
|
||||
* https://discourse.gohugo.io/t/archetypes-not-properly-working-in-0-12/544
|
||||
* https://discourse.gohugo.io/t/eol-f-in-archetype-files/554
|
||||
|
||||
Due to popular demand, Hugo's parser has been enhanced to
|
||||
accommodate archetype files without final EOL,
|
||||
@@ -39,5 +39,5 @@ Until then, for us running the stable v0.12 release, please remember to add the
|
||||
|
||||
## References
|
||||
|
||||
* https://github.com/spf13/hugo/issues/776
|
||||
* https://github.com/gohugoio/hugo/issues/776
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user