add ids to people

This commit is contained in:
tree🌴 2024-02-02 05:28:04 +01:00
parent 047f81ebe4
commit 5c7f56aeb9
3 changed files with 7 additions and 1 deletions

View File

@ -81,6 +81,9 @@ $defs:
required:
- name
properties:
id:
type: string
pattern: "^[a-z0-9-]+$"
name:
type: string
caption:

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -55,7 +55,10 @@ export class Engine {
arr.push(obj);
}
if (ext === "yaml" && fn !== "index") {
const item = await readYamlFile(join(dir, dirEntry.name));
const item = Object.assign(
{ id: fn },
await readYamlFile(join(dir, dirEntry.name)),
);
if (opts.loader === "person") {
// load image
const img = images.find((i) => i.id === fn);