- # TODO: make this easier to customize
- date_re="[0-9]{4}-[0-9]{2}-[0-9]{2}"
- time_re="([0-9]{2})-([0-9]{2})"
-
- # my pyblosxom posts have a date prefix, e.g. 2010-03-13. my pages don't.
- if [[ "$fullname" =~ ^${date_re} ]]; then
- type=post
- name=${fullname:11}
- datestr="${fullname::10} 00:00:00 -0800"
- else
- type=page
- name=${fullname}
-
- timestamp_file=${dir}/../timestamps
- datestr=`grep --max-count=1 -E \
- "^${date_re}-${time_re} (.+/)?${fullname}.txt\$" ${timestamp_file} | \
- cut -f1 -d' ' | \
- sed -r "s/-${time_re}\$/ \1:\2 -0500/"`
-
- if [[ ${datestr} == '' ]]; then
- datestr=`stat --format=%y "$file"`
- fi
- fi
-
- pubDate=`date -uR -d "$datestr"`
- date=`date -d "$datestr" +'%F %T'`
- dateGmt=`date -u -d "$datestr" +'%F %T'`