Adding New Content

After you install Hugo, clone the GitHub repository, and run the local server (hugo server), you are ready to create new content. First, ctrl-c to quit the docs server in your terminal window.

Add a New Page

New pages are added in Hugo using archetypes, which are Markdown (.md) templates that contain the front matter variables and default values.

Before you add a new page, change to the /content directory within the docs repository:

cd docs/content

To create a new Cumulus Linux Page, run:

hugo new cumulus-linux/

To create a new Cumulus NetQ Page, run:

hugo new cumulus-netq/

These commands create a Markdown page within the specified section (Cumulus Linux or Cumulus NetQ, respectively) in the /content directory. Specifying a subdirectory within the parent product directory enables you to put the file exactly where you think it belongs. For example:

hugo new cumulus-linux/Network-Virtualization/

New pages made with hugo new have draft: true set in the front matter by default.

Front Matter

Each page in Hugo contains a .YAML front matter header. For example:

title: 802.1X Interfaces
author: Cumulus Networks
weight: 101
product: Cumulus Linux
version: 3.7
siteSlug: cumulus-linux

Hugo uses these parameters in the generation of the site. You only need to configure the following:

  • title: Generated from the filename when you created the file with hugo new.
  • author: Feel free to put your name or GitHub username here.
  • weight: Indicates where this page is ordered within the directory; the higher the weight, the further down the page appears in the left side navigation.
  • product: Can be one of Cumulus Linux, Cumulus NetQ, Cumulus VX, Cumulus RMP or Cumulus Chassis.
  • version: The latest product version number. Use only X.Y notation.
  • siteSlug: This is useful if you intend on using the custom pageref shortcode.

Add a New Section

Hugo defines sections by its location within the /content folder, and the name of the .md file. Adding a section in Hugo is as simple as adding a new subdirectory, and creating an file within that subdirectory. This can be done using archetypes and the hugo new command.

For example, to create a new section called Test_Section in Cumulus Linux, run:

hugo new cumulus-linux/Test_Section/

This creates a new section called Test Section, at /content/cumulus-linux/Test_Section/ Setting draft=true in the front matter renders this section in the site and the side menu.

Top Level Sections and Content Type

Top-level subdirectories under /content have different behavior in this theme. These define the content type that Hugo uses to build the site. Do not add new top-level directories; please file a bug to request such changes to the site.