Creating and Updating Pages in Hugo¶
This guide provides instructions for contributors on how to create and update pages using the Hugo framework.
Creating a New Page¶
To create a new page in the documentation:
Navigate to the content directory of the Hugo project.
Identify the appropriate section where the new page should be added.
Run the following command to generate a new Markdown file:
hugo new docs/new-page.md
Open the newly created file in a text editor and add relevant content following Hugo’s Markdown syntax.
Ensure the front matter (YAML, TOML, or JSON format) contains necessary metadata, e.g.:
--- title: "New Page Title" date: 2025-03-11 description: "A brief description of the new page." draft: false ---
Save the file and preview changes using:
hugo server --buildDrafts
Updating an Existing Page¶
To modify an existing page:
Locate the page inside the content directory.
Open the file and make necessary changes.
Save the file and verify the updates using:
hugo server
Once satisfied with the updates, commit the changes:
git add content/docs/updated-page.md git commit -m "Updated documentation" git push origin main