mirror of
https://github.com/flynx/photobook.git
synced 2026-01-06 18:41:08 +00:00
experimenting with dynamic fields in templates...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3eac98bb5d
commit
7ae71693ec
@ -223,6 +223,23 @@ getCaption(){
|
|||||||
echo ${C[*]}
|
echo ${C[*]}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# XXX EXPERIMENTAL...
|
||||||
|
# index ${VAR} variables in templates...
|
||||||
|
declare -A TEMPLATE_INDEX
|
||||||
|
indexTemplates(){
|
||||||
|
#echo indexing templates...
|
||||||
|
local lst
|
||||||
|
local tpl
|
||||||
|
for tpl in "${TEMPLATE_PATH}"/* ; do
|
||||||
|
#echo ${tpl}...
|
||||||
|
lst=( $(cat "${tpl}" \
|
||||||
|
| grep -o '\${[A-Z0-9]\+}' \
|
||||||
|
| sed 's/\${\(.*\)}/\1/g' \
|
||||||
|
| sort) )
|
||||||
|
TEMPLATE_INDEX[$(basename "${tpl}")]=${lst[@]}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
getTemplate(){
|
getTemplate(){
|
||||||
local SPREAD=$1
|
local SPREAD=$1
|
||||||
local TYPE=$2
|
local TYPE=$2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user