mkdir -p -- "$_DATA/pages/$page/"
# Macros expect to find page directory as working dir
( cd -- "$_DATA/pages/$page/";
- sed -E '1,20{ /^%[a-z]+/d; }' "$mdfile" \
- | md |tee -- "${cache}.$$"
+ md <"$mdfile" \
+ | tee -- "${cache}.$$"
)
grep -q '^%nocache' "$mdfile" \
&& rm -- "${cache}.$$" \
#!/bin/sh
. "$_EXEC/cgilite/cgilite.sh"
+. "$_EXEC/cgilite/users.sh"
. "$_EXEC/acl.sh"
. "$_EXEC/tools.sh"
continue
fi
printf '<div class="macro include" page="%s">' "$(HTML "$glob")"
- ( cd "${mdfile%/*}"
+ ( cd -- "${mdfile%/*}"
sed -n "${from},${to}p" <"$mdfile" \
- | sed -E '1,20{ /^%[a-z]+/d; }' \
| md \
| grep -vx ''
) | sed -E '