};
builder.generator(Some("ord".to_string()));
for (number, id) in index.get_feed_inscriptions(300)? {
builder.item(
rss::ItemBuilder::default()
.title(Some(format!("Inscription {number}")))
.link(Some(format!("/inscription/{id}")))
.guid(Some(rss::Guid {
value: format!("/inscription/{id}"),
permalink: true,
}))
.build(),
);
}
Ok(
(
[
(header::CONTENT_TYPE, "application/rss+xml"),
(
header::CONTENT_SECURITY_POLICY,
"default-src 'unsafe-inline'",
),
],
builder.build().to_string(),
)
.into_response(),
)
}
async fn static_asset(Path(path): Path<String>) -> ServerResult<Response> {
let content = StaticAssets::get(if let Some(stripped) = path.strip_prefix('/') {
stripped
} else {
&path
})
.ok_or_not_found(|| format!("asset {path}"))?;
let body = body::boxed(body::Full::from(content.data));