1
0
Fork 0
mirror of https://git.ludikovsky.name/git/fugitive.git synced 2024-05-18 06:25:33 +02:00

added *datetime_html5 variables to be compliant with heretic w3c standard

This commit is contained in:
p4bl0 2010-09-27 01:54:43 +02:00
parent c539465b53
commit e962d0ddf1
5 changed files with 33 additions and 6 deletions

16
README
View file

@ -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.

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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" | \