home
·
contact
·
privacy
projects
/
redo-blog
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0dddf8e
)
Add captcha placeholder to templating.
author
Christian Heller
<c.heller@plomlompom.de>
Wed, 25 Jan 2017 02:10:03 +0000
(
03:10
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Wed, 25 Jan 2017 02:10:03 +0000
(
03:10
+0100)
processor/default.html.do
patch
|
blob
|
history
processor/metadata/article.tmpl.do
patch
|
blob
|
history
test/test_files/bar baz.html.ignoring
patch
|
blob
|
history
test/test_files/foo.html.ignoring
patch
|
blob
|
history
test/test_files/te"st.html.ignoring
patch
|
blob
|
history
diff --git
a/processor/default.html.do
b/processor/default.html.do
index ba163e2e29f32369cd2075f5d282cd6b46879326..196713c1172d6b090cc9d8d74168036f9f1cdb7d 100644
(file)
--- a/
processor/default.html.do
+++ b/
processor/default.html.do
@@
-38,6
+38,7
@@
date_created=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}")
datetime_lastmod_unix=$(get_lastmod_date_from_meta_file "$meta_file")
date_updated=$(date -u "+%Y-%m-%d" -d "@${datetime_lastmod_unix}")
replies=$(while read line; do prep_url "$line"; done < "$replies_file")
datetime_lastmod_unix=$(get_lastmod_date_from_meta_file "$meta_file")
date_updated=$(date -u "+%Y-%m-%d" -d "@${datetime_lastmod_unix}")
replies=$(while read line; do prep_url "$line"; done < "$replies_file")
+captcha=$(escape_html "$(cat "$captcha_file" | sed -n 2p)" | prep_sed)
# Put data into template.
template=$(cat "$article_tmpl_file")
# Put data into template.
template=$(cat "$article_tmpl_file")
@@
-49,4
+50,5
@@
sed 's/%DATE_CREATED%/'"$date_created"'/g' | \
sed 's/%DATE_UPDATED%/'"$date_updated"'/g' | \
sed 's/%BODY%/'"$body"'/g' | \
sed 's/%LINKBACKS%/'"$replies"'/g' | \
sed 's/%DATE_UPDATED%/'"$date_updated"'/g' | \
sed 's/%BODY%/'"$body"'/g' | \
sed 's/%LINKBACKS%/'"$replies"'/g' | \
+sed 's/%CAPTCHA%/'"$captcha"'/g' | \
tr '\a' '%'
tr '\a' '%'
diff --git
a/processor/metadata/article.tmpl.do
b/processor/metadata/article.tmpl.do
index f24106a045ca5b382a34127d09836d1d1c4684f8..406878c67eec2820c5014347118b72c26111ee5c 100644
(file)
--- a/
processor/metadata/article.tmpl.do
+++ b/
processor/metadata/article.tmpl.do
@@
-26,6
+26,7
@@
header p { margin: 0; }
Links back:
<ul>%LINKBACKS%
</ul>
Links back:
<ul>%LINKBACKS%
</ul>
+Captcha: %CAPTCHA%
</footer>
</article>
EOF
</footer>
</article>
EOF
diff --git
a/test/test_files/bar baz.html.ignoring
b/test/test_files/bar baz.html.ignoring
index 1c29f066b1e07ca95a42b47a1b00d3e1ba415cbf..76598b581055640571c538c39085f29c817cedde 100644
(file)
--- a/
test/test_files/bar baz.html.ignoring
+++ b/
test/test_files/bar baz.html.ignoring
@@
-25,5
+25,6
@@
header p { margin: 0; }
Links back:
<ul>
</ul>
Links back:
<ul>
</ul>
+Captcha: apple
</footer>
</article>
\ No newline at end of file
</footer>
</article>
\ No newline at end of file
diff --git
a/test/test_files/foo.html.ignoring
b/test/test_files/foo.html.ignoring
index 0af39000b76736358078646cc333142f009c604a..bc19030b2cd0b25d959a137b6c38b84bdffe2ea7 100644
(file)
--- a/
test/test_files/foo.html.ignoring
+++ b/
test/test_files/foo.html.ignoring
@@
-28,5
+28,6
@@
Links back:
<li><a href="http://example.org/">http://example.org/</a></li>
<li><a href="http://example.com/some$()wh%20at'da&quot;ngerusURL">http://example.com/some$()wh%20at'da&quot;ngerusURL</a></li>
</ul>
<li><a href="http://example.org/">http://example.org/</a></li>
<li><a href="http://example.com/some$()wh%20at'da&quot;ngerusURL">http://example.com/some$()wh%20at'da&quot;ngerusURL</a></li>
</ul>
+Captcha: apple
</footer>
</article>
\ No newline at end of file
</footer>
</article>
\ No newline at end of file
diff --git
a/test/test_files/te"st.html.ignoring
b/test/test_files/te"st.html.ignoring
index d751b3bbce489bfd34eff941a05823d2512214c6..55cc1de3b8deaf03c564a513985e54d7fb3197cf 100644
(file)
--- a/
test/test_files/te"st.html.ignoring
+++ b/
test/test_files/te"st.html.ignoring
@@
-24,5
+24,6
@@
header p { margin: 0; }
Links back:
<ul>
</ul>
Links back:
<ul>
</ul>
+Captcha: apple
</footer>
</article>
\ No newline at end of file
</footer>
</article>
\ No newline at end of file