I’m using 11ty to build a multi-lingual site, currently stuck at how I could allow authors to select a Topic/Category
from a list of values in a data file.
The field code I’ve tried last:
// The topic list
const topics = {
i18n: true,
label: "Select a Topic",
name: "topics",
widget: "select",
file: "site/_data/topics.json",
multiple: false,
... ?
};
export default topics;
The topics.json
:
{
"topics": [
"Lifestyle",
"Business",
"Health",
"Food",
"Love & Relationships",
"Tech",
"Entertainment",
"Shopping",
"Home & Privacy",
"Family & Pets"
]
}
Now this list format json
, and also the widget type are not set in stone.
I can use whatever proves to be working
The end result should be, that writers have a select field in their UI where they can select 1
topic for the content piece they’re writing.
The topics list is also going to be used to display Categories on the website, and then display entries for each topic…
And I need to make it work with internationalization i18n
.
Is this doable, and if so: how? pretty please