Creating Static Pages

By: Dave Walsh

         hugo · static pages      hugo · static pages      hugo zero to hero

Estimated reading time: 1 minute

how to create a static page that is not the index page.

Create a flow chart of the process :)

  1. Create new content page - /content/
  2. ensure you add the following variables to the front matter:
    • type: “static” (set this to anything you like but for static pages “static” just makes sense)
    • page: “static/single.html” (this will be a link to a template file the page will be rendered using)
    • title: “Your short page title” # Make it short as this is used in the automated nav as link text
    • description: “A longer title if you like” # You can use this as the actual page title in the browser and page
    • date: 2017-08-20T18:56:24+01:00 (added automatically if you use the hugo new command to create the page)
    • draft: false (This is a switch to make post/page live or not - false = live, true = not live)
  3. Create a static directory in the layouts folder
  4. Create a template file in the static folder

Part 4 of 15 in the hugo zero to hero series.

Series Start | Installing Hugo | Using Partials