summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorp4bl0 <pablo@rauzy.name>2010-09-27 01:54:43 +0200
committerp4bl0 <pablo@rauzy.name>2010-09-27 01:54:43 +0200
commite962d0ddf1c5101c0e95d214fef8cb7213534df1 (patch)
treec1364f76d574d8f305c618f59ca74750cca77e51
parentc539465b53f4cde36f9d86d560d69de5185b0b4d (diff)
added *datetime_html5 variables to be compliant with heretic w3c standard
-rw-r--r--README16
-rw-r--r--default-files/archives.html4
-rw-r--r--default-files/article.html4
-rw-r--r--default-files/bottom.html6
-rw-r--r--html-gen.sh9
5 files changed, 33 insertions, 6 deletions
diff --git a/README b/README
index edd4815..7711b32 100644
--- a/README
+++ b/README
@@ -231,6 +231,12 @@ fugitive: README
Its value is the date and time of the last commit that provoked the
(re)generation of the file.
</dd>
+ <dt>commit_datetime_html5</dt>
+ <dd>
+ Its value is the date and time of the last commit that provoked the
+ (re)generation of the file, <em>but in an html5 <code>&lt;time&gt;</code>
+ compliant format</em>.
+ </dd>
<dt>commit_date</dt>
<dd>
Its value is the date of the last commit that provoked the (re)generation
@@ -286,6 +292,11 @@ fugitive: README
the <em>articles-dir</em> directory
(see <a href="#config">configuration</a>)).
</dd>
+ <dt>article_cdatetime_html5</dt>
+ <dd>
+ Same as previous, but in an html5 <code>&lt;time&gt;</code> compliant
+ format.
+ </dd>
<dt>article_cdate</dt>
<dd>
Its value is the date of the publication of the article.
@@ -303,6 +314,11 @@ fugitive: README
Its value is the date and time of the last modification of the article
(the date of the last commit which changed the article file).
</dd>
+ <dt>article_mdatetime_html5</dt>
+ <dd>
+ Same as previous, but in an html5 <code>&lt;time&gt;</code> compliant
+ format.
+ </dd>
<dt>article_mdate</dt>
<dd>
Its value is the date of the last modification of the article.
diff --git a/default-files/archives.html b/default-files/archives.html
index 87c3bea..1b0e8bf 100644
--- a/default-files/archives.html
+++ b/default-files/archives.html
@@ -7,7 +7,7 @@
<dl>
<?fugitive foreach:article ?>
<dt>
- <time datetime="<?fugitive article_cdatetime ?>">
+ <time datetime="<?fugitive article_cdatetime_html5 ?>">
<?fugitive article_cdate ?> at <?fugitive article_ctime ?>
</time>
</dt>
@@ -17,7 +17,7 @@
</a>
<?fugitive ifset:article_mdatetime ?>
<br /><small>last update on
- <time datetime="<?fugitive article_mdatetime ?>">
+ <time datetime="<?fugitive article_mdatetime_html5 ?>">
<?fugitive article_mdate ?> at <?fugitive article_mtime ?>
</time>
</small>
diff --git a/default-files/article.html b/default-files/article.html
index 02920a2..c32a927 100644
--- a/default-files/article.html
+++ b/default-files/article.html
@@ -7,12 +7,12 @@
</header>
<footer>
by <?fugitive article_cauthor ?>, on
- <time datetime="<?fugitive article_cdatetime ?>">
+ <time datetime="<?fugitive article_cdatetime_html5 ?>">
<?fugitive article_cdate ?> at <?fugitive article_ctime ?>
</time>
<?fugitive ifset:article_mdatetime ?>
<br /><small>last update by <?fugitive article_mauthor ?>, on
- <time datetime="<?fugitive article_mdatetime ?>">
+ <time datetime="<?fugitive article_mdatetime_html5 ?>">
<?fugitive article_mdate ?> at <?fugitive article_mtime ?>
</time>
</small>
diff --git a/default-files/bottom.html b/default-files/bottom.html
index ff9bd45..5e0c9fe 100644
--- a/default-files/bottom.html
+++ b/default-files/bottom.html
@@ -28,8 +28,10 @@
powered by <a href="http://gitorious.org/fugitive">fugitive</a>
</p>
<p>
- last build was <?fugitive commit_hash ?>
- at <time><?fugitive commit_datetime ?></time>,<br />
+ last build was <?fugitive commit_hash ?> at
+ <time datetime="<?fugitive commit_datetime_html5 ?>">
+ <?fugitive commit_datetime ?>
+ </time>,<br />
subject was <q><?fugitive commit_subject ?></q>
</p>
</footer>
diff --git a/html-gen.sh b/html-gen.sh
index ef03fc8..a0f4422 100644
--- a/html-gen.sh
+++ b/html-gen.sh
@@ -165,6 +165,8 @@ replace_commit_info() {
commit_author=`get_commit_info "%an" "$1"`
commit_author_email=`get_commit_info "%ae" "$1" | sanit_mail`
commit_datetime=`get_commit_info "%ai" "$1"`
+ commit_datetime_html5=`echo "$commit_datetime" | \
+ sed "s/ /T/;s/ \(+\|-\)\([0-9][0-9]\)/\1\2:/"`
commit_date=`echo $commit_datetime | cut -d' ' -f1`
commit_time=`echo $commit_datetime | cut -d' ' -f2`
commit_timestamp=`get_commit_info "%at" "$1"`
@@ -177,6 +179,7 @@ replace_commit_info() {
replace_str "commit_author" "$commit_author" | \
replace_str "commit_author_email" "$commit_author_email" | \
replace_str "commit_datetime" "$commit_datetime" | \
+ replace_str "commit_datetime_html5" "$commit_datetime_html5" | \
replace_str "commit_date" "$commit_date" | \
replace_str "commit_time" "$commit_time" | \
replace_str "commit_timestamp" "$commit_timestamp" | \
@@ -188,12 +191,16 @@ replace_commit_info() {
replace_article_info() {
article_title=`get_article_title "$1"`
article_cdatetime=`get_article_info "%ai" "$1" | tail -1`
+ article_cdatetime_html5=`echo "$article_cdatetime" | \
+ sed "s/ /T/;s/ \(+\|-\)\([0-9][0-9]\)/\1\2:/"`
article_cdate=`echo "$article_cdatetime" | cut -d' ' -f1`
article_ctime=`echo "$article_cdatetime" | cut -d' ' -f2`
article_ctimestamp=`get_article_info "%at" "$1" | tail -1`
u=`get_article_info "%ai" "$1" | wc -l`
article_mdatetime=`if test "$u" -gt 1; then get_article_info "%ai" "$1" | \
head -1; fi`
+ article_mdatetime_html5=`echo "$article_mdatetime" | \
+ sed "s/ /T/;s/ \(+\|-\)\([0-9][0-9]\)/\1\2:/"`
article_mdate=`echo "$article_mdatetime" | cut -d' ' -f1`
article_mtime=`echo "$article_mdatetime" | cut -d' ' -f2`
article_mtimestamp=`if test "$u" -gt 1; then get_article_info "%at" \
@@ -211,10 +218,12 @@ replace_article_info() {
replace_str "article_file" "$1" | \
replace_str "article_title" "$article_title" | \
replace_str "article_cdatetime" "$article_cdatetime" | \
+ replace_str "article_cdatetime_html5" "$article_cdatetime_html5" | \
replace_str "article_cdate" "$article_cdate" | \
replace_str "article_ctime" "$article_ctime" | \
replace_str "article_ctimestamp" "$article_ctimestamp" | \
replace_str "article_mdatetime" "$article_mdatetime" | \
+ replace_str "article_mdatetime_html5" "$article_mdatetime_html5" | \
replace_str "article_mdate" "$article_mdate" | \
replace_str "article_mtime" "$article_mtime" | \
replace_str "article_mtimestamp" "$article_mtimestamp" | \