This commit is contained in:
max
2026-06-18 17:06:52 +01:00
parent fba2364f42
commit fd2d3b1d9a
3 changed files with 60 additions and 0 deletions

41
generate.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
// todo: look for images in a directory
// for each image, see if a thumbnail exists in a thumbnail subdirectory
$photos = [];
foreach (scandir('./images') as $inode) {
var_dump($inode);
$file_name = basename($inode);
if ( ! file_exists("./images/thumbnails/$file_name")) {
// todo: make thumbnail - needs imagick/gd or something
}
// maybe each photo can have a text file associated with it, for a description / alt text / etc?
// can this be stored in jpeg metadata?
// could generate a "view photo on its own" kinda HTML page with a mid-size version of the photo
$photos[] = sprintf(
'
<div class="photo">
<a href="%s">
<img src="%s" alt="%s">
</a>
</div>
',
'todo: full-size image or photo page',
'todo: thumbnail filename',
);
}
file_put_contents(
'index.html',
sprintf(
file_get_contents('template.html'),
'Whee'
)
);

4
style.css Normal file
View File

@@ -0,0 +1,4 @@
/**
* classless CSS
*/

15
template.html Normal file
View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en-gb">
<head>
<meta charset="utf-8">
<title>Photos</title>
</head>
<body>
<h1>Photos</h1>
<main>
%s
</main>
</body>
</html>