starshard/peafowl
Template
1
Fork 0
mirror of https://github.com/starshardstudio/peafowl.git synced 2024-11-25 14:34:20 +00:00

Make JSON API return links to other JSON pages

This commit is contained in:
Steffo 2024-07-07 04:55:23 +02:00
parent 020e4f413a
commit b774bd52df
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -35,7 +35,7 @@ site.use(fileData({
return JSON.stringify({ return JSON.stringify({
title: data.title, title: data.title,
subtitle: data.subtitle, subtitle: data.subtitle,
lists: site.search.pages("list").map((data) => data.url) lists: site.search.pages("list").map((data) => data.url.replace(".html", ".json"))
}) })
} }
})) }))
@ -47,7 +47,7 @@ site.use(fileData({
contentizer(data) { contentizer(data) {
return JSON.stringify({ return JSON.stringify({
content: data.content, content: data.content,
items: site.search.pages("game").map((data) => data.url) items: site.search.pages("game").map((data) => data.url.replace(".html", ".json"))
}) })
} }
})) }))