A fork of mtelver's day10 project

gen_blog_index: update paths for monorepo layout

- Scan site/blog/ instead of blog/
- Write indexes to site/blog/ paths
- Use !/jon-site/blog/ odoc references (matching existing indexes)
- Accept both 4-part and 5-part path splits for flexibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+6 -6
+6 -6
scripts/gen_blog_index.ml
··· 40 40 (* Parse path to get year/month/slug *) 41 41 let parts = String.split_on_char '/' path in 42 42 match parts with 43 - | _ :: year_s :: month_s :: filename :: [] -> 43 + | _ :: _ :: year_s :: month_s :: filename :: [] | _ :: year_s :: month_s :: filename :: [] -> 44 44 let year = int_of_string year_s in 45 45 let month = int_of_string month_s in 46 46 let slug = Filename.remove_extension filename in ··· 61 61 | _ -> () 62 62 ) entries 63 63 in 64 - scan_dir "blog"; 64 + scan_dir "site/blog"; 65 65 (* Sort by published date descending *) 66 66 List.sort (fun a b -> String.compare b.published a.published) !posts 67 67 ··· 75 75 else 76 76 Printf.sprintf "page-%s" post.slug 77 77 in 78 - Printf.sprintf "{{!/site/blog/%04d/%02d/%s}%s}" 78 + Printf.sprintf "{{!/jon-site/blog/%04d/%02d/%s}%s}" 79 79 post.year post.month slug_fmt post.title 80 80 81 81 let generate_month_index year month posts = ··· 164 164 List.iter (fun (year, month) -> 165 165 match generate_month_index year month posts with 166 166 | Some content -> 167 - let dir = Printf.sprintf "blog/%04d/%02d" year month in 167 + let dir = Printf.sprintf "site/blog/%04d/%02d" year month in 168 168 let path = Filename.concat dir "index.mld" in 169 169 write_file path content 170 170 | None -> () ··· 181 181 List.iter (fun year -> 182 182 match generate_year_index year posts with 183 183 | Some content -> 184 - let path = Printf.sprintf "blog/%04d/index.mld" year in 184 + let path = Printf.sprintf "site/blog/%04d/index.mld" year in 185 185 write_file path content 186 186 | None -> () 187 187 ) years; 188 188 189 189 (* Generate main blog index *) 190 190 let blog_index = generate_blog_index posts in 191 - write_file "blog/index.mld" blog_index; 191 + write_file "site/blog/index.mld" blog_index; 192 192 193 193 (* Output recent entries for main index *) 194 194 Printf.printf "\n=== Recent entries (copy to index.mld) ===\n\n";