Skip to content

Instantly share code, notes, and snippets.

@eliwilliamson
Created July 11, 2019 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliwilliamson/dd2a15d65dcc37a9238b8be5c7c7064b to your computer and use it in GitHub Desktop.
Save eliwilliamson/dd2a15d65dcc37a9238b8be5c7c7064b to your computer and use it in GitHub Desktop.

Prerequisites

You need to have the latest/LTS node and npm versions installed in order to use Victor Hugo.

Next step, clone this repository and run:

npm install

This will take some time and will install all packages necessary to run Victor Hugo and its tasks.

Development

While developing your website, use:

npm start

or

gulp server

Then visit http://localhost:3000/ - or a new browser windows popped-up already - to preview your new website. BrowserSync will automatically reload the CSS or refresh the whole page, when stylesheets or content changes.

Static build

To build a static version of the website inside the /dist folder, run:

npm run build

To get a preview of posts or articles not yet published, run:

npm run build-preview

See package.json or the included gulp file for all tasks.

Structure

|--site                // Everything in here will be built with hugo
|  |--content          // Pages and collections - ask if you need extra pages
|  |--data             // YAML data files with any data for use in examples
|  |--layouts          // This is where all templates go
|  |  |--partials      // This is where includes live
|  |  |--index.html    // The index page
|  |--static           // Files in here ends up in the public folder
|--src                 // Files that will pass through the asset pipeline
|  |--css              // CSS files in the root of this folder will end up in /css/...
|  |--js               // app.js will be compiled to /app.js with babel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment