makerss プラグイン
2004-07-21
SleipnirのRSSバーで自分のサイトのRSSを見てみると、いくつか変なところがあった。
- 要約にタイトルが含まれている
- 要約が長すぎる
とりあえず makerss.rb を以下のように修正してみる。
@@ -167,9 +167,8 @@
rdf << %Q|<dc:subject>#{CGI::escapeHTML( category )}</dc:subject>\n|
end
end
- desc = apply_plugin( rdfsec.section.subtitle_to_html, true ).strip +
- apply_plugin( rdfsec.section.body_to_html, true ).strip
- rdf << %Q|<description>#{@conf.shorten( CGI::escapeHTML( desc ), 500 )}</description>\n|
+ desc = apply_plugin( rdfsec.section.body_to_html, true ).strip
+ rdf << %Q|<description>#{@conf.shorten( CGI::escapeHTML( desc ), 120 )}</description>\n|
text = '<h3>' + apply_plugin( rdfsec.section.subtitle_to_html ).strip + '</h3>' +
apply_plugin( rdfsec.section.body_to_html ).strip
text.gsub!( /\]\]>/, ']]>' )
要約の長さが120なのは、tDiaryのツッコミが表示される長さにならってのこと。 RSS的にはこれでいいかどうかは分からないや。
追記
要約の長さは「できれば500バイト以内」ということだった (tDiary-devel より) 。