summaryrefslogtreecommitdiffstats
path: root/commands/gendoc.go
AgeCommit message (Collapse)Author
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-04-06all: Handle all errorsBjørn Erik Pedersen
As reported by `errcheck`.
2017-02-04all: Refactor to nonglobal file systemsBjørn Erik Pedersen
Updates #2701 Fixes #2951
2016-03-31Add readFile template funcBjørn Erik Pedersen
This also includes a refactor of the hugofs package and its usage. The motivation for that is: The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...) Fixes #1551
2015-12-24update to use cobra's sub package docSteve Francia
2015-12-19Use MkdirAll instead of Mkdir in `hugo gen doc`Anthony Fok
Also print a feedback if the path does not exist and needs to be created.
2015-12-10Add copyright header to that source files that don’t have one.Anthony Fok
See #1646
2015-12-02Improve error handling in commandsBjørn Erik Pedersen
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
2015-12-02Enable dirname and filename completion for more flagsAnthony Fok
These flags are: * --source (-s), --cacheDir, --destination (-d) and --logFile * --completionfile and --dir.
2015-11-23Restructure the gen commandsBjørn Erik Pedersen
Fixes #1603
2015-08-09Print feedback for `hugo gendoc`Anthony Fok
2015-08-04Improve formatting of Hugo command descriptionsAnthony Fok
Trying to make them look good both in the terminal (`hugo help [command]`) and in the web browser (http://gohugo.io/commands/). :-)
2015-05-19Add gendoc commandbep
Using the new, great auto-doc in Cobra. This commit also contains a current result of that command added to a commands section in docs. Fixes #1136