summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (mars.fritz.box) <paul@buetow.org>2013-12-29 15:14:49 +0100
committerPaul Buetow (mars.fritz.box) <paul@buetow.org>2013-12-29 15:14:49 +0100
commit90ce40e61fcd54b6ec67467de17fd04224139066 (patch)
tree470b7536a46ab49ceca5abda8d971a8499658347
parent7422d3fc0029196b3b34f594a7a26f1277176caf (diff)
Q: How many Harvard MBA's does it take to screw in a light bulb?
A: Just one. He grasps it firmly and the universe revolves around him.
-rw-r--r--docs/photoalbum.128
-rw-r--r--docs/photoalbum.pod6
-rw-r--r--docs/photoalbum.txt24
-rwxr-xr-xsrc/photoalbum49
-rw-r--r--src/photoalbum.default.conf4
5 files changed, 72 insertions, 39 deletions
diff --git a/docs/photoalbum.1 b/docs/photoalbum.1
index 1b0c4a4..fc67143 100644
--- a/docs/photoalbum.1
+++ b/docs/photoalbum.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "PHOTOALBUM 1"
-.TH PHOTOALBUM 1 "2013-12-27" "photoalbum 0.0.0" "User Commands"
+.TH PHOTOALBUM 1 "2013-12-29" "photoalbum 0.0.0" "User Commands"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -133,21 +133,33 @@
photoalbum \- photoalbum is a minimal bash script for linux to generate static web photo albums.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
-photoalbum [init|generate]
-.SS "\s-1QUICK\s0 \s-1START\s0 \s-1GUIDE:\s0"
-.IX Subsection "QUICK START GUIDE:"
-* See if /etc/default/photoalbum fits your needs. If not, read on.
-.PP
-* Copy /etc/default/photoalbum to ~/.photoalbumrc in order to customize it.
+photoalbum [clean|init|version|generate]
+.IP "clean" 4
+.IX Item "clean"
+Cleans up the working space
+.IP "init" 4
+.IX Item "init"
+Initializes the working space
+.IP "version" 4
+.IX Item "version"
+Prints out the version
+.IP "generate" 4
+.IX Item "generate"
+Generates the static photoalbum
+.SS "\s-1TUTORIAL\s0"
+.IX Subsection "TUTORIAL"
+* See if /etc/default/photoalbum fits your needs. If not, copy /etc/default/photoalbum to ~/.photoalbumrc in order to customize it.
.PP
* Run 'photoalbum init'
.PP
-* Copy all images wanted to ./incoming
+* Copy all images wanted to the incoming folder (see config file)
.PP
* Run 'photoalbum generate'
.PP
* Distribute the ./dist directory
.PP
+* Clean the mess up with 'photoalbum clean'
+.PP
\fI\s-1HTML\s0 \s-1TEMPLATES\s0\fR
.IX Subsection "HTML TEMPLATES"
.PP
diff --git a/docs/photoalbum.pod b/docs/photoalbum.pod
index 543fb89..a56fe3b 100644
--- a/docs/photoalbum.pod
+++ b/docs/photoalbum.pod
@@ -4,7 +4,7 @@ photoalbum - photoalbum is a minimal bash script for linux to generate static we
=head1 SYNOPSIS
-photoalbum [clean|init|version|generate]
+photoalbum [clean|init|version|generate|all]
=over
@@ -24,6 +24,10 @@ Prints out the version
Generates the static photoalbum
+=item all
+
+This just runs 'clean init generate' right after another.
+
=back
=head2 TUTORIAL
diff --git a/docs/photoalbum.txt b/docs/photoalbum.txt
index 9278ce9..a111807 100644
--- a/docs/photoalbum.txt
+++ b/docs/photoalbum.txt
@@ -3,22 +3,34 @@ NAME
static web photo albums.
SYNOPSIS
- photoalbum [init|generate]
+ photoalbum [clean|init|version|generate]
- QUICK START GUIDE:
- * See if /etc/default/photoalbum fits your needs. If not, read on.
+ clean
+ Cleans up the working space
- * Copy /etc/default/photoalbum to ~/.photoalbumrc in order to customize
- it.
+ init
+ Initializes the working space
+
+ version
+ Prints out the version
+
+ generate
+ Generates the static photoalbum
+
+ TUTORIAL
+ * See if /etc/default/photoalbum fits your needs. If not, copy
+ /etc/default/photoalbum to ~/.photoalbumrc in order to customize it.
* Run 'photoalbum init'
- * Copy all images wanted to ./incoming
+ * Copy all images wanted to the incoming folder (see config file)
* Run 'photoalbum generate'
* Distribute the ./dist directory
+ * Clean the mess up with 'photoalbum clean'
+
HTML TEMPLATES
Go to the templates directory and edit them as wished.
diff --git a/src/photoalbum b/src/photoalbum
index 47c062f..e3210ad 100755
--- a/src/photoalbum
+++ b/src/photoalbum
@@ -6,7 +6,7 @@ declare -r VERSION='0.0.0'
function usage () {
cat - <<USAGE >&2
Usage:
- $0 [clean|init|version|generate]
+ $0 [clean|init|version|generate|all]
USAGE
}
@@ -22,19 +22,19 @@ function clean () {
}
function generate () {
- if [ ! -d "${INCOMING_DIR}" ]; then
- echo "ERROR: You may run init first, no such directory: ${INCOMING_DIR}" >&2
- exit 1
- fi
- if [ ! -d "${DIST_DIR}" ]; then
- echo "ERROR: You may run init first, no such directory: ${DIST_DIR}" >&2
- exit 1
- fi
-
- scale
- find "${DIST_DIR}/html" -type f -name \*.html -delete
- makedist 1
- template index ../index
+ if [ ! -d "${INCOMING_DIR}" ]; then
+ echo "ERROR: You may run init first, no such directory: ${INCOMING_DIR}" >&2
+ exit 1
+ fi
+ if [ ! -d "${DIST_DIR}" ]; then
+ echo "ERROR: You may run init first, no such directory: ${DIST_DIR}" >&2
+ exit 1
+ fi
+
+ scale
+ find "${DIST_DIR}/html" -type f -name \*.html -delete
+ makedist 1
+ template index ../index
}
function template () {
@@ -55,7 +55,7 @@ function scale () {
destphoto="${photo}"
fi
- destphoto="${destphoto//./}"
+ destphoto="${destphoto/./}"
echo "Scaling ${photo} to ${DIST_DIR}/photos/${destphoto}"
@@ -81,29 +81,29 @@ function makedist () {
cd "${DIST_DIR}/photos" && find ./ -type f | sort | sed 's;^\./;;' |
while read photo; do
: $(( i++ ))
-
+
if [ ${i} -gt ${MAXPREVIEWS} ]; then
i=1
: $(( num++ ))
-
+
next=page-${num}
template next ${name}
template footer ${name}
-
+
prev=${name}
name=${next}
template header ${name}
template prev ${name}
fi
-
+
# Preview page
template preview ${name}
-
+
# View page
template header ${num}-${i}
template view ${num}-${i}
template footer ${num}-${i}
-
+
if [ ! -f "${DIST_DIR}/thumbs/${photo}" ]; then
echo "Creating thumb for ${photo}";
convert -geometry x${THUMBGEOMETRY} "${photo}" \
@@ -136,7 +136,7 @@ function makedist () {
redirectpage=1-1
fi
- template redirect ${next}redirect
+ template redirect ${nextredirect}
done
}
@@ -147,6 +147,11 @@ if [ -f ~/.photoalbumrc ]; then
fi
case "${ARG1}" in
+ all)
+ clean
+ init
+ generate
+ ;;
init)
init
;;
diff --git a/src/photoalbum.default.conf b/src/photoalbum.default.conf
index 6fba763..20ac490 100644
--- a/src/photoalbum.default.conf
+++ b/src/photoalbum.default.conf
@@ -12,6 +12,6 @@ DIST_DIR=$(pwd)/dist
TEMPLATE_DIR=/usr/share/photoalbum/templates
# Some debugging options
-set -e
-set -x
+#set -e
+#set -x