starshard/peafowl
Template
1
Fork 0
mirror of https://github.com/starshardstudio/peafowl.git synced 2024-11-22 04:54:19 +00:00
peafowl/_config.ts

91 lines
2.2 KiB
TypeScript
Raw Normal View History

2024-06-16 11:49:13 +00:00
import {default as lume} from "lume/mod.ts";
import {default as jsx} from "lume/plugins/jsx.ts"
import {default as feed} from "lume/plugins/feed.ts"
import fileData from "./_plugins/fileData.ts"
import Site from "lume/core/site.ts";
2024-06-16 11:49:13 +00:00
const site: Site = lume({
2024-06-16 11:49:13 +00:00
prettyUrls: false,
})
site.use(jsx({}))
site.copy("_static")
site.data("styles", ["/_static/styles/base.css"])
site.data("lang", "en")
site.data("date", "Git Last Modified")
site.data("layout", "index.tsx", "/index.md")
site.data("tags", ["index"], "/index.md")
site.data("url", "/games/index.html", "/list-games.md")
site.data("layout", "list-games.tsx", "/list-games.md")
site.data("tags", ["list", "list-games"], "/list-games.md")
site.data("layout", "game.tsx", "/games")
site.data("tags", ["review", "game"], "/games")
site.use(fileData({
query: "index",
urlizer(data) {
return data.url.replace(".html", ".json")
},
contentizer(data) {
return JSON.stringify({
title: data.title,
subtitle: data.subtitle,
lists: site.search.pages("list").map((data) => data.url.replace(".html", ".json"))
2024-06-16 11:49:13 +00:00
})
}
}))
site.use(fileData({
query: "list-games",
urlizer(_data) {
2024-06-16 11:49:13 +00:00
return "/games/index.json"
},
contentizer(data) {
return JSON.stringify({
content: data.content,
items: site.search.pages("game").map((data) => data.url.replace(".html", ".json"))
2024-06-16 11:49:13 +00:00
})
}
}))
site.use(fileData({
query: "game",
urlizer(data) {
return data.url.replace(".html", ".json")
},
contentizer(data) {
return JSON.stringify({
name: data.name ?? null,
rating: data.rating ?? null,
content: data.content ?? null,
active: data.active ?? null,
progress: data.progress ?? null,
hours_played: data.hours_played ?? null,
purchased_on: data.purchased_on ?? null,
started_on: data.started_on ?? null,
beaten_on: data.beaten_on ?? null,
completed_on: data.completed_on ?? null,
mastered_on: data.mastered_on ?? null,
identifiers: data.identifiers ?? null,
})
}
}))
site.use(feed({
output: ["/games/feed.rss", "/games/feed.json"],
query: "game",
limit: 10,
info: {
2024-10-10 00:02:15 +00:00
title: "Videogames", // TODO: Change this to your site's videogame section's name!
2024-10-10 00:20:31 +00:00
2024-06-16 11:49:13 +00:00
},
items: {
title: "=name"
}
}))
export default site;