summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-02-20 10:47:50 +0000
committerPaul Buetow <paul@buetow.org>2022-02-20 10:47:50 +0000
commit66c34c39d75d73159fe82c1d07961e0505fc8d6c (patch)
treec34f4c8d5586525aeae4b6950ebf040f0de3b21b
parent52b3acc71006dec6ab33eb1fea7897d05aef334a (diff)
refactor templates
-rw-r--r--share/templates/default/footer.tmpl13
-rw-r--r--share/templates/default/header-first-add.tmpl3
-rw-r--r--share/templates/default/header.tmpl38
-rw-r--r--share/templates/default/index-preview.tmpl6
-rw-r--r--share/templates/default/next.tmpl5
-rw-r--r--share/templates/default/prev.tmpl7
-rw-r--r--share/templates/default/redirect.tmpl2
-rw-r--r--share/templates/default/view.tmpl30
-rwxr-xr-xsrc/photoalbum.sh4
9 files changed, 50 insertions, 58 deletions
diff --git a/share/templates/default/footer.tmpl b/share/templates/default/footer.tmpl
index 18af2b5..b3ce543 100644
--- a/share/templates/default/footer.tmpl
+++ b/share/templates/default/footer.tmpl
@@ -1,16 +1,21 @@
cat <<END
-</p>
-<hr />
+</div>
+END
+
+cat <<END
+<div class="footer">
END
if [ "${TARBALL_INCLUDE}" = 'yes' ]; then
cat <<END
-Download all photos in original size <a href='${backhref}/${tarball_name}'>here</a><br /><br />
+ Download all photos in original size <a href='${backhref}/${tarball_name}'>here</a><br /><br />
END
fi
cat <<END
-Page generated at $(date) using Bash and ImageMagick at $(uname); &lt;photoalbum@dev.buetow.org&gt;
+ Page generated at $(date) using Bash and ImageMagick at $(uname); &lt;photoalbum@dev.buetow.org&gt;
+</div>
+
</body>
</html>
END
diff --git a/share/templates/default/header-first-add.tmpl b/share/templates/default/header-first-add.tmpl
deleted file mode 100644
index 436c4e9..0000000
--- a/share/templates/default/header-first-add.tmpl
+++ /dev/null
@@ -1,3 +0,0 @@
-cat <<END
-<p align='center'>
-END
diff --git a/share/templates/default/header.tmpl b/share/templates/default/header.tmpl
index b25143b..564d547 100644
--- a/share/templates/default/header.tmpl
+++ b/share/templates/default/header.tmpl
@@ -1,28 +1,26 @@
if [ "${is_subalbum}" = yes ]; then
- GOTO_OVERVIEW="<br /><br /><a href='${backhref}/index.html'>Go to Album overview</a>"
+ GOTO_OVERVIEW="<a href='${backhref}/index.html'>Go to Album overview</a>"
fi
+
cat <<END
<html>
<head>
-<title>${TITLE}</title>
-<style type="text/css">
- body {
- background-color: #000000;
- color: #FFFFFF;
- font-family: verdana, sans-serif;
- width: 100%;
- }
- a {
- color: #FFFFFF;
- }
- hr {
- color: #FFFFFF;
- background-color: #FFFFFF;
- height: 1px;
- }
-</style>
+ <title>${TITLE}</title>
+ <style type="text/css">
+ body {
+ background-color: #000000;
+ color: #FFFFFF;
+ font-family: verdana, sans-serif;
+ width: 100%;
+ }
+ a {
+ color: #FFFFFF;
+ }
+ </style>
</head>
+
<body>
-${TITLE} ${GOTO_OVERVIEW}
-<hr />
+ <h1>${TITLE}</h1>
+ <p>${GOTO_OVERVIEW}</p>
+ <div>
END
diff --git a/share/templates/default/index-preview.tmpl b/share/templates/default/index-preview.tmpl
deleted file mode 100644
index a4cc0a4..0000000
--- a/share/templates/default/index-preview.tmpl
+++ /dev/null
@@ -1,6 +0,0 @@
-cat <<END
-<h2>Album ${album} (${description})</h2>
-<a name='${album}' href='${album}/index.html'>
- <img border='0' src='${backhref}/${random_thumb}' />
-</a>
-END
diff --git a/share/templates/default/next.tmpl b/share/templates/default/next.tmpl
index e36d185..a4165dc 100644
--- a/share/templates/default/next.tmpl
+++ b/share/templates/default/next.tmpl
@@ -1,6 +1,5 @@
cat <<END
-</p>
-<div>
+<p>
<a href='${next}.html'>Next ${MAXPREVIEWS} pictures of current Album</a>
-</div>
+</p>
END
diff --git a/share/templates/default/prev.tmpl b/share/templates/default/prev.tmpl
index 528806a..98dd874 100644
--- a/share/templates/default/prev.tmpl
+++ b/share/templates/default/prev.tmpl
@@ -1,6 +1,5 @@
cat <<END
-<div>
- <a href='${prev}.html'>Previous ${MAXPREVIEWS} pictures of current Album</a>
-</div>
-<p align='center'>
+<p>
+ <a href='${prev}.html'>Previous ${MAXPREVIEWS} pictures of current Album</a>
+</p>
END
diff --git a/share/templates/default/redirect.tmpl b/share/templates/default/redirect.tmpl
index aaf95c9..21afa69 100644
--- a/share/templates/default/redirect.tmpl
+++ b/share/templates/default/redirect.tmpl
@@ -1,7 +1,7 @@
cat <<END
<html>
<head>
-<meta http-equiv='refresh' content='0; url=${redirect_page}.html'>
+ <meta http-equiv='refresh' content='0; url=${redirect_page}.html'>
</head>
<body>
</body>
diff --git a/share/templates/default/view.tmpl b/share/templates/default/view.tmpl
index 8894a76..8a64035 100644
--- a/share/templates/default/view.tmpl
+++ b/share/templates/default/view.tmpl
@@ -1,21 +1,23 @@
cat <<END
-<a href="${num}-$((i-1)).html">&lt;&lt;&lt;</a>
-<a href="page-${num}.html#$photo">Thumbnails</a>
-<a href="${num}-$((i+1)).html">&gt;&gt;&gt;</a>
-<br />
-<br />
+<p>
+ <a href="${num}-$((i-1)).html">&lt;&lt;&lt;</a>
+ <a href="page-${num}.html#$photo">Thumbnails</a>
+ <a href="${num}-$((i+1)).html">&gt;&gt;&gt;</a>
+</p>
+
<a href="${num}-$((i+1)).html">
- <img border='0' src='${backhref}/${photos_dir}/${photo}' />
+ <img border='0' src='${backhref}/${photos_dir}/${photo}' />
</a>
-<br />
-<br />
-<a href="${backhref}/${photos_dir}/${photo}">Direct link</a>
+
+<p>
+ <a href="${backhref}/${photos_dir}/${photo}">Direct link</a>
+</p>
END
+
if [ "${ORIGINAL_BASEPATH}x" != x ]; then
-cat <<END
-<a href="${ORIGINAL_BASEPATH}/${photo}">Original</a>
+ cat <<END
+<p>
+ <a href="${ORIGINAL_BASEPATH}/${photo}">Original</a>
+</p>
END
fi
-cat <<END
-<h3>${photo}</h3>
-END
diff --git a/src/photoalbum.sh b/src/photoalbum.sh
index 331cf32..ebaaf71 100755
--- a/src/photoalbum.sh
+++ b/src/photoalbum.sh
@@ -82,7 +82,6 @@ albumhtml () {
declare name="page-$num"
template header "$name.html"
- template header-first-add "$name.html"
cd "$DIST_DIR/$photos_dir" && find ./ -type f | sort | sed 's;^\./;;' |
while read -r photo; do
@@ -160,7 +159,6 @@ albumindexhtml () {
declare backhref='..'
template 'header' 'index.html'
- template 'header-first-add' 'index.html'
for dir in ${dirs[*]}; do
declare basename="$(basename "$dir")"
@@ -177,7 +175,7 @@ albumindexhtml () {
declare s=''
[ $pages -gt 1 ] && s='s'
export description="$pictures pictures / $pages page$s"
- template 'index-preview' 'index.html'
+ template 'index.html'
done
template 'footer' 'index.html'