#!/bin/sh
-# Copyright 2023 Paul Hänsch
+# Copyright 2023, 2024 Paul Hänsch
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
[ "${PATH_INFO%\[search\]}" = "$PATH_INFO" ] && return 1
. "$_EXEC/cgilite/storage.sh"
-. "$_EXEC/db23.sh"
+. "$_EXEC/cgilite/db23.sh"
I="$_DATA/index"
words="$( GET q | awk '
while read date doc freq num total; do
P="$_DATA/pages$(UNSTRING "$doc")"
d="$(stat -c %Y -- "$P/#index.flag" 2>&-)"
- [ "$d" -le "$date" ] 2>&- || continue
+ [ "$d" -le "$date" -a -f "$P/#page.md" ] 2>&- || continue
printf '%s %f\n' "$doc" "$freq"
done <"$I/$w"