Serving pages from /Users/yourname/sites/yourhugosite/public Watching for changes in /Users/yourname/sites/yourhugosite/ A common way to use Hugo while developing a site is to have Hugo run a server with the hugo server command and watch for changes: hugo server There are no additional packages to install. Content with a future publishdate valueĪll three of these can be overridden during both local development and deployment by adding the following flags to hugo and hugo server, respectively, or by changing the boolean values assigned to the fields of the same name (without -) in your configuration:.Hugo allows you to set draft, publishdate, and even expirydate in your content’s front matter. The command hugo renders your site into public/ dir and is ready to be deployed to your web server: hugo This generates your website to the public/ directory by default, although you can customize the output directory in your site configuration by changing the publishDir field. The most common usage is probably to run hugo with your current directory being the input directory. Use "hugo -help" for more information about a command. w, -watch watch filesystem for changes and recreate as needed trace file write trace to file (not useful in general) themesDir string filesystem path to themes directory t, -theme strings themes to use (located in /themes/THEMENAME/) templateMetricsHints calculate some improvement hints when combined with -templateMetrics templateMetrics display metrics about template executions s, -source string filesystem path to read files relative from renderToMemory render to memory (only useful for benchmark testing) printUnusedTemplates print warnings on unused templates. printPathWarnings print warnings on duplicate target paths etc. printMemoryUsage print memory usage to screen at intervals printI18nWarnings print missing translations poll string set this to a poll interval, e.g -poll 700ms, to use a poll based approach to watch for file system changes panicOnWarning panic on first WARNING log noTimes don't sync modification time of files noChmod don't sync permission mode of files minify minify any supported output format (HTML, XML etc.) logFile string log File path (if set, logging enabled automatically) l, -layoutDir string filesystem path to layout directory ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern gc enable to run some cleanup tasks (remove unused cache files) after the build forceSyncStatic copy all files when static is changed. e, -environment string build environment enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages disableKinds strings disable different kind of pages (home, RSS etc.) d, -destination string filesystem path to write files to c, -contentDir string filesystem path to content directory configDir string config dir (default "config") config string config file (default is path/config.yaml|json|toml) cleanDestinationDir remove files from destination not found in static directories cacheDir string filesystem path to cache directory. F, -buildFuture include content with publishdate in the future E, -buildExpired include expired content D, -buildDrafts include content marked as draft b, -baseURL string hostname (and path) to the root, e.g. List Listing out various types of content Gen A collection of several useful generators. Hugo is a Fast and Flexible Static Site Generatorīuilt with love by spf13 and friends in Go.Ĭompletion Generate the autocompletion script for the specified shellĬonvert Convert your content to different formatsĭeploy Deploy your site to a Cloud provider.Įnv Print Hugo version and environment info The output you see in your console should be similar to the following: hugo is the main command, used to build your Hugo site. You can test that Hugo has been installed correctly via the help command: hugo help Once you have installed Hugo, make sure it is in your PATH. See the Command Line Reference for a comprehensive view of Hugo’s CLI. The following is a description of the most common commands you will use while developing your Hugo project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |