feat: Working on rendering a search index / json file.

This commit is contained in:
2025-04-06 00:15:04 -04:00
parent 7a6e4d17ac
commit 6457674de7
2 changed files with 68 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ struct Run {
writers: [
.itemWriter(swim(renderArticle)),
.listWriter(swim(renderArticles)),
.listWriter(renderJson, output: "../static/search.json"),
.tagWriter(swim(renderTag), tags: \.metadata.tags),
.yearWriter(swim(renderYear)),
// Atom feed for all articles, and a feed per tag
@@ -72,5 +73,18 @@ struct Run {
// All the remaining files that were not parsed to markdown, so for example images, raw html files and css,
// are copied as-is to the output folder.
.staticFiles()
// Run saga again on articles, to collect search index.
// try await Saga(input: "content", output: "deploy")
// .register(
// folder: "articles",
// metadata: ArticleMetadata.self,
// readers: [.plainReader],
// filter: \.public,
// writers: [
// .listWriter(renderJson, output: "../search.json")
// ]
// )
// .run()
}
}