Open jeremyzilar opened 4 years ago
I think quotes: true is a briljant idea.
Decisions, not Options
Every time you give a user an option, you are asking them to make a decision. When a user doesn’t care or understand the option this ultimately leads to frustration. As developers we sometimes feel that providing options for everything is a good thing, you can never have too many choices, right? Ultimately these choices end up being technical ones, choices that the average end user has no interest in. It’s our duty as developers to make smart design decisions and avoid putting the weight of technical choices on our end users.
Yes, +1 for quotes: true option.. Currently having an issue with a jekyll static site, where the liquid template interprets a field written as 12:12 as hours:minutes and mis-processes it. Of course it is not a netlify-cms issue, it is a Jekyll front-matter issue, implicitly interpreting a field without giving handles to modify that behaviour, but I imagine similar situations can appear in other YAML processes, and the quoting options seems a super-useful addition for helping with that.
I'm having the same issue with Astro an YAML processes with time fields :/
+1 for quotes: true option.
Since this seems to be a popular demand, I'm reopening the issue. Contributions welcome
same issue with Astro when since:
publishDate: 2023-09-08T15:55:00.972Z
publishDate: "2023-09-08T15:55:00.972Z"
same issue with Astro when since:
- Decap CMS writes them like this:
publishDate: 2023-09-08T15:55:00.972Z
- but Astro expects them like this:
publishDate: "2023-09-08T15:55:00.972Z"
same issue with Next.js.
I also want to wrap Image fields in quote strings because they are saved as URIs for the Next.js build step to find them.
I have attempted several workarounds, none of which have worked:
format
parameter to explicitly specify IS08601 date stringsgit-gateway
with 'github' in the backend settings inside DecapCMS' config.yml
(this creates another issue entirely)Really wish there was a quotes: true
for ALL DecapCMS fields
Slightly related to https://github.com/netlify/netlify-cms/issues/3486
Is your feature request related to a problem? Please describe.
Background: 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, most of the edits to our sites are made directly in the GitHub website from people not in our org, but people from around the government.
To make the process of editing fields easier, we are specifying that certain fields always have double quotes wrapped around them, regardless if there is a need for them or not.
For example, in the YML spec, the title field in the example below would not require it to be wrapped in quotes (
title: "Introduction to Accessibility"
), but because we have many editors and content designers going in to update the text fields, having double quotes around certain fields helps to ensure that the text they add will not break the build. This can be adding a colon, apostrophe, markdown formatting, etc... (title: "NEW: Introduction to Accessibility"
). We have found that asking editors to remember to add quotes around an item if it has special chars is not something we coach them on in the workflow.Here is an example of data fields and text fields 👀
Here's the full file
Describe the solution you'd like We are now making a switch to use Netlify CMS, and we'd like to be able to keep the ability to specify if a field should be automatically wrapped in double-quotes. This could be done by adding an optional parameter to the field you'd want wrapped in quotes (e.g.
quotes: true
)Example:
When it renders, the field would get wrapped in quotes automatically. Ideally, the field in Netlify CMS would also look for the insertion of double quotes in the field and escape them.
Thank you for considering this 🌈✨