···33use maudit::{
44 BuildOptions,
55 assets::RouteAssets,
66- content::{ContentSources, RouteContent},
66+ content::ContentSources,
77 route::{DynamicRouteContext, FullRoute, PageContext, PageParams, RouteType},
88};
99···2626 match route.route_type() {
2727 RouteType::Static => {
2828 // Our page does not include content or assets, but we'll set those up for future use.
2929- let content = RouteContent::new(&content_sources);
3029 let mut page_assets = RouteAssets::new(&route_assets_options);
31303231 // Static and dynamic routes share the same interface for building, but static routes do not require any parameters.
···3635 // Every page has a PageContext, which contains information about the current page, as well as access to content and assets.
3736 let url = route.url(¶ms);
3837 let mut ctx = PageContext::from_static_route(
3939- &content,
3838+ &content_sources,
4039 &mut page_assets,
4140 &url,
4241 &options.base_url,
···5958 }
6059 }
6160 RouteType::Dynamic => {
6262- // The `get_pages` method returns all the possible pages for this route, along with their parameters and properties.
6363- // It is very common for dynamic pages to be based on content, for instance a blog post page that has one route per blog post.
6464- // As such, we create a mini PageContext that includes the content sources, so that the route can use them to generate its pages.
6565-6666- // Every page of a route may share a reference to the same RouteContent and RouteAssets instance, as it can help with caching.
6161+ // Every page of a dynamic route may share a reference to the same RouteAssets instance, as it can help with caching.
6762 // However, it is not stricly necessary, and you may want to instead create a new instance of RouteAssets especially if you were to parallelize the building of pages.
6868- let content = RouteContent::new(&content_sources);
6963 let mut page_assets = RouteAssets::new(&route_assets_options);
70646565+ // The `get_pages` method returns all the possible pages for this route, along with their parameters and properties.
6666+ // It is very common for dynamic pages to be based on content, for instance a blog post page that has one route per blog post.
6767+ // As such, we create essentially a mini `PageContext` through `DynamicRouteContext` that includes the content sources, so that the page can use them to generate its routes.
7168 let mut dynamic_ctx = DynamicRouteContext {
7272- content: &content,
6969+ content: &content_sources,
7370 assets: &mut page_assets,
7471 };
75727673 let routes = route.get_pages(&mut dynamic_ctx);
7777-7878- let content = RouteContent::new(&content_sources);
79748075 for page in routes {
8176 // The dynamic route includes the parameters for this specific page.
···8580 let url = route.url(params);
8681 let mut ctx = PageContext::from_dynamic_route(
8782 &page,
8888- &content,
8383+ &content_sources,
8984 &mut page_assets,
9085 &url,
9186 &options.base_url,
+9-12
website/content/docs/library.md
···1717```rs
1818use maudit::{
1919 content::ContentSources,
2020- page::{FullRoute, RouteAssets, RouteContent},
2020+ page::{FullRoute, RouteAssets},
2121 routing::{DynamicRouteContext, PageContext, PageParams, RouteType},
2222 BuildOptions,
2323};
···5151 match route.route_type() {
5252 RouteType::Static => {
5353 // Our page does not include content or assets, but we'll set those up for future use.
5454- let content = RouteContent::new(&content_sources);
5554 let mut route_assets = RouteAssets::new(&route_assets_options);
56555756 // Static and dynamic routes share the same interface for building, but static routes do not require any parameters.
···60596160 // Every page has a PageContext, which contains information about the current route, as well as access to content and assets.
6261 let url = route.url(¶ms);
6363- let mut ctx = PageContext::from_static_route(&content, &mut route_assets, &url, &options.base_url);
6262+ let mut ctx = PageContext::from_static_route(&content_sources, &mut route_assets, &url, &options.base_url);
64636564 let content = route.build(&mut ctx)?;
6665···125124// No changes before this block.
126125127126RouteType::Dynamic => {
127127+ // Every page of a dynamic route may share a reference to the same RouteAssets instance, as it can help with caching.
128128+ // However, it is not stricly necessary, and you may want to instead create a new instance of RouteAssets especially if you were to parallelize the building of pages.
129129+ let mut page_assets = RouteAssets::new(&route_assets_options);
130130+128131 // The `get_pages` method returns all the possible pages for this route, along with their parameters and properties.
129132 // It is very common for dynamic pages to be based on content, for instance a blog post page that has one route per blog post.
130133 // As such, we create essentially a mini `PageContext` through `DynamicRouteContext` that includes the content sources, so that the page can use them to generate its routes.
131131-132132- // Every page of a route may share a reference to the same RouteContent and RouteAssets instance, as it can help with caching.
133133- // However, it is not stricly necessary, and you may want to instead create a new instance of RouteAssets especially if you were to parallelize the building of pages.
134134- let mut page_assets = RouteAssets::new(&route_assets_options);
135135- let content = RouteContent::new(&content_sources);
136136-137137- let dynamic_ctx = DynamicRouteContext {
138138- content: &content,
134134+ let mut dynamic_ctx = DynamicRouteContext {
135135+ content: &content_sources,
139136 assets: &mut page_assets,
140137 };
141138···149146 let url = route.url(params);
150147 let mut ctx = PageContext::from_dynamic_route(
151148 &dynamic_route,
152152- &content,
149149+ &content_sources,
153150 &mut page_assets,
154151 &url,
155152 &options.base_url