Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/talks.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/talks.sh b/src/talks.sh
index 15f87dd..7a33379 100755
--- a/src/talks.sh
+++ b/src/talks.sh
@@ -41,7 +41,11 @@ talk-field()
local -r id=${1?Missing talk id}
local -r field=${2?Missing talk field}
- recsel -P "$field" -e "id = '$id'" "$TALKFILE"
+ local result status
+ result=$( recsel -P "$field" -e "id = '$id'" "$TALKFILE" )
+ status=$?
+
+ [ $? -a -n "$result" ] && echo "$result"
}
@@ -56,18 +60,23 @@ abstract()
locimg=$( talk-field "$id" locimg )
date=$( talk-field "$id" date )
abstract=$( talk-field "$id" abstract )
- url=$( talk-field "$id" video-url )
+ url=$( talk-field "$id" video-url || echo "#$id" )
links=$( talk-field "$id" link )
local abstract_html
abstract_html=$( pandoc -fmarkdown -thtml5 <<< "$abstract" )
+ local watch_title=
+ if [[ ! "$url" =~ ^# ]]; then
+ watch_title="Watch $location Talk"
+ fi
+
cat <<EOF
<article class="abstract talk">
<h2 class="title" id="$id">$title</h2>
<ul class="links">
- <li><a class="video $locimg" href="$url">Watch $location Talk</a></li>
+ <li><a class="video $locimg" href="$url">$watch_title</a></li>
$(
while read lurl ltitle; do
printf "<li><a href="%s">%s</a></li>\n" "$lurl" "$ltitle"