shithub: hugo

Download patch

ref: 971d1baf1393c07081607bd62a87da545d9cb34e
parent: a4b9abf0b32a7425e85eecc2113d1cbdb286b9b5
author: Cameron Moore <[email protected]>
date: Tue Nov 29 17:52:52 EST 2016

commands: Add noChmod option to disable perm sync

Includes updates to docs.

Fixes #2749

--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -229,6 +229,7 @@
 	cmd.Flags().Bool("preserveTaxonomyNames", false, `Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")`)
 	cmd.Flags().BoolP("forceSyncStatic", "", false, "Copy all files when static is changed.")
 	cmd.Flags().BoolP("noTimes", "", false, "Don't sync modification time of files")
+	cmd.Flags().BoolP("noChmod", "", false, "Don't sync permission mode of files")
 	cmd.Flags().BoolVarP(&tpl.Logi18nWarnings, "i18n-warnings", "", false, "Print missing translations")
 
 	// Set bash-completion.
@@ -387,6 +388,7 @@
 		"ignoreCache",
 		"forceSyncStatic",
 		"noTimes",
+		"noChmod",
 	}
 
 	for _, key := range persFlagKeys {
@@ -518,6 +520,7 @@
 
 	syncer := fsync.NewSyncer()
 	syncer.NoTimes = viper.GetBool("noTimes")
+	syncer.NoChmod = viper.GetBool("noChmod")
 	syncer.SrcFs = staticSourceFs
 	syncer.DestFs = hugofs.Destination()
 	// Now that we are using a unionFs for the static directories
@@ -797,6 +800,7 @@
 
 						syncer := fsync.NewSyncer()
 						syncer.NoTimes = viper.GetBool("noTimes")
+						syncer.NoChmod = viper.GetBool("noChmod")
 						syncer.SrcFs = staticSourceFs
 						syncer.DestFs = hugofs.Destination()
 
--- a/docs/content/commands/hugo.md
+++ b/docs/content/commands/hugo.md
@@ -44,6 +44,7 @@
   -l, --layoutDir string        filesystem path to layout directory
       --log                     Enable Logging
       --logFile string          Log File path (if set, logging enabled automatically)
+      --noChmod                 Don't sync permission mode of files
       --noTimes                 Don't sync modification time of files
       --pluralizeListTitles     Pluralize titles in lists using inflect (default true)
       --preserveTaxonomyNames   Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")
--- a/docs/content/commands/hugo_benchmark.md
+++ b/docs/content/commands/hugo_benchmark.md
@@ -40,6 +40,7 @@
       --ignoreCache             Ignores the cache directory
   -l, --layoutDir string        filesystem path to layout directory
       --memprofile string       path/filename for the memory profile file
+      --noChmod                 Don't sync permission mode of files
       --noTimes                 Don't sync modification time of files
       --pluralizeListTitles     Pluralize titles in lists using inflect (default true)
       --preserveTaxonomyNames   Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")
--- a/docs/content/commands/hugo_server.md
+++ b/docs/content/commands/hugo_server.md
@@ -52,6 +52,7 @@
   -l, --layoutDir string        filesystem path to layout directory
       --meminterval string      interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
       --memstats string         log memory usage to this file
+      --noChmod                 Don't sync permission mode of files
       --noTimes                 Don't sync modification time of files
       --pluralizeListTitles     Pluralize titles in lists using inflect (default true)
   -p, --port int                port on which the server will listen (default 1313)
--- a/docs/content/overview/configuration.md
+++ b/docs/content/overview/configuration.md
@@ -150,6 +150,8 @@
     # "yaml", "toml", "json"
     metaDataFormat:             "toml"
     newContentEditor:           ""
+    # Don't sync permission mode of files
+    noChmod:                    false
     # Don't sync modification time of files
     noTimes:                    false
     paginate:                   10
--- a/docs/content/overview/usage.md
+++ b/docs/content/overview/usage.md
@@ -16,10 +16,12 @@
 Make sure Hugo is in your `PATH` (or provide a path to it). Test this by:
 
 {{< nohighlight >}}$ hugo help
+hugo is the main command, used to build your Hugo site.
 
-Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go.
+Hugo is a Fast and Flexible Static Site Generator
+built with love by spf13 and friends in Go.
 
-Complete documentation is available at http://gohugo.io
+Complete documentation is available at http://gohugo.io/.
 
 Usage:
   hugo [flags]
@@ -26,46 +28,57 @@
   hugo [command]
 
 Available Commands:
-  server          Hugo runs its own webserver to render the files
-  version         Print the version number of Hugo
-  config          Print the site configuration
-  check           Check content in the source directory
-  benchmark       Benchmark hugo by building a site a number of times
-  new             Create new content for your site
-  undraft         Undraft changes the content's draft status from 'True' to 'False'
-  genautocomplete Generate shell autocompletion script for Hugo
-  gendoc          Generate Markdown documentation for the Hugo CLI.
-  help            Help about any command
+  benchmark   Benchmark Hugo by building a site a number of times.
+  config      Print the site configuration
+  convert     Convert your content to different formats
+  env         Print Hugo version and environment info
+  gen         A collection of several useful generators.
+  import      Import your site from others.
+  list        Listing out various types of content
+  new         Create new content for your site
+  server      A high performance webserver
+  undraft     Undraft changes the content's draft status from 'True' to 'False'
+  version     Print the version number of Hugo
 
 Flags:
-  -b, --baseURL="": hostname (and path) to the root, e.g. http://spf13.com/
-  -D, --buildDrafts=false: include content marked as draft
-  -F, --buildFuture=false: include content with publishdate in the future
-      --cacheDir="": filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
-      --config="": config file (default is path/config.yaml|json|toml)
-  -d, --destination="": filesystem path to write files to
-      --disableRSS=false: Do not build RSS files
-      --disableSitemap=false: Do not build Sitemap file
-      --editor="": edit new content with this editor, if provided
-  -h, --help=false: help for hugo
-      --ignoreCache=false: Ignores the cache directory
-      --log=false: Enable Logging
-      --logFile="": Log File path (if set, logging enabled automatically)
-      --noTimes=false: Don't sync modification time of files
-      --pluralizeListTitles=true: Pluralize titles in lists using inflect
-  -s, --source="": filesystem path to read files relative from
-      --stepAnalysis=false: display memory and timing of different steps of the program
-  -t, --theme="": theme to use (located in /themes/THEMENAME/)
-      --uglyURLs=false: if true, use /filename.html instead of /filename/
-  -v, --verbose=false: verbose output
-      --verboseLog=false: verbose logging
-  -w, --watch=false: watch filesystem for changes and recreate as needed
+  -b, --baseURL string          hostname (and path) to the root, e.g. http://spf13.com/
+  -D, --buildDrafts             include content marked as draft
+  -E, --buildExpired            include expired content
+  -F, --buildFuture             include content with publishdate in the future
+      --cacheDir string         filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+      --canonifyURLs            if true, all relative URLs will be canonicalized using baseURL
+      --cleanDestinationDir     Remove files from destination not found in static directories
+      --config string           config file (default is path/config.yaml|json|toml)
+  -c, --contentDir string       filesystem path to content directory
+  -d, --destination string      filesystem path to write files to
+      --disable404              Do not render 404 page
+      --disableRSS              Do not build RSS files
+      --disableSitemap          Do not build Sitemap file
+      --enableGitInfo           Add Git revision, date and author info to the pages
+      --forceSyncStatic         Copy all files when static is changed.
+      --i18n-warnings           Print missing translations
+      --ignoreCache             Ignores the cache directory
+  -l, --layoutDir string        filesystem path to layout directory
+      --log                     Enable Logging
+      --logFile string          Log File path (if set, logging enabled automatically)
+      --noChmod                 Don't sync permission mode of files
+      --noTimes                 Don't sync modification time of files
+      --pluralizeListTitles     Pluralize titles in lists using inflect (default true)
+      --preserveTaxonomyNames   Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")
+      --quiet                   build in quiet mode
+      --renderToMemory          render to memory (only useful for benchmark testing)
+  -s, --source string           filesystem path to read files relative from
+      --stepAnalysis            display memory and timing of different steps of the program
+  -t, --theme string            theme to use (located in /themes/THEMENAME/)
+      --uglyURLs                if true, use /filename.html instead of /filename/
+  -v, --verbose                 verbose output
+      --verboseLog              verbose logging
+  -w, --watch                   watch filesystem for changes and recreate as needed
 
-
 Additional help topics:
- hugo convert         Convert will modify your content to different formats hugo list            Listing out various types of content
+  hugo check     Contains some verification checks
 
-Use "hugo help [command]" for more information about a command.
+Use "hugo [command] --help" for more information about a command.
 {{< /nohighlight >}}
 
 ## Common Usage Example