summaryrefslogtreecommitdiffstats
path: root/commands/hugo.go
AgeCommit message (Collapse)Author
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
2017-10-14Only re-render the view(s) you're working onBjørn Erik Pedersen
Hugo already, in its server mode, support partial rebuilds. To put it simply: If you change `about.md`, only that content page is read and processed, then Hugo does some processing (taxonomies etc.) and the full site is rendered. This commit covers the rendering part: We now only re-render the pages you work on, i.e. the last n pages you watched in the browser (which obviously also includes the page in the example above). To be more specific: When you are running the hugo server in watch (aka. livereload) mode, and change a template or a content file, then we do a partial re-rendering of the following: * The current content page (if it is a content change) * The home page * Up to the last 10 pages you visited on the site. This should in most cases be enough, but if you navigate to something completely different, you may see stale content. Doing an edit will then refresh that page. Note that this feature is enabled by default. To turn it off, run `hugo server --disableFastRender`. Fixes #3962 See #1643
2017-10-10Add correct config file name to verbose server logMichael Henderson
Server logging uses the wrong variable when displaying the configuration file name. This update changes the log to use the `config` variable.
2017-10-07metrics: Detect partialCached candidatesBjørn Erik Pedersen
This commit adds a "cache potential" column when running `hugo --templateMetrics --templateMetricsHints`. This is only calculated when `--templateMetricsHints` is set, as these calculations has an negative effect on the other timings. This gives a value for partials only, and is a number between 0-100 that indicates if `partial` can be replaced with `partialCached`. 100 means that all execution of the same partial resulted in the same output. You should do some manual research before going "all cache".
2017-09-26metrics: Add simple template metrics featureCameron Moore
2017-09-25Use Chroma as new default syntax highlighterBjørn Erik Pedersen
If you want to use Pygments, set `pygmentsUseClassic=true` in your site config. Fixes #3888
2017-07-27Add --debug option to be improved on over timeMax Rydahl Andersen
Why: * first time using hugo I got very little info from --verbose output but I noticed there is quite a lot of useful DEBUG logging * asked for in other issues like https://github.com/gohugoio/hugo/issues/3514 This change addreses the need by: * adding a simple --debug flag which simply turns on debug level in stdout and logoutput if enabled.
2017-07-08commands: Navigate to changed on CREATEVasiliy Solovey
When working with content from IntelliJ IDE, like WebStorm, every file save is followed by two events: "RENAME" and then "CREATE".
2017-06-27Make `--navigateToChanged` more robust on WindowsAnthony Fok
This ensures the new "open 'current content page' in browser" works on Windows, especially with Emacs and Vim. Special thanks to @bep for coming up with the idea of the fix. See #3645
2017-06-26Support open "current content page" in browserBjørn Erik Pedersen
This commit adds a new `--navigateToChanged` and config setting with the same name, that, when running the Hugo server with live reload enabled, will navigate to the current content file's URL on save. This is really useful for site-wide content changes (copyedits etc.). Fixes #3643