Merge file and image asset directories

This commit is contained in:
Laurenz 2023-04-18 11:33:11 +02:00
parent dd5e9723e0
commit 4613739748
7 changed files with 1 additions and 2 deletions

View file

Before

Width:  |  Height:  |  Size: 600 KiB

After

Width:  |  Height:  |  Size: 600 KiB

View file

Before

Width:  |  Height:  |  Size: 753 KiB

After

Width:  |  Height:  |  Size: 753 KiB

View file

Before

Width:  |  Height:  |  Size: 790 KiB

After

Width:  |  Height:  |  Size: 790 KiB

View file

Before

Width:  |  Height:  |  Size: 235 KiB

After

Width:  |  Height:  |  Size: 235 KiB

View file

Before

Width:  |  Height:  |  Size: 655 KiB

After

Width:  |  Height:  |  Size: 655 KiB

View file

@ -168,7 +168,7 @@ impl<'a> Handler<'a> {
}
fn handle_image(&self, link: &str) -> String {
if let Some(file) = IMAGES.get_file(link) {
if let Some(file) = FILES.get_file(link) {
self.resolver.image(&link, file.contents()).into()
} else if let Some(url) = self.resolver.link(link) {
url

View file

@ -23,7 +23,6 @@ use unscanny::Scanner;
static SRC: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/src");
static FILES: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../assets/files");
static IMAGES: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../assets/images");
static DETAILS: Lazy<yaml::Mapping> = Lazy::new(|| yaml("reference/details.yml"));
static GROUPS: Lazy<Vec<GroupData>> = Lazy::new(|| yaml("reference/groups.yml"));