summaryrefslogtreecommitdiffstats
path: root/commands
AgeCommit message (Collapse)Author
2019-05-06deploy: Support invalidating a CloudFront CDN cacheRobert van Gent
2019-05-03Add a "deploy" commandRobert van Gent
2019-04-23commands: Init mem profile at the endBjørn Erik Pedersen
Much more useful ...
2019-04-18commands: Replace IsDraft with Draft in list commandBjørn Erik Pedersen
Fixes #5873
2019-04-07Adjust rlimit logicBjørn Erik Pedersen
Closes #5821
2019-03-26Avoid nilpointer on no File on PageBjørn Erik Pedersen
Fixes #5781
2019-03-23Make Page an interfaceBjørn Erik Pedersen
The main motivation of this commit is to add a `page.Page` interface to replace the very file-oriented `hugolib.Page` struct. This is all a preparation step for issue #5074, "pages from other data sources". But this also fixes a set of annoying limitations, especially related to custom output formats, and shortcodes. Most notable changes: * The inner content of shortcodes using the `{{%` as the outer-most delimiter will now be sent to the content renderer, e.g. Blackfriday. This means that any markdown will partake in the global ToC and footnote context etc. * The Custom Output formats are now "fully virtualized". This removes many of the current limitations. * The taxonomy list type now has a reference to the `Page` object. This improves the taxonomy template `.Title` situation and make common template constructs much simpler. See #5074 Fixes #5763 Fixes #5758 Fixes #5090 Fixes #5204 Fixes #4695 Fixes #5607 Fixes #5707 Fixes #5719 Fixes #3113 Fixes #5706 Fixes #5767 Fixes #5723 Fixes #5769 Fixes #5770 Fixes #5771 Fixes #5759 Fixes #5776 Fixes #5777 Fixes #5778
2019-03-19List future and expired dates in CSV formatDaniel Compton
It is useful to see the date that a post will be published, or the date that it has expired, to build tooling around it. This commit writes posts and their publish/expired date as CSV. Fixes #5610
2019-03-14commands: Fix doLiveReload logicBjørn Erik Pedersen
Fixes #5754
2019-02-02commands: Update debouncer versionBjørn Erik Pedersen
2019-02-01commands: Add test for --configDirBjørn Erik Pedersen
See #5662
2019-02-01Store supported config formats in a variableAnton Harniakou
2019-01-13Make hugo server -t work againAnton Harniakou
This commit solves an issue where hugo would ignore the cli -t flag and only use a theme defined in config.toml. Also allow -t flag to accept a string slice. Closes #5569 Closes #5061 Related #4868
2019-01-10Add configFile(s) back to the watch list after RENAME event tooAnthony Fok
Alleviates #5205
2019-01-08Use subtests with server_test.goAnton Harniakou
Use Golang's subtests to provide a convenient way to run specific tests. Example: go test -run=TestFixURL/Basic_production
2018-12-23Add CSV support to transform.UnmarshalBjørn Erik Pedersen
Fixes #5555
2018-12-20commands: Remove the benchmark commandBjørn Erik Pedersen
It's not particulary useful, and when we start to get bug reports about it, it is easier to remove it. Closes #5543
2018-12-20Move the emoji parsing to pageparserBjørn Erik Pedersen
This avoids double parsing the page content when `enableEmoji=true`. This commit also adds some general improvements to the parser, making it in general much faster: ```bash benchmark old ns/op new ns/op delta BenchmarkShortcodeLexer-4 90258 101730 +12.71% BenchmarkParse-4 148940 15037 -89.90% benchmark old allocs new allocs delta BenchmarkShortcodeLexer-4 456 700 +53.51% BenchmarkParse-4 28 33 +17.86% benchmark old bytes new bytes delta BenchmarkShortcodeLexer-4 69875 81014 +15.94% BenchmarkParse-4 8128 8304 +2.17% ``` Running some site benchmarks with Emoji support turned on: ```bash benchmark old ns/op new ns/op delta BenchmarkSiteBuilding/TOML,num_langs=3,num_pages=5000,tags_per_page=5,shortcodes,render-4 924556797 818115620 -11.51% benchmark old allocs new allocs delta BenchmarkSiteBuilding/TOML,num_langs=3,num_pages=5000,tags_per_page=5,shortcodes,render-4 4112613 4133787 +0.51% benchmark old bytes new bytes delta BenchmarkSiteBuilding/TOML,num_langs=3,num_pages=5000,tags_per_page=5,shortcodes,render-4 426982864 424363832 -0.61% ``` Fixes #5534
2018-12-12importer: fix jekyll import highlight optionsJean-François YUEN
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-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-11-24commands: Include drafts in convert commandBjørn Erik Pedersen
Fixes #5457
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-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-06commands: Fix spelling秦世成
2018-11-04commands: Add --minify to hugo serverBjørn Erik Pedersen
2018-11-03commands: Fix recently broken error templateBjørn Erik Pedersen
We need a test for this ...
2018-11-03Make WARN the new default log log levelBjørn Erik Pedersen
This commit also pulls down the log level for a set of WARN statements to INFO. There should be no ERRORs or WARNINGs in a regular Hugo build. That is the story about the Boy Who Cried Wolf. Since the WARN log is now more visible, this commit also improves on some of them, most notable the "layout not found", which now would look something like this: ```bash WARN 2018/11/02 09:02:18 Found no layout for "home", language "en", output format "CSS": create a template below /layouts with one of these filenames: index.en.css.css, home.en.css.css, list.en.css.css, index.css.css, home.css.css, list.css.css, index.en.css, home.en.css, list.en.css, index.css, home.css, list.css, _default/index.en.css.css, _default/home.en.css.css, _default/list.en.css.css, _default/index.css.css, _default/home.css.css, _default/list.css.css, _default/index.en.css, _default/home.en.css, _default/list.en.css, _default/index.css, _default/home.css, _default/list.css ``` Fixes #5203
2018-11-02Skip watcher event files if matched in ignoreFilesKris Budhram
2018-11-01Add file (line/col) info to ref/relref errorsBjørn Erik Pedersen
See #5371
2018-10-28common/loggers: Make sure the global logger also gets colored labelsBjørn Erik Pedersen
See #4414
2018-10-26commands: Truncate the error log on repeated config errorsBjørn Erik Pedersen
2018-10-26commands: Only show Ansi escape codes if in a terminalBjørn Erik Pedersen
2018-10-24Revert "commands: Read disableFastRender from flag even if it's not changed"Bjørn Erik Pedersen
On second thought, removing this isn't worth it. This reverts commit 78a4c2e32ef9ea8e92bb7bb3586e4c22b02eb494.
2018-10-24commands: Read disableFastRender from flag even if it's not changedBjørn Erik Pedersen
Fixes #5353
2018-10-24comamnds: Use overflow-x: auto; for browser errorsBjørn Erik Pedersen
2018-10-24common/loggers: Remove the ANSI color for the browser error versionBjørn Erik Pedersen
2018-10-23commands, hugolib: Get file context in "config parse failed" errorsBjørn Erik Pedersen
Fixes #5325
2018-10-22hugolib: Improve errors in /i18n handllingBjørn Erik Pedersen
See #5324
2018-10-22hugolib: Continue the file context/line number errors workBjørn Erik Pedersen
See #5324
2018-10-22Convert the rest to new page parser code pathsBjørn Erik Pedersen
And remove some now unused code. See #5324
2018-10-22parser/metadecoders: Consolidate the metadata decodersBjørn Erik Pedersen
See #5324
2018-10-22commands: Avoid panic in error handler on config errorsBjørn Erik Pedersen
2018-10-17Prevent stale content in Fast Render ModeBjørn Erik Pedersen
We do that by re-render visited pages that is not already in the stack. This may potentially do some double work, but that small penalty should be well worth it. Fixes #5281
2018-10-16commands: Show server error info in browserBjørn Erik Pedersen
The main item in this commit is showing of errors with a file context when running `hugo server`. This can be turned off: `hugo server --disableBrowserError` (can also be set in `config.toml`). But to get there, the error handling in Hugo needed a revision. There are some items left TODO for commits soon to follow, most notable errors in content and config files. Fixes #5284 Fixes #5290 See #5325 See #5324
2018-10-16Revert "commands: Add .gitignore "hugo new site""Bjørn Erik Pedersen
This fails on Windows, so it needs to be reconsidered. This reverts commit 92979d92889ff8991acfadd42982c2e55d01b163.
2018-10-16commands: Add .gitignore "hugo new site"Nathaniel Peiffer
2018-10-15commands: Add help text to "hugo new"Elliot Forbes
2018-09-23Add directory based archetypesBjørn Erik Pedersen
Given this content: ```bash archetypes ├── default.md └── post-bundle ├── bio.md ├── images │   └── featured.jpg └── index.md ``` ```bash hugo new --kind post-bundle post/my-post ``` Will create a new folder in `/content/post/my-post` with the same set of files as in the `post-bundle` archetypes folder. This commit also improves the archetype language detection, so, if you use template code in your content files, the `.Site` you get is for the correct language. This also means that it is now possible to translate strings defined in the `i18n` bundles, e.g. `{{ i18n "hello" }}`. Fixes #4535