summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-12-11Add /config dir supportBjørn Erik Pedersen
This commit adds support for a configuration directory (default `config`). The different pieces in this puzzle are: * A new `--environment` (or `-e`) flag. This can also be set with the `HUGO_ENVIRONMENT` OS environment variable. The value for `environment` defaults to `production` when running `hugo` and `development` when running `hugo server`. You can set it to any value you want (e.g. `hugo server -e "Sensible Environment"`), but as it is used to load configuration from the file system, the letter case may be important. You can get this value in your templates with `{{ hugo.Environment }}`. * A new `--configDir` flag (defaults to `config` below your project). This can also be set with `HUGO_CONFIGDIR` OS environment variable. If the `configDir` exists, the configuration files will be read and merged on top of each other from left to right; the right-most value will win on duplicates. Given the example tree below: If `environment` is `production`, the left-most `config.toml` would be the one directly below the project (this can now be omitted if you want), and then `_default/config.toml` and finally `production/config.toml`. And since these will be merged, you can just provide the environment specific configuration setting in you production config, e.g. `enableGitInfo = true`. The order within the directories will be lexical (`config.toml` and then `params.toml`). ```bash config ├── _default │   ├── config.toml │   ├── languages.toml │   ├── menus │   │   ├── menus.en.toml │   │   └── menus.zh.toml │   └── params.toml ├── development │   └── params.toml └── production ├── config.toml └── params.toml ``` Some configuration maps support the language code in the filename (e.g. `menus.en.toml`): `menus` (`menu` also works) and `params`. Also note that the only folders with "a meaning" in the above listing is the top level directories below `config`. The `menus` sub folder is just added for better organization. We use `TOML` in the example above, but Hugo also supports `JSON` and `YAML` as configuration formats. These can be mixed. Fixes #5422
2018-12-10resource/image: Fix "always false" conditionIskander (Alex) Sharipov
Found using gocritic linter.
2018-12-07tpl: Add reflect namespaceCameron Moore
Add a reflect namespace that offers a two boolean functions for testing if a value is a map or slice. Fixes #4081
2018-12-07minifiers: Fixx CSS2 color code handlingBjørn Erik Pedersen
Fixes #5506
2018-12-06tpl/hugo: Use the correct Hugo varBjørn Erik Pedersen
See #5467
2018-12-06hugolib: Add .Site.SitesBjørn Erik Pedersen
Fixes #5504
2018-12-06Add tpl/site and tpl/hugoBjørn Erik Pedersen
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc. Fixes #5470 Fixes #5467 Fixes #5503
2018-12-04cache/filecache: Simplify testBjørn Erik Pedersen
See #5497
2018-12-04cache/filecache: Use OS fs for testBjørn Erik Pedersen
See #5497
2018-11-30tpl: Add godoc packages commentsCameron Moore
Also fix package name in tpl/templates.
2018-11-29common/collections: Fix defines typoChristian Oliff
2018-11-28releaser: Prepare repository for 0.53-DEVhugoreleaser
[ci skip]
2018-11-28releaser: Add release notes to /docs for release of 0.52v0.52hugoreleaser
[ci skip]
2018-11-28releaser: Bump versions for release of 0.52hugoreleaser
[ci skip]
2018-11-28Release 0.52Bjørn Erik Pedersen
2018-11-28releaser: Add release notes draft for 0.52hugoreleaser
Rename to *-ready.md to continue. [ci skip]
2018-11-28hugolib: Fall back to title in ByLinkTitle sortBjørn Erik Pedersen
Fixes #4953
2018-11-28hugolib: Improve nil handling in IsDescendant and IsAncestorBjørn Erik Pedersen
Fixes #5461
2018-11-28parser/pageparser: Fix handling of commented out front matterBjørn Erik Pedersen
When the page parser was rewritten in 0.51, this was interpreted literally, but commented out front matter is used in the wild to "hide it from GitHub", e.g: ``` <!-- +++ title = "hello" +++ --> ``` Fixes #5478
2018-11-28Remove duplicate mapstructure depdendencyBjørn Erik Pedersen
2018-11-28Add dependency list to READMEBjørn Erik Pedersen
2018-11-27tpl/path: Add testsCameron Moore
2018-11-27tpl: Regenerate templatesBjørn Erik Pedersen
2018-11-27tpl: Fix whitespace issueMax Arnold
Introduced in #5276.
2018-11-27tpl: Add "param" shortcodeBjørn Erik Pedersen
Fixes #4010
2018-11-27docs: Document inline shortcodesBjørn Erik Pedersen
See #4011
2018-11-27Add inline shortcode supportBjørn Erik Pedersen
An inline shortcode's name must end with `.inline`, all lowercase. E.g.: ```bash {{< time.inline >}}{{ now }}{{< /time.inline >}} ``` The above will print the current date and time. Note that an inline shortcode's inner content is parsed and executed as a Go text template with the same context as a regular shortcode template. This means that the current page can be accessed via `.Page.Title` etc. This also means that there are no concept of "nested inline shortcodes". The same inline shortcode can be reused later in the same content file, with different params if needed, using the self-closing syntax: ``` {{< time.inline />}} ``` Fixes #4011
2018-11-27tpl/collections: Add float64 support to whereCameron Moore
Fixes #5466
2018-11-24parser/pageparser: Fix when only shortcode and then summaryBjørn Erik Pedersen
Fixes #5464
2018-11-24commands: Include drafts in convert commandBjørn Erik Pedersen
Fixes #5457
2018-11-23Handle themes in the new file cache (for images, assets)Bjørn Erik Pedersen
In the newly consolidated file cache implementation, we forgot that we also look in the theme(s) for assets (SCSS transformations etc.), which is not good for Netlify and the demo sites. Fixes #5460
2018-11-18Fix ignored --config flag with 'new' commandKris Budhram
2018-11-15Fix Permalink for resource, baseURL with path and canonifyURLs setBjørn Erik Pedersen
Fixes #5226
2018-11-15Add tests for permalink on Resource with baseURL with pathBjørn Erik Pedersen
See #5226
2018-11-14helpers: Add a comment about file mode for new filesBjørn Erik Pedersen
See #5434
2018-11-14cache/filecache: Add a :project placeholderBjørn Erik Pedersen
This allows for "cache per Hugo project", making `hugo --gc` work as expected, even if you have several Hugo projects running on the same PC. See #5439
2018-11-14cache/filecache: Add a cache prune funcBjørn Erik Pedersen
Fixes #5439
2018-11-14cache/filecache: Add a filecache root dirBjørn Erik Pedersen
This is just a safe guard to make sure we don't evict/remove files that do not belong to the cache.
2018-11-14cache/filecache: Use time.Duration for maxAgeBjørn Erik Pedersen
Fixes #5438
2018-11-14cache/filecache: Split implementation and config into separate filesBjørn Erik Pedersen
2018-11-14Update to LibSASS 3.5.5Bjørn Erik Pedersen
Fixes #5432 See #5435
2018-11-13More spelling correctionsBjørn Erik Pedersen
2018-11-13cache/filecache: Spelling correctionsBjørn Erik Pedersen
2018-11-13Remove appveyorBjørn Erik Pedersen
We now build on Travis for all platforms.
2018-11-13docs: Document the new file cacheBjørn Erik Pedersen
See #5404
2018-11-13Add a consolidated file cacheBjørn Erik Pedersen
This commits reworks how file caching is performed in Hugo. Now there is only one way, and it can be configured. This is the default configuration: ```toml [caches] [caches.getjson] dir = ":cacheDir" maxAge = -1 [caches.getcsv] dir = ":cacheDir" maxAge = -1 [caches.images] dir = ":resourceDir/_gen" maxAge = -1 [caches.assets] dir = ":resourceDir/_gen" maxAge = -1 ``` You can override any of these cache setting in your own `config.toml`. The placeholders explained: `:cacheDir`: This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. `:resourceDir`: This is the value of the `resourceDir` config option. `maxAge` is the time in seconds before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml Fixes #5404
2018-11-13Add Windows build config to TravisEmir Beganović
2018-11-09Revert "Add Elasticsearch/bonsai.io to services doc."Bjørn Erik Pedersen
This reverts commit c0b3a1af0354e3aa9979cc00ae8630d7f0be63dc.
2018-11-09Add Elasticsearch/bonsai.io to services doc.Allison Zadrozny
Hip hip for OSS! 🙌
2018-11-09tpl: Fix test to pass with gccgoIan Lance Taylor
When run under gccgo, the test looks for the name that gccgo gives to a thunk method. This name is not normally visible, but can be seen when using reflect.FuncForPC as this code does. That name changed in https://golang.org/cl/89555. Change the test to work with both the old name "$thunk0" and the new name "thunk0". Fixes golang/go#28669