2007-12-09 Sun

[別の年の同じ日: 2003 2005 2006 2008 2009 2010 2012

chalow を hAtom に対応させる はてぶ

LDRize に対応させたら便利かな,くらいの気持ちで始めた
chalow の hAtom 対応のまとめ.

1. chalow 本体の書き換え

hAtom では ISO8601形式の時刻が必要なので,
template で ISO8601形式の時刻を使えるように変更する必要があります.

RSS で ISO8601形式の時刻を使用するので,$dcdate という変数に保存されています.
これをテンプレートへ渡すようにします.

--- /usr/bin/chalow~	2006-10-10 05:36:46.000000000 +0900
+++ /usr/bin/chalow	2007-12-05 22:46:09.000000000 +0900
@@ -691,6 +691,7 @@
             $t->param(cl_name => $changelog_name);
             $t->param(css_file => $css_file);
             $t->param(lastupdate => $what_time_is_it_now);
+            $t->param(dcdate => $dcdate);
             $t->param(signature => $signature);

             $t->param(cat_name => $catname);
@@ -777,6 +778,7 @@
 	    $t->param(cl_name => $changelog_name);
 	    $t->param(css_file => $css_file);
 	    $t->param(lastupdate => $what_time_is_it_now);
+            $t->param(dcdate => $dcdate);
 	    $t->param(signature => $signature);

 	    $t->param(ymd => $ymd);
@@ -834,6 +836,7 @@
 	$t->param(cl_name => $changelog_name);
 	$t->param(css_file => $css_file);
 	$t->param(lastupdate => $what_time_is_it_now);
+	$t->param(dcdate => $dcdate);
 	$t->param(signature => $signature);

 	$t->param(ymd => $ymd);
@@ -887,6 +890,7 @@
 	$t->param(cl_name => $changelog_name);
 	$t->param(css_file => $css_file);
 	$t->param(lastupdate => $what_time_is_it_now);
+	$t->param(dcdate => $dcdate);
 	$t->param(signature => $signature);

 	$t->param(ym => $ym);
@@ -932,6 +936,7 @@
     $t->param(cl_name => $changelog_name);
     $t->param(css_file => $css_file);
     $t->param(lastupdate => $what_time_is_it_now);
+    $t->param(dcdate => $dcdate);
     $t->param(signature => $signature);

     $t->param(ymd => $ymd);	# 最新エントリの日付


2. テンプレートの編集
2.1 アイテムのテンプレートの編集

index.html や 月別のページなど複数のアイテムがあるページ用に
アイテムのテンプレートを編集します.

1. entry を <div class="section hentry"> ... </div> で囲む
2. entry のタイトルを <div class="entry-title"> ... </div> で囲む
3. entry の本文を <div class="entry-content"> ... </div> で囲む
4. permalink に rel="bookmark" をつける

2.2 各ページのテンプレートの更新時間部分

各ページのテンプレート共通の変更.

<p>最終更新時間: <TMPL_VAR name=lastupdate></p>



<p>最終更新時間: <abbr class="updated" title="<TMPL_VAR name=dcdate>">
<TMPL_VAR name=lastupdate></abbr>
By <span class="vcard author"><span class="fn">ftnk</span></p>


2.3 アイテムページの編集

1. <div class="day"> を <div class="day hentry"> に変更
2. <TMPL_VAR name=header> を <div class="entry-title"> で囲む
3. <div class="section"> を <div class="section entry-content"> に変更
4. permalink に rel="bookmark" をつける

以上で,最低限の hAtom 化は完了.

- ちょっとだけ LDRize に対応 [2007-11-28-2]
- ちょっとだけ LDRize に対応 2 [2007-12-03-2]
- ちょっとだけ LDRize に対応 3 [2007-12-04-2]
- ちょっとだけ LDRize に対応 4 [2007-12-05-1]
- ちょっとだけ LDRize に対応 5 [2007-12-06-1]

Referrer (Inside):
[2007-12-13-1] たつをさんに捕捉された
[2007-12-11-3] chalow を microformats に対応 - rel-tag