oclyke / blanket-rs

static generator
https://www.blanket-rs.net
MIT License
0 stars 0 forks source link

remove virtual file resource #28

Closed oclyke closed 8 months ago

oclyke commented 8 months ago

This PR removes the VirtualFile resource. The resource represented an anti-pattern where a Dependency reference was dynamically queried for content. A more appropriate technique would be to have resources explicitly depend on data that they require. For example:

builder.require(Markdown{
  header: StringResource::new("path/to/file.txt");
}

Or

let common = StringResource::new("path/to/file.txt");
builder.require(Markdown{
  path: "path1.html",
  header: &common,
}
builder.require(Markdown{
  path: "path2.html",
  header: &common,
}