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:
6164e2d
)
Add page URL title template field.
master
author
Christian Heller
<c.heller@plomlompom.de>
Thu, 26 Jan 2017 00:27:04 +0000
(
01:27
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Thu, 26 Jan 2017 00:27:04 +0000
(
01:27
+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 8e88dbb86ca4bbbcf55e1dfb250a417289e9b912..f0d43a39dca9970f2a9838bff0ddda2f53d0d114 100644
(file)
--- a/
processor/default.html.do
+++ b/
processor/default.html.do
@@
-33,6
+33,7
@@
title_html=$(cat "$intermediate_file" | head -1)
title_plaintext=`echo "$title_html" | html2text`
title_html=$(printf "%s" "$title_html" | prep_sed)
title_plaintext=$(escape_html "$title_plaintext" | prep_sed)
title_plaintext=`echo "$title_html" | html2text`
title_html=$(printf "%s" "$title_html" | prep_sed)
title_plaintext=$(escape_html "$title_plaintext" | prep_sed)
+title_url=$(escape_html "${1%.html}" | prep_sed)
body=$(cat "$intermediate_file" | sed 1d | prep_sed)
datetime_created_unix=$(get_creation_date_from_meta_file_seconds "$meta_file")
date_created=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}")
body=$(cat "$intermediate_file" | sed 1d | prep_sed)
datetime_created_unix=$(get_creation_date_from_meta_file_seconds "$meta_file")
date_created=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}")
@@
-52,4
+53,5
@@
sed 's/%DATE_UPDATED%/'"$date_updated"'/g' | \
sed 's/%BODY%/'"$body"'/g' | \
sed 's/%LINKBACKS%/'"$replies"'/g' | \
sed 's/%CAPTCHA%/'"$captcha"'/g' | \
sed 's/%BODY%/'"$body"'/g' | \
sed 's/%LINKBACKS%/'"$replies"'/g' | \
sed 's/%CAPTCHA%/'"$captcha"'/g' | \
+sed 's/%TITLE_URL%/'"$title_url"'/g' | \
tr '\a' '%'
tr '\a' '%'
diff --git
a/processor/metadata/article.tmpl.do
b/processor/metadata/article.tmpl.do
index 406878c67eec2820c5014347118b72c26111ee5c..ea81edee4476f93dc6e1e33edc5262233e615f46 100644
(file)
--- a/
processor/metadata/article.tmpl.do
+++ b/
processor/metadata/article.tmpl.do
@@
-27,6
+27,7
@@
Links back:
<ul>%LINKBACKS%
</ul>
Captcha: %CAPTCHA%
<ul>%LINKBACKS%
</ul>
Captcha: %CAPTCHA%
+Title in URL: %TITLE_URL%
</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 76598b581055640571c538c39085f29c817cedde..bf4a6c929c82f359016c73c01b67f9997876bc6e 100644
(file)
--- a/
test/test_files/bar baz.html.ignoring
+++ b/
test/test_files/bar baz.html.ignoring
@@
-26,5
+26,6
@@
Links back:
<ul>
</ul>
Captcha: apple
<ul>
</ul>
Captcha: apple
+Title in URL: bar baz
</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 bc19030b2cd0b25d959a137b6c38b84bdffe2ea7..cfbd635af062b210601dd5c927e15bad5cad3de2 100644
(file)
--- a/
test/test_files/foo.html.ignoring
+++ b/
test/test_files/foo.html.ignoring
@@
-29,5
+29,6
@@
Links back:
<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
<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
+Title in URL: foo
</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 55cc1de3b8deaf03c564a513985e54d7fb3197cf..03921370266da016b6f6b8465b865de8c1c244ae 100644
(file)
--- a/
test/test_files/te"st.html.ignoring
+++ b/
test/test_files/te"st.html.ignoring
@@
-25,5
+25,6
@@
Links back:
<ul>
</ul>
Captcha: apple
<ul>
</ul>
Captcha: apple
+Title in URL: te&quot;st
</footer>
</article>
\ No newline at end of file
</footer>
</article>
\ No newline at end of file