mirror of
https://github.com/flynx/photobook.git
synced 2025-11-02 12:20:08 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5d0a593026
commit
c21fb0bbf8
@ -226,7 +226,8 @@ getCaption(){
|
|||||||
# XXX EXPERIMENTAL index template variables...
|
# XXX EXPERIMENTAL index template variables...
|
||||||
declare -A TEMPLATE_INDEX
|
declare -A TEMPLATE_INDEX
|
||||||
templateVars(){
|
templateVars(){
|
||||||
if [ -z ${TEMPLATE_INDEX[$1]} ] ; then
|
# cache the vars...
|
||||||
|
if [ ${TEMPLATE_INDEX[$1]+_} ] ; then
|
||||||
TEMPLATE_INDEX[$1]=$(cat "$1" \
|
TEMPLATE_INDEX[$1]=$(cat "$1" \
|
||||||
| grep -o '\${[A-Z0-9]\+}' \
|
| grep -o '\${[A-Z0-9]\+}' \
|
||||||
| sed 's/\${\(.*\)}/\1/g' \
|
| sed 's/\${\(.*\)}/\1/g' \
|
||||||
@ -234,11 +235,10 @@ templateVars(){
|
|||||||
fi
|
fi
|
||||||
echo ${TEMPLATE_INDEX[$1]}
|
echo ${TEMPLATE_INDEX[$1]}
|
||||||
}
|
}
|
||||||
|
# cache all template vars...
|
||||||
indexTemplates(){
|
indexTemplates(){
|
||||||
#echo indexing templates...
|
|
||||||
local tpl
|
local tpl
|
||||||
for tpl in "${TEMPLATE_PATH}"/* ; do
|
for tpl in "${TEMPLATE_PATH}"/* ; do
|
||||||
#echo ${tpl}...
|
|
||||||
templateVars "${tpl}" > /dev/null
|
templateVars "${tpl}" > /dev/null
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user