Skip to content
Snippets Groups Projects
Commit ff1677ec authored by Toke Eskildsen's avatar Toke Eskildsen
Browse files

Fixed #23 (HTML-snippets in folders)

parent 0b7f3e22
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@
<body class="folder">
<h1>Quack <span style="color: #999">${SRC_FOLDER}</span></h1>
<div class="foldersnippet">${SNIPPET_FOLDER}</div>
<div class="foldersnippet">${SNIPPET}</div>
<!-- TODO: Create decent bread crumbs -->
<p>Parent folder: <a href="../index.html">${PARENT}</a></p>
......
......@@ -19,7 +19,7 @@ ${IDPREVS}
<body class="previewpage">
<h1>Quack <span style="color: #999">${SOURCE_SHORT}</span></h1>
<div class="imagesnippet">${SNIPPET_IMAGE}</div>
<div class="imagesnippet">${SNIPPET}</div>
<div id="controlpanel" class="control">
<p class="navigation">${NAVIGATION}</p>
......
......@@ -133,12 +133,23 @@ export OVERLAY_WHITE=FFFF00
# Snippets are inserted verbatim at the top of the folder and the image pages.
# Use them for specifying things like delivery date or provider notes.
# Note that these snippet can be overridden on a per-folder and per-image basis
# by creating special files in the source tree (see SPECIFIC_FOLDER_SNIPPET and
# SPECIFIC_IMAGE_SNIPPET_EXTENSION below).
export SNIPPET_FOLDER=""
export SNIPPET_IMAGE=""
# End default settings. User-supplied overrides will be loaded from quack.settings
# If present in a source-folder, the content of the folder will be inserted into
# the generated folder HTML file.
SPECIFIC_FOLDER_SNIPPET="folder.snippet"
# If a file with image basename + this extension is encountered, the content will
# be inserted into the generated image HTML file.
SPECIFIC_IMAGE_SNIPPET_EXTENSION=".snippet"
pushd `dirname $0` > /dev/null
ROOT=`pwd`
......@@ -590,6 +601,14 @@ function makePreviewPage() {
BASE=${SANS_PATH%.*}
P="${DEST_FOLDER}/${BASE}.html"
local SSNIP="${BASE}${SPECIFIC_IMAGE_SNIPPET_EXTENSION}"
if [ -f $SSNIP ]; then
SNIPPET=`cat $SSNIP`
else
SNIPPET="$SNIPPET_FOLDER"
fi
# Used by function caller
PAGE_LINK="${BASE}.html"
......@@ -742,6 +761,11 @@ function makeIndex() {
exit
fi
pushd $SRC_FOLDER > /dev/null
if [ -f $SPECIFIC_FOLDER_SNIPPET ]; then
SNIPPET=`cat $SPECIFIC_FOLDER_SNIPPET`
else
SNIPPET="$SNIPPET_FOLDER"
fi
local SRC_FOLDER=`pwd`
popd > /dev/null
echo "Processing $SRC_FOLDER"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment