summaryrefslogtreecommitdiffhomepage
path: root/commands/hugo.go
AgeCommit message (Collapse)Author
2018-04-15commands: Remove accidental and breaking space in baseURL flagBjørn Erik Pedersen
And added key-trimming to prevent future mishaps. See #4607
2018-04-14commands: Properly handle CLI slice argumentsBjørn Erik Pedersen
Like `--disableKinds` -- this handling was kind of broken when we recently moved this from global vars See #4607
2018-04-14commands: Correctly handle destination and i18n-warningsBjørn Erik Pedersen
And add some more CLI tests. See #4607
2018-04-13commands: Fix handling of persistent CLI flagsBjørn Erik Pedersen
See #4607
2018-04-11commands: Make commands.Execute return a Response objectBjørn Erik Pedersen
We have no global `Hugo` object no more (yay!), and there are some external tools that depends on that value. These tools need to use get that value from `Response.Result`. Note that `commands.Execute` now also takes the arguments as a string slice. This should also make it easier to use, not having to modify `os.Args`. This commit also wraps up this particular issue. Phew! Test coverage in /commands before: 14.4% Now: 53.5% Still work to do, now it is at least possible. Closes #4598
2018-04-11commands: Remove some TODOsBjørn Erik Pedersen
See #4598
2018-04-11commands: Remove the Hugo globalBjørn Erik Pedersen
There are still some cleaning to do, but that felt good. See #4598
2018-04-11commands: Move the commands related logic to its own fileBjørn Erik Pedersen
See #4598
2018-04-11commands: Add CLI testsBjørn Erik Pedersen
See #4598
2018-04-11commands: Make the hugo command non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Extract some common types into its own fileBjørn Erik Pedersen
See #4598
2018-04-11commands: Make the server command non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make the gen commands non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make the list commands non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make the import commands non-globalBjørn Erik Pedersen
See #4598
2018-04-11comands: Make the config command non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make the new commands non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make convert command non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make more commands non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Make benchmark non-globalBjørn Erik Pedersen
See #4598
2018-04-11commands: Start of flag cleaningBjørn Erik Pedersen
See #4598
2018-04-07Fix handling of --contentDir etc. flagBjørn Erik Pedersen
We need to revisit the commands package re globals and tests, but this should fix the init order of flags and languages. Fixes #4589
2018-04-04commands: Handle mass content etc. edits in server modeBjørn Erik Pedersen
Fixes #4563
2018-04-02Add support for a content dir set per languageBjørn Erik Pedersen
A sample config: ```toml defaultContentLanguage = "en" defaultContentLanguageInSubdir = true [Languages] [Languages.en] weight = 10 title = "In English" languageName = "English" contentDir = "content/english" [Languages.nn] weight = 20 title = "På Norsk" languageName = "Norsk" contentDir = "content/norwegian" ``` The value of `contentDir` can be any valid path, even absolute path references. The only restriction is that the content dirs cannot overlap. The content files will be assigned a language by 1. The placement: `content/norwegian/post/my-post.md` will be read as Norwegian content. 2. The filename: `content/english/post/my-post.nn.md` will be read as Norwegian even if it lives in the English content folder. The content directories will be merged into a big virtual filesystem with one simple rule: The most specific language file will win. This means that if both `content/norwegian/post/my-post.md` and `content/english/post/my-post.nn.md` exists, they will be considered duplicates and the version inside `content/norwegian` will win. Note that translations will be automatically assigned by Hugo by the content file's relative placement, so `content/norwegian/post/my-post.md` will be a translation of `content/english/post/my-post.md`. If this does not work for you, you can connect the translations together by setting a `translationKey` in the content files' front matter. Fixes #4523 Fixes #4552 Fixes #4553
2018-03-21Allow themes to define output formats, media types and paramsBjørn Erik Pedersen
This allows a `config.toml` (or `yaml`, ´yml`, or `json`) in the theme to set: 1) `params` (but cannot override params in project. Will also get its own "namespace", i.e. `{{ .Site.Params.mytheme.my_param }}` will be the same as `{{ .Site.Params.my_param }}` providing that the main project does not define a param with that key. 2) `menu` -- but cannot redefine/add menus in the project. Must create its own menus with its own identifiers. 3) `languages` -- only `params` and `menu`. Same rules as above. 4) **new** `outputFormats` 5) **new** `mediaTypes` This should help with the "theme portability" issue and people having to copy and paste lots of setting into their projects. Fixes #4490
2018-03-20hugolib: Add ConfigSourceDescriptorBjørn Erik Pedersen
To prepare for config in themes See #4490
2018-03-20Bump some deprecationsBjørn Erik Pedersen
2018-03-18commands: Recover from error in serverBjørn Erik Pedersen
Issue introduced some days ago. Fixes #4516
2018-02-27commands: Do not print build total when --quiet is setBjørn Erik Pedersen
Fixes #4456
2018-02-21commands: Remove ERROR on missing baseURLBjørn Erik Pedersen
That logic fails in multi-host mode when no baseURL is set on top level. Fixes #4397
2018-01-30commands: Remove some now superflous Fast Render Mode codeBjørn Erik Pedersen
Updates #4339
2018-01-29command: Remove undraft commandRobert Basic
According to @bep, it is easier to undraft content by editing manually the frontmatter of said content by setting the draft flag to `false`, or removing it completely, than to rely on the undraft command which is a source of many bugs. Fixes #4353
2018-01-29commands: Mark deprecated flags in the CLI helpBjørn Erik Pedersen
See #4347
2018-01-28commands: Deprecate CLI flags canonifyURLs, pluralizeListTitles, ↵Bjørn Erik Pedersen
preserveTaxonomyNames, uglyURLs You can of course still set them in site config. Fixes #4347
2018-01-26Support pages without front matterVas Sudanagunta
* Page without front matter now treated same as a page with empty front matter. * Test cases added to cover this and repro issue #4320. * Type safety of front matter code improved. Fixes #4320
2018-01-25Remove and update deprecation statusBjørn Erik Pedersen
2018-01-15commands: And now really fix the server watch logicBjørn Erik Pedersen
See #4275
2018-01-14commands: Fix server without watchBjørn Erik Pedersen
This was broken in Hugo 0.30. Fixes #4275
2018-01-10Correct fix for --cleanDestinationDir flagAlexander Borsuk
Fixes #4246 Fixes #4248
2018-01-10Revert "Remove the --cleanDestinationDir flag", there is a better fix.Alexander Borsuk
This reverts commit 768ec5df9fa8f91610ee80a9e6194f94a7dbe117.
2018-01-10Remove the --cleanDestinationDir flagBjørn Erik Pedersen
This is no longer supported. Since Hugo 0.32 we do static sync and build in parallel. Closes #4246
2018-01-06commands: Report build time on config.toml changeBjørn Erik Pedersen
Fixes #4232 See #4224
2018-01-02commands: Fix broken hugo --renderToMemoryBjørn Erik Pedersen
The `--renderToMemory` flag stopped working on `hugo` in 0.32. Note that this is only useful for benchmark testing, as there is no easy way to actually view the result. Fixes #4212
2017-12-29commands: Make sure all language homes are always re-rendered in fast render ↵Bjørn Erik Pedersen
mode Fixes #4125
2017-12-27:sparkles: Implement Page bundling and image handlingBjørn Erik Pedersen
This commit is not the smallest in Hugo's history. Some hightlights include: * Page bundles (for complete articles, keeping images and content together etc.). * Bundled images can be processed in as many versions/sizes as you need with the three methods `Resize`, `Fill` and `Fit`. * Processed images are cached inside `resources/_gen/images` (default) in your project. * Symbolic links (both files and dirs) are now allowed anywhere inside /content * A new table based build summary * The "Total in nn ms" now reports the total including the handling of the files inside /static. So if it now reports more than you're used to, it is just **more real** and probably faster than before (see below). A site building benchmark run compared to `v0.31.1` shows that this should be slightly faster and use less memory: ```bash ▶ ./benchSite.sh "TOML,num_langs=.*,num_root_sections=5,num_pages=(500|1000),tags_per_page=5,shortcodes,render" benchmark old ns/op new ns/op delta BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 101785785 78067944 -23.30% BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 185481057 149159919 -19.58% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 103149918 85679409 -16.94% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 203515478 169208775 -16.86% benchmark old allocs new allocs delta BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 532464 391539 -26.47% BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 1056549 772702 -26.87% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 555974 406630 -26.86% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 1086545 789922 -27.30% benchmark old bytes new bytes delta BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 53243246 43598155 -18.12% BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 105811617 86087116 -18.64% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 54558852 44545097 -18.35% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 106903858 86978413 -18.64% ``` Fixes #3651 Closes #3158 Fixes #1014 Closes #2021 Fixes #1240 Updates #3757
2017-11-17Add support for multiple staticDirsBjørn Erik Pedersen
This commit adds support for multiple statDirs both on the global and language level. A simple `config.toml` example: ```bash staticDir = ["static1", "static2"] [languages] [languages.no] staticDir = ["staticDir_override", "static_no"] baseURL = "https://example.no" languageName = "Norsk" weight = 1 title = "På norsk" [languages.en] staticDir2 = "static_en" baseURL = "https://example.com" languageName = "English" weight = 2 title = "In English" ``` In the above, with no theme used: the English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win. the Norwegian site will get its static files as a union of "staticDir_override" and "static_no". This commit also concludes the Multihost support in #4027. Fixes #36 Closes #4027
2017-11-17Add multilingual multihost supportBjørn Erik Pedersen
This commit adds multihost support when more than one language is configured and `baseURL` is set per language. Updates #4027
2017-11-15Use ms precision for static change loggingBjørn Erik Pedersen
2017-10-19commands: Support Fast Render mode with sub-path in baseURLBjørn Erik Pedersen
Fixes #3981
2017-10-18Fix hugo -wBjørn Erik Pedersen
Fixes #3980