NAME
Photog! - The Photography Website Generator
SYNOPSIS
photog [-q] [-v] [destination]
photog-[scale, watermark, thumbnail, preview]
DESCRIPTION
Photog! turns a directory tree of source images into a photography website with nested albums of chronologically sorted photographs. To get started, simply cd
to the source directory and call photog
with the destination directory as its argument. Example:
$ cd ~/Pictures
$ photog ~/public_html
Upon the first run, Photog! writes the website destination to the file photog.ini
inside the current directory. Subsequent runs of the photog
command require no arguments, and do nothing unless images inside the source directory tree have changed. Photog! only regenerates the parts of the website that should be updated.
OPTIONS
CONFIGURATION
Photog! reads configuration directives from a file named photog.ini
inside the source directory. Subdirectories can contain additional configuration files that override certain settings from the root configuration file. A value set in the configuration file will become the new default value for all child albums.
Config files consist of a number of variable = value
directives. Empty lines and lines starting with a #
are ignored. All the possible configuration variables are documented in the manual page of Photography::Website::Configure(3), the module that implements Photog!'s configuration system. Here is an example configuration file:
# This is an example ~/Pictures/photog.ini
title = Super Formosa Photography
watermark = /home/jj/watermark.png
template = /home/jj/frontpage-template.html
destination = /var/www/superformosa.nl
This tells Photog! the title, watermark, template, and destination to use when generating the album that corresponds to the directory ~/Pictures
. The albums that are created from the subdirectories inside ~/Pictures
will also have the same title, watermark, template and destination, because these values are inherited by all child albums (unless they are overridden by additional photog.ini
files). Again, for a complete list of all possible configuration variables consult the Photography::Website::Configure(3) manual page.
TEMPLATING
Photog! comes with a file named template.html
that uses Template::Toolkit syntax to render each album's index.html
. The default template uses Javascript to "pack" images into horizontal rows. You can supply the path to your own template with the template configuration variable.
All the configuration options automatically become template variables. An additional template variable, items, contains the sorted list of the album's children. Here is an example template (see Template::Manual::Intro for an introduction to the template syntax):
<h1>Welcome to [% title %]!</h1>
<p>These are my photo albums:</p>
[% FOREACH item in items %]
[% IF item.type == 'album' %]
<img src="[% item.src %]" title="[% item.my_custom_title %]">
[% ENDIF %]
[% ENDFOR %]
As you can see, this example references the attribute my_custom_title
of each child album. This is not an "official" configuration option, but as long as you set it yourself in the album's photog.ini
it will be available to all child albums just like the regular configuration variables.
ADDITIONAL COMMANDS
Photog! calls the commands photog-scale
, photog-watermark
, photog-thumbnail
, and photog-preview
to generate scaled, watermarked, thumbnail and preview images. These commands are simple shell scripts that have been installed to the same path as the photog
command. They call ImageMagick to do the actual image processing. You can also call these commands directly. Each command prints out a simple usage instruction when called with no arguments. If you want to change Photog!'s behavior for generating images and thumbnails, you can supply your own commands in the configuration file (see Photography::Website::Configure(3)).
SEE ALSO
Photography::Website, Photography::Website::Configure
AUTHOR
Photog! was written by Jaap Joris Vens <jj@rtts.eu>, and is used to create his personal photography website at http://www.superformosa.nl/