追記(more)に記事を書いていると、メインページなどで「続きを読む....」というリンクが出るようになるが、デフォルトのAtomやRSS2.0のテンプレートでは、そういう風にはなっていない。
おまけに、SleipnirのHeadline-Reader Pluginでは「閉じタグ」らしきものが見えてしまっていた。
それがどうにも気になって、なんとかしてやろうと思ってみた。
変更するのは「entry」内の「content」。
Atom.xmlのデフォルトテンプレートでは、「MTEntryBody」と「MTEntryMore」がそのまま表示されている。
<content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>">
<$MTEntryBody encode_xml="1" convert_breaks="0"$>
<$MTEntryMore encode_xml="1" convert_breaks="0"$>
</content>
これを以下のように変更する。
<content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>">
<MTIfNonEmpty tag="EntryBody" encode_xml="1"><$MTEntryBody$><MTIfNonEmpty tag="EntryMore"><p><a href="<$MTEntryPermalink$>">続きを読む</a></p></MTIfNonEmpty></MTIfNonEmpty>
</content>
content全体を一度にencode_xmlするために、冗長なタグも使っているが、少なくともSleipnirのHeadline-Reader Pluginではきれいに読めるようになったので、一石二鳥である。
