stapix

Yet another static page generator for photo galleries

Commit
f026aae21c05709ab539143b1ac34f6b9987da78
Parent
8b06eec966242f42785c2c9189f2541917a49549
Author
Pablo <pablo-escobar@riseup.net>
Date

Added a TODO items

Added a TODO item to render mp4 thumbnails for GIF files instead of WebP thumbnails

Added a TODO item to properly log the different steps of the rendering of the gallery

Diffstat

2 files changed, 4 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/main.rs 3 3 0
Modified src/picture.rs 1 1 0
diff --git a/src/main.rs b/src/main.rs
@@ -59,6 +59,7 @@ fn main() -> io::Result<()> {
 }
 
 /// Coordinates the rendering of all the pages and file conversions
+// TODO: Log what the fuck we're doing
 fn render_gallery(pics: Vec<Picture>) -> io::Result<()> {
     for pic in &pics {
         let mut target_path = PathBuf::from(TARGET_PATH);
@@ -115,6 +116,7 @@ fn render_index(pics: &Vec<Picture>) -> io::Result<()> {
     write_head(&mut f)?;
 
     for pic in &pics[0..10] {
+        // TODO: Preload mp4 thumbnails for GIF files
         writeln!(
             f,
             "<link rel=\"preload\" as=\"image\" href=\"/{THUMBS_PATH}/{name}.webp\">",
@@ -136,6 +138,7 @@ fn render_index(pics: &Vec<Picture>) -> io::Result<()> {
             "<a aria-label=\"{name}\" href=\"/{PAGES_PATH}/{name}.html\">",
             name = Escaped(&pic.file_name)
         )?;
+        // TODO: Link to mp4 thumbnails for GIF files
         writeln!(
             f,
             "<img alt=\"{alt}\" src=\"/{THUMBS_PATH}/{name}.webp\">",
diff --git a/src/picture.rs b/src/picture.rs
@@ -25,6 +25,7 @@ pub struct Picture {
 }
 
 impl Picture {
+    // TODO: Render GIF files as mp4 instead
     pub fn render_thumbnail(&self, target_dir: &Path) -> io::Result<()> {
         let thumb_path = target_dir.join(self.file_name.clone() + ".webp");