Skip to content

Pushing changes to production

Claire Annan edited this page Feb 20, 2023 · 2 revisions

Where the content is

In this GitHub repository, find content organized by section under content/en folder, or use the GitHub search feature to find the file. All content files end in .md for Markdown.

🤓 Fun fact: Hugo also supports Emacs Org-Mode, AsciiDoc, RST and Pandoc content formats.

For this prototype, multi-language support is enabled: en and es (English and Spanish) folders. Within that directory, it’s in the structure of the information architecture. Section 1, 2, for right now.

[Screenshot directory of the folders]

Updating content from the GitHub UI

Once you've navigated to the page you want to edit, cick on the ✏️ edit pencil in top right of the document.

[screenshot]

At the top of the document between the three dashes at the top of the document, is the front matter where we see our page options, including Title. Most of the options are Boolean values, so turn them on or off typing true or false there.

Changing the document title here will show up throughout the site. Even if the page appears in different types of navigation, such as the main navigation or side navigation: the change once, change everywhere principle is applied here.

After the front matter, the actual content appears, which is all in Markdown. Read the GitHub docs for a tutorial in Markdown.

After making changes, scroll down to the bottom to the Commit changes box. Give it a meaningful commit message to show what you’ve done. Then select Create a new branch for this commit to start a pull request. This will create a new branch after you click Propose Changes.

💡 Governance tip: When naming branches, leave your username at the beginning of the branch name, but rename the end from patch-1 to a meaningful description, using dashes between words.

[screenshot]

On the next screen, it will say “Open a pull request” at the top. This should contain an issue template, prepopulating the comment section with instructions about what to include (often asking for things like what was changed and why, preview URL which you may leave blank for now, or a few other items). Clicking Create pull request will generate a preview URL. Select who to review on the right: the current team should have a standard about who to add.

[to be updated]

Reviewing pull requests

Go to the pull request page, click on the Preview URL to review and/or switch to the Files changed tab to look at the Markdown that has changed and make sure there are no mistakes or changes you would recommend. If there are, the reviewer may make the change, the reviewer may just use a GitHub comment about what the change should be, the reviewer may Slack the originator to talk about it (or otherwise discuss), or otherwise ask the originator to make the change. If no changes are necessary, you can just click Approve and add a comment to that effect: often “LGTM” for “looks good to me.”

After you have done a review, added your comment and clicked Approve, the next step would be to Merge that branch. Each team may decide differently if they want the requester or the approver to make the changes and/or do the merging which will make that change live. That should be a governance decision and done in a standard way. We recommend the reviewer do the merging and deleting of the branch.

In this repository, you can’t Merge without checks passing — this is a setting at the repo level. [to be updated]

Creating new pages

Until we implement a content management system, creating new pages manually. Using the GitHub UI, navigate to section within the content folder. click Add new to create a new markdown page. Add the following as front matter:

---
title: "New page"
breadcrumb: true
inpagenav: true
sidenav: true
categories: "Buy better"
tags: [accessibility, methods]
---

We also created a default archetype to make it easier for engineers to create new pages prepopulated with front matter. Run the following command via the command line from root: hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>

The above command invokes the archetypes > default.md template to create a new page with the basic content type, adds a title front matter variable, and sets the title value to a string of text from the file name. For example, if we have want to create a new page called My First Page under Section1, run the following command:

hugo new section1/my-first-page.md

Creating new sections

Currently, we can only create new sections from the command line using the following command from root: hugo new --kind section-bundle <SECTIONNAME>

Clone this wiki locally