tweaks
Some checks failed
Rust / build (push) Has been cancelled

This commit is contained in:
Nick Pegg 2025-05-10 08:43:33 -07:00
parent 4ebaee95cc
commit aa57c0d092

View file

@ -4,7 +4,7 @@ mod image;
use crate::config::Config; use crate::config::Config;
use crate::generate::image::Image; use crate::generate::image::Image;
use album_dir::AlbumDir; use album_dir::AlbumDir;
use anyhow::{anyhow, Context}; use anyhow::{Context, anyhow};
use indicatif::ProgressBar; use indicatif::ProgressBar;
use rayon::prelude::*; use rayon::prelude::*;
use serde::Serialize; use serde::Serialize;
@ -142,7 +142,7 @@ fn generate_html(config: &Config, album: &AlbumDir) -> anyhow::Result<()> {
.path .path
.join("_templates/*.html") .join("_templates/*.html")
.to_str() .to_str()
.ok_or(anyhow!("Missing _templates dir in album dir"))?, .ok_or(anyhow!("Album path {} is invalid", album.path.display()))?,
)?; )?;
println!("Generating HTML..."); println!("Generating HTML...");
@ -254,10 +254,9 @@ impl TryFrom<&AlbumDir> for AlbumContext {
log::debug!("Crumbs for {}: {breadcrumbs:?}", album.path.display()); log::debug!("Crumbs for {}: {breadcrumbs:?}", album.path.display());
// The first breadcrumb path is the relative path to the root album // The first breadcrumb path is the relative path to the root album
let root_path = if !breadcrumbs.is_empty() { let root_path = match breadcrumbs.is_empty() {
breadcrumbs[0].path.clone() false => breadcrumbs[0].path.clone(),
} else { true => PathBuf::new(),
PathBuf::new()
}; };
// Make the path to the thumbnail relative to the album that we're in // Make the path to the thumbnail relative to the album that we're in