parent
4ebaee95cc
commit
aa57c0d092
1 changed files with 5 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue