Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field parameter to support adding comments to front matter #3486

Closed
jeremyzilar opened this issue Mar 27, 2020 · 1 comment · Fixed by #3529
Closed

Field parameter to support adding comments to front matter #3486

jeremyzilar opened this issue Mar 27, 2020 · 1 comment · Fixed by #3529
Assignees

Comments

@jeremyzilar
Copy link
Contributor

jeremyzilar commented Mar 27, 2020

Is your feature request related to a problem? Please describe.
I oversee Digital.gov, a site provides guidance around making better digital services for people in government. All of our websites are built using static site generators (Jekyll, Hugo), and use a mix of Federalist and GitHub to publish the pages.

Currently, we get a fair number of edits to our sites directly through GitHub, mostly from people not in our org, but people from around the government. To make this process easier for those submitting changes, we've started adding comments in the front-matter of our pages that coach someone on how to edit a particular file (because the key:value pairs in frontmatter can be a bit hard to understand.

---
# View this page at https://digital.gov/resources/introduction-accessibility
# Learn how to edit our pages at https://workflow.digital.gov

# slug (url path) — changing this requires a redirect
slug: introduction-accessibility
date: 2019-12-04 8:00:00 -0500
title: "Introduction to Accessibility"
deck: ""
summary: "An introduction to accessibility, and why it matters."

# see all topics at https://digital.gov/topics
topics:
  - accessibility
  - product-management
  - plain-language

Here's the full file

We are now making a switch to use Netlify CMS, and we'd like to be able to keep the ability to define standard comments that get added into the frontmatter near each field.

Describe the solution you'd like
As an editor, I would like to provide instructional comments in the front matter to those who edit our site directly in github. This could be done by adding an optional parameter to the field you'd want a comment on. Ideally, it would also support adding in multiple lines with a \n.

Here are a few examples:

      - label: "Agency Full Name"
        name: "agency_full_name"
        widget: "string"
        hint: "e.g. U.S. General Services Administration"
        comment: "Agency Full Name [e.g. U.S. General Services Administration] \n # See the full list of agencies at URLGOESHERE"
        required: false

      - label: "Agency Acronym"
        name: "agency"
        widget: "string"
        hint: "e.g. GSA"
        comment: "# Agency Acronym [e.g., GSA]"
        required: false

When it renders, the comment would get added above the front matter field like this:

# Agency Full Name [e.g. U.S. General Services Administration]
# See the full list of agencies at URLGOESHERE
agency: "U.S. General Services Administration"

# Agency Acronym [e.g., GSA]"
agency: "GSA"

For reference — we built a simple front-end editor called Workflow to help our editors write front matter for our site. It is similar to NetlifyCMS in many ways: https://workflow.digital.gov/new/news/
We are moving from this to NetlifyCMS mostly because it has a wider community of people making it better, whereas Workflow has just me.

@jeremyzilar
Copy link
Contributor Author

Thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants