···124124 return writeln!(buf, "{}", record.args());
125125 }
126126127127+ // TODO: Add different formatting for warn, error, etc.
128128+127129 writeln!(
128130 buf,
129131 "{} {} {}",
···229231 page::RouteType::Dynamic => {
230232 let routes = route.routes(&dynamic_route_context);
231233232232- info!(target: "build", "{}", route.route_raw().to_string().bold());
234234+ if routes.is_empty() {
235235+ info!(target: "build", "{} is a registered dynamic route, but it returned no routes. No pages will be generated for this route.", route.route_raw().to_string().bold());
236236+ continue;
237237+ } else {
238238+ info!(target: "build", "{}", route.route_raw().to_string().bold());
239239+ }
233240234241 for params in routes {
235242 let mut pages_assets = assets::PageAssets {
+3-3
examples/blog/src/pages/article.rs
···1010 pub article: String,
1111}
12121313-impl DynamicPage for Article {
1313+impl DynamicRoute for Article {
1414 fn routes(&self, ctx: &DynamicRouteContext) -> Vec<RouteParams> {
1515- let collection = ctx.content.get_collection::<ArticleContent>("articles");
1515+ let collection = ctx.content.get_source::<ArticleContent>("articles");
16161717 collection.into_params(|entry| ArticleParams {
1818 article: entry.id.clone(),
···2323impl Page for Article {
2424 fn render(&self, ctx: &mut RouteContext) -> RenderResult {
2525 let params = ctx.params::<ArticleParams>();
2626- let articles = ctx.content.get_collection::<ArticleContent>("articles");
2626+ let articles = ctx.content.get_source::<ArticleContent>("articles");
2727 let article = articles.get_entry(¶ms.article);
28282929 layout((article.render)()).into()