不断です
makerss.rb が生成する RSS の title 要素にカテゴリー指定文字
列が含まれないよう仕様変更(rev.1.36)されましたが…。
わたしの場合、カテゴリーが表示されることを前提にセクションタ
イトルを付けていることもあり、 RSS の title からカテゴリーを
削られてしまうと悲しいことになってしまうセクションがちらほら
あります。
# 同様の理由から my-ex.rb や recent_comment3.rb や
# tb-send.rb でカテゴリーが削られるのも悲しいのですが、
# それはさておき…。
そこで、 rev.1.35 以前と同様の動作をするオプションを追加して
みました。
--- makerss.rb.orig Fri Oct 14 15:50:54 2005
+++ makerss.rb Sat Oct 22 19:57:39 2005
@@ -14,6 +14,7 @@
# @conf.description : desciption of the diary
# @conf['makerss.partial'] : how much portion of body to be in description
# used when makerss.shortdesc, default: 0.25
+# @conf['makerss.showcategories'] : include category tag(s) into "title" element
#
# CAUTION: Before using, make 'index.rdf' file into the directory of your diary,
# and permit writable to httpd.
@@ -217,7 +218,11 @@
@conf['apply_plugin'] = true
subtitle = apply_plugin( rdfsec.section.subtitle_to_html, true ).strip
- subtitle.sub!( /^(\[([^\]]+)\])+ */, '' )
+ unless
+ @conf['makerss.showcategories'] == 'true'
+ then
+ subtitle.sub!( /^(\[([^\]]+)\])+ */, '' )
+ end
if subtitle.empty?
subtitle = apply_plugin( rdfsec.section.body_to_html, true ).strip
subtitle = @conf.shorten( subtitle.gsub( /&.*?;/, '' ), 20 )
@@ -234,7 +239,13 @@
rdf << %Q|<description>#{CGI::escapeHTML( makerss_desc_shorten( desc ) )}</description>\n|
unless @conf['makerss.hidecontent']
text = ''
- text += '<h3>' + apply_plugin( rdfsec.section.subtitle_to_html.sub( /^(\[([^\]]+)\])+ */, '' ) ).strip + '</h3>' if rdfsec.section.subtitle_to_html and not rdfsec.section.subtitle_to_html.empty?
+ if
+ @conf['makerss.showcategories'] == 'true'
+ then
+ text += '<h3>' + apply_plugin( rdfsec.section.subtitle_to_html ).strip + '</h3>' if rdfsec.section.subtitle_to_html and not rdfsec.section.subtitle_to_html.empty?
+ else
+ text += '<h3>' + apply_plugin( rdfsec.section.subtitle_to_html.sub( /^(\[([^\]]+)\])+ */, '' ) ).strip + '</h3>' if rdfsec.section.subtitle_to_html and not rdfsec.section.subtitle_to_html.empty?
+ end
text += apply_plugin( rdfsec.section.body_to_html ).strip
unless text.empty?
text.gsub!( /\]\]>/, ']]>' )
--
不断
mailto:joker@...
|