Enhancement: Editor for data files in the Hugo 'data' folder.
See original GitHub issueIs your feature request related to a problem? Please describe.
I have a site where there are data files (JSON) used to drive the content in tables. https://gohugo.io/templates/data-templates/
Describe the solution you’d like
I would like to describe the data model in the files like I do now with content types, and then have a UI to edit the information in the files with a GUI.
Describe alternatives you’ve considered
I can edit the plain text files by hand, but what’s the fun in that? Also, asking my editors to write JSON, YAML, TOML, etc. by hand is a bit much.
Additional context
Here is an example of a UI for the JSON content below.
{
"columns": [
"Rating",
"Credit Score"
],
"rows": [
{
"cells": [
"A++",
"750+"
]
},
{
"cells": [
"A+",
"710 - 749"
]
},
{
"cells": [
"A",
"680 - 709"
]
},
{
"cells": [
"B",
"650 - 679 up to 80% LTV"
]
},
{
"cells": [
"C",
"620 - 649 up to 70% LTV"
]
}
]
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:20 (12 by maintainers)
Top Results From Across the Web
Data Templates - Hugo
Hugo supports loading data from YAML, JSON, XML, and TOML files located in the data directory at the root of your Hugo project....
Read more >Data Files | Forestry.io
Click “Change Template”; Choose the Front Matter Template you want and click “Done”. Futher Reading · Hugo's Data Template Docs · Jekyll's ...
Read more >Live editing in Hugo with Bookshop | CloudCannon
Your editor can click a Visual Data Binding to open a panel, ... a specific structure within the Bookshop directory, and a schema...
Read more >Hugo - Bejamas
Hugo supports only local flat files like markdown. If you prefer to edit content through a nice user interface, take a look at...
Read more >Version 5.0 Beta 0 (October 2020) - Wowchemy
Save your data and plot settings using the Plotly JSON format and then ... Hugo Modules (or copy the new go.mod file to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Documentation for these new settings is on its way (still needs to be written before releasing v6).
frontMatter.data.types
: This only defines the object and its fields. There is no reference to any file or folder. It has two properties:id
andschema
frontMatter.data.files
: Defines how a single file needs to be handled. It can use a schema or an ID of the data type.frontMatter.data.folders
: Defines that all files from a folder need to be handled the same. It can use a schema or an ID of the data type.In your case, you better define the type via the
frontMatter.data.types
setting and reuse it in the file and folders setting.Recreated it with the new sample you gave, and the following schema can create your data structure: