Statac

Problems explained

Needs quotes

error An error stops the build: nothing is published until it is fixed.

A field that holds text is given a value YAML reads as something else, and reading it that way would change what you wrote. 3.10 is the number 3.1 to YAML, 0x10 is 16, and 1e3 is 1000. A colour such as #F2E9D3 written bare is a comment to YAML, which leaves the line with no value.

What you’ll see

error  Needs quotes: YAML reads `3.10` as 3.1
  Write it as `"3.10"` to keep it as written.
  More: https://statac.dev/e/needs-quotes/

In the terminal the message also names the file and line where there is one, and marks the exact text.

Why Statac stops

Statac takes a bare value as typed where YAML’s reading keeps every character, so title: 1984 is the text 1984. Where the reading would change the characters, keeping them would mean reading YAML differently from every other tool, and taking YAML’s reading would change your words. Quotes make it text in every reader.

How to fix it

Put the value in quotes, as the message shows.

Example

In content/post-1.md:

---
title: Version 3.10
version: 3.10
---

If version is declared as text, quote it:

---
title: Version 3.10
version: "3.10"
---

Its name

Nameneeds-quotes
In the terminalstatac explain needs-quotes
To stop showing itIt stops the build, so it can't be quietened.

Something unclear or wrong? Open an issue on GitHub.