The crash was introduced by commit 00d04774 in PR #1652
where access to NoTimes was attempted even though --noTimes
was not defined for the config, check and benchmark commands.
Special thanks to @bep for the heads-up!
See also #1624 - CLI UX: Flags shouldn't be global
This is to ensure that only the relevant command-line flags
for a certain Hugo subcommand is shown to the end user,
reducing clutter and improving user experience.
Fixes#1624 - CLI UX: Flags shouldn't be global
Cobra, the CLI commander in use in Hugo, has some long awaited improvements in the error handling department.
This enables a more centralized error handling approach.
This commit introduces that by changing all the command funcs to `RunE`:
* The core part of the error logging, usage logging and `os.Exit(-1)` is now performed in one place and that one place only.
* The usage text is now only shown on invalid arguments etc. (user errors)
Fixes#1502
Hugo command provides "noTimes" flag but it doesn't affect synced files
timestamp regardless of whether the flag is specified or not.
This fixes it by adding a flag check and overwriting configuration if it
is specified.
Fix#1583
Hugo command doesn't copy site's "static" directory files to "public"
directory if a specified theme doesn't have "static" directory because
theme's "static" directory checking always returns an error.
This fixes it by just showing a warning message about theme's "static"
directory absence and not skipping following processes.
Fix#1655
Write and rename operations are often followed by CHMOD.
There may be valid use cases for rebuilding the site on CHMOD,
but that will require more complex logic than this simple conditional.
On OS X this seems to be related to Spotlight, see:
https://github.com/go-fsnotify/fsnotify/issues/15
A workaround is to put your site(s) on the Spotlight exception list,
but that may be a little mysterious for most end users.
So, for now, we skip reload on CHMOD.
This small commit will be a 100% improvement for most OS X-users.
Fixes#1587
If flag is passed the site will be created inside non-empty folder
only if there are no existent folders or config with the same name
hugo creates.
Resolves: #1163
The lack of the directory would be worth to warn, since the directory is
created by "huge new site". But it doesn't have to fail the build.
This change fixes#759.
* add global `hasCJKLanguage` flag, if true, turn on auto-detecting CJKLanguage
* add `isCJKLanguage` frontmatter to force specify whether is CJKLanguage or not
* For .Summary: If isCJKLanguage is true, use the runes as basis for truncation, else keep as today.
* For WordCount: If isCJKLanguage is true, use the runes as basis for calculation, else keep as today.
* Unexport RuneCount
Fixes#1377
usage: hugo import jekyll jekyll_root_path target_path
Implemented:
* Create new hugo site
* Create config.yaml
* Convert all markdown contents.
* Copy all other files and folders to static
Fixes#101