2020-12-19 19:43:21 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Finds all tags referenced in one post.
|
|
|
|
# Accepts either filename as first argument, or post content at stdin
|
|
|
|
# Prints one line with space-separated tags to stdout
|
2021-03-12 09:13:56 +00:00
|
|
|
declare template_tags_line_header
|
2020-12-19 19:43:21 +00:00
|
|
|
tags_in_post() {
|
|
|
|
sed -n "/^<p>$template_tags_line_header/{s/^<p>$template_tags_line_header//;s/<[^>]*>//g;s/[ ,]\+/ /g;p;}" "$1" | tr ', ' ' '
|
2021-02-11 06:44:09 +00:00
|
|
|
}
|