title_plaintext=$(escape_html "$title_plaintext" | prep_sed)
body=$(cat "$intermediate_file" | sed 1d | prep_sed)
datetime_created_unix=$(get_creation_date_from_meta_file_seconds "$meta_file")
-datetime_created_rfc3339=$(date -u "+%Y-%m-%dT%TZ" -d "@${datetime_created_unix}")
-datetime_created_friendly=$(date -u "+%Y-%m-%d %H:%M (UTC)" -d "@${datetime_created_unix}")
+datetime_created_friendly=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}")
# Put data into template.
template=$(cat "$template_file")
sed 's/%BLOG_TITLE%/'"$blog_title"'/g' | \
sed 's/%ARTICLE_TITLE_ESCAPED%/'"$title_plaintext"'/g' | \
sed 's/%ARTICLE_TITLE_HTML%/'"$title_html"'/g' | \
-sed 's/%DATETIME_CREATED_RFC3339%/'"$datetime_created_rfc3339"'/g' | \
-sed 's/%DATETIME_CREATED_FRIENDLY%/'"$datetime_created_friendly"'/g' | \
+sed 's/%DATE_CREATED%/'"$datetime_created_friendly"'/g' | \
sed 's/%BODY%/'"$body"'/g' | \
tr '\a' '%'
# Put data into template.
template=$(cat "$template_file")
printf "%s" "$template" | \
-sed 's/%TITLE%/'"$title"'/g' | \
-sed 's/%LIST%/'"$list"'/g' | \
+sed 's/%BLOG_TITLE%/'"$title"'/g' | \
+sed 's/%INDEX%/'"$list"'/g' | \
tr '\a' '%'
<article>
<header>
<h1>%ARTICLE_TITLE_HTML%</h1>
-<p><time datetime="%DATETIME_CREATED_RFC3339%">%DATETIME_CREATED_FRIENDLY%</time></p>
+<p><time>%DATE_CREATED%</time></p>
</header>
%BODY%
</article>
h1 { font-size: 2em; }
</style>
<link rel="alternate" type="application/rss+xml" title="atom feed" href="feed.xml" />
-<title>%TITLE%</title>
+<title>%BLOG_TITLE%</title>
</head>
<body>
-<h1>%TITLE%</h1>
+<h1>%BLOG_TITLE%</h1>
<p><a href="feed.xml">feed</a></p>
<ul>
-%LIST%
+%INDEX%
</ul>
</body>
</html>
fi
generated_file="$cmp_file".ignoring
cat "$cmp_file" | \
- sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/IGNORE/g' | \
- sed 's/IGNORET[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}Z/IGNORE/g' | \
- sed 's/IGNORE [0-9]\{2\}:[0-9]\{2\} (UTC)/IGNORE/g' \
+ sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/IGNORE/g' \
> "$generated_file"
+# cat "$cmp_file" | \
+# sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/IGNORE/g' | \
+# sed 's/IGNORET[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}Z/IGNORE/g' | \
+# sed 's/IGNORE [0-9]\{2\}:[0-9]\{2\} (UTC)/IGNORE/g' \
+# > "$generated_file"
diff_test "$file" "$generated_file"
done
<!DOCTYPE html>
<html>
<head>
+<meta charset="UTF-8">
+<style type="text/css">
+h1 { font-size: 2em; }
+h2 { font-size: 1.5em; }
+h3 { font-size: 1.17em; }
+h4 { font-size: 1.12em; }
+h5 { font-size: .83em; }
+h6 { font-size: .75em; }
+header h1 { margin-bottom: 0.1em; }
+header p { margin: 0; }
+</style>
<title>Yet another blog – foo</title>
</head>
<body>
<article>
<header>
<h1>foo</h1>
-<p><time datetime="IGNORE">IGNORE</time></p>
+<p><time>IGNORE</time></p>
</header>
<h2 id="bar">bar</h2>
<p>bar</p>
<!DOCTYPE html>
<html>
<head>
+<meta charset="UTF-8">
+<style type="text/css">
+h1 { font-size: 2em; }
+h2 { font-size: 1.5em; }
+h3 { font-size: 1.17em; }
+h4 { font-size: 1.12em; }
+h5 { font-size: .83em; }
+h6 { font-size: .75em; }
+header h1 { margin-bottom: 0.1em; }
+header p { margin: 0; }
+</style>
<title>Yet another blog – a title with some nasty characters: &<>"' %BODY%</title>
</head>
<body>
<article>
<header>
<h1>a title with some nasty characters: &<>"' %BODY%</h1>
-<p><time datetime="IGNORE">IGNORE</time></p>
+<p><time>IGNORE</time></p>
</header>
<p>this text contains some special characters: /;%'"><&äöüß</p>
<h2 id="some-sub-heading">some sub-heading</h2>
<!DOCTYPE html>
<html>
<head>
+<meta charset="UTF-8">
+<style type="text/css">
+h1 { font-size: 2em; }
+</style>
<link rel="alternate" type="application/rss+xml" title="atom feed" href="feed.xml" />
<title>Yet another blog</title>
</head>
<!DOCTYPE html>
<html>
<head>
+<meta charset="UTF-8">
+<style type="text/css">
+h1 { font-size: 2em; }
+h2 { font-size: 1.5em; }
+h3 { font-size: 1.17em; }
+h4 { font-size: 1.12em; }
+h5 { font-size: .83em; }
+h6 { font-size: .75em; }
+header h1 { margin-bottom: 0.1em; }
+header p { margin: 0; }
+</style>
<title>Yet another blog – foo bar baz</title>
</head>
<body>
<article>
<header>
<h1>foo <em>bar</em> <strong>baz</strong></h1>
-<p><time datetime="IGNORE">IGNORE</time></p>
+<p><time>IGNORE</time></p>
</header>
<p>foo</p>
<h2 id="bar">bar</h2>