--- /dev/null
+#!/bin/sh
+
+. "$_EXEC/cgilite/storage.sh"
+
+_DATE="$(date +%s)"
+
+mkdir -p "$_DATA"/tags
+
+printf '<ul class="macro tag">\n'
+for tag in "$@"; do
+ tag="$(printf %s "$tag" |awk '{ sub(/^#/, ""); gsub(/[^[:alnum:]]/, "_"); print toupper($0); }')"
+ DBM "${_DATA}/tags/${tag}" set "$PATH_INFO" "$_DATE"
+ printf '<li class="tag">#%s</li>\n' "$tag"
+done
+printf '</ul>\n'
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+. "${_EXEC}/cgilite/storage.sh"
+
md(){
local parser
*) PATH "${PATH_INFO%/*}/${1%/}/";;
esac
}
+
+has_tags() {
+ local page="$(page_abs "$1")"; shift 1;
+ local tdir="$_DATA/tags" tag dt df
+
+ for tag in "$@"; do
+ tag="$(printf %s "$tag" |awk '{ sub(/^#/, ""); gsub(/[^[:alnum:]]/, "_"); print toupper($0); }')"
+ dt="$(DBM "${tdir}/${tag}" get "${page}")" || return 1
+ df="$(stat -c %Y "$(mdfile "$page")")" || return 1
+ if [ "$df" -gt "$dt" ]; then
+ DBM "${tdir}/${tag}" remove "${page}"
+ return 1
+ fi
+ done
+ return 0
+}