10 USAGE
="Usage: $(basename "$0") VERSION"
12 [ $# -eq 1 ] || error
"$USAGE"
16 TMPFILE
=$
(mktemp
/tmp
/tor-blog-post-XXXXXX.html
)
18 ikiwiki
--setup ikiwiki.setup \
19 --render "wiki/src/news/version_${VERSION:?}.mdwn" \
21 --mute MISSING_ENDTAG_BEFORE
,INSERTING_TAG
,DISCARDING_UNEXPECTED
,UNKNOWN_ENTITY
,MISSING_ATTRIBUTE
,TRIM_EMPTY_ELEMENT
,STRING_CONTENT_LOOKS \
23 |
sed '0,/^<div id="content" role="main">$/d' \
24 |
sed '/^<div id="footer" class="pagefooter" role="contentinfo">$/,$d' \
25 |
sed '/^<div class="toc">$/,+7d'\
26 |
sed '/^<p><img [^<>]*\/><\/p>$/d' \
27 |
sed '/^<div[^<>]*\>/d' \
28 |
sed '/^<\/div>$/d' \
29 |
sed 's@<a name[^<>]*></a>@@g' \
30 |
sed 's@href="\.\./@href="https://tails.boum.org/@g' \
31 |
sed 's@src="\./@src="https://tails.boum.org/news/@g' \
32 |
sed 's@\(\.en\)\?.html@/@g' \
35 cat >> "$TMPFILE" <<EOF
36 <h1>Support and feedback</h1>
37 <p>For support and feedback, visit the <a href="https://tails.boum.org/support/">Support section</a> on the Tails website.</p>
40 echo "Done! The draft Tor blog post was written to $TMPFILE"