Drkcore

23 01 2007 catalyst Tweet

TTSiteで謎の空白行

相変わらずCatalyst。Adding RSS feedsを参考にTTSiteでRSS出力。

が、なぜかファイルの先頭に謎の空白行が。

XML パースエラー: 外部実体の初めに XML 宣言がありません。
URL: http://localhost:3000/rss/bookmarks/kzfm
行番号: 2, 列番号: 1:<?xml version="1.0" encoding="UTF-8"?>
^

root/lib/config/colが原因だった。

[% site.rgb = {
     black  = '#000000'
     white  = '#ffffff'
...
      error   = site.rgb.red
   };
-%]

とやって解決。

あと、rss用のテンプレート指定したときにヘッダーフッター入らないようにroot/lib/site/wrapperに書いておく。

[% IF template.name.match('\.(css|js|txt|rss)');
     debug("Passing page through as text: $template.name");
     content;
   ELSE;
     debug("Applying HTML page layout wrappers to $template.name\n");
     content WRAPPER site/html + site/layout;
   END;
-%]

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021