[Novalug] Simple web index file
Rich Kulawiec
rsk@gsp.org
Mon Feb 9 04:12:42 EST 2015
On Sun, Feb 08, 2015 at 08:07:42PM -0500, Jay Hart via Novalug wrote:
> I copied some files to a web facing directory that I want to generate an index file (I believe) so
> that viewers (i.e. people) can go to (example) www.view.co/pics and get a list of pics available.
This is actually pretty simple using basic HTML.
You'll need one of these:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Picture Gallery</title>
</head>
<body bgcolor="#ffffff">
("#ffffff" is white, adjust to your preference) and then for each photo,
you'll need one of these (salt to taste to achieve the formatting you want):
<p> Blah, 2015 <br> <img src="blah.jpg">
And then at the end:
</body>
</html>
The part in the middle is easy enough to generate by running "ls"
and piping the output through a simple sed script that inserts the HTML
markup, e.g.
ls *.jpg | sed -e 's/^/<p> Blah <br> <img src="/' -e 's/'\$'/">/'
and then of course, hand-edit "Blah" to be the description of each picture.
It's not fancy, but for basic photo galleries, this or something
like it will suffice. There are also numerous Perl/Python/etc.
scripts which will do fancier versions of this, e.g.:
http://zgal.sourceforge.net/
http://flatgallery.sourceforge.net/
http://coppermine-gallery.net/
---rsk
More information about the Novalug
mailing list