HTH。これは、あなたがいる状況(一般的なナビゲーションなど)に最適です。
ttree
コマンドが付属しており、ディレクトリツリーを処理して別のディレクトリに結果を格納します。
ここで私が使用しtt.rcファイルです:
# ignore these files (regular expressions)
ignore = \.svn
ignore = ^#
ignore = ~$
ignore = .DS_Store
ignore = \.tt$
# if these template files change, reprocess everything
depend *=tpl/wrapper,tpl/defaults,style/default.html
# just copy these files, don't process as templates
copy = \.(gif|png|pdf|jpg)$
# verbose output
verbose
# recurse into subdirectories
recurse
# setup some defaults from tpl/defaults
pre_process = tpl/defaults
# process this file instead of the real file (see below how this is used)
process = tpl/wrapper
# process files from src/, output to html/
# extra templates in lib/ (tpl/wrapper for example).
src = src
dest = html
lib = lib
特殊ファイルのカップル、tpl/defaults
は
[%- page = {
title = template.title,
style = template.style or 'default.html'
};
base = INCLUDE tpl/base_uri;
# don't include any whitespace from here...
RETURN;
-%]
そしてtpl/wrapper
では、これが本当のを処理します
[%- content = PROCESS $template;
IF !template.name.search('.html') OR page.style == 'none';
content;
ELSE;
default_style_template = "style/" _ page.style;
PROCESS $default_style_template;
END;
%]
ですテンプレート;結果をcontent
変数に入れてテンプレート(のpage.style
で設定、デフォルトはdefaults.html
)を処理します。
lib/style/default.html
スタイルファイルは、本物のテンプレートをインクルードする
[% content %]
どこかを持っている必要があります。前と後で、標準フッタとヘッダを持つことができます。
Template Toolkitの詳細については、tt2.orgをご覧ください。
また、再帰モードでwget
(または類似のもの)を使用して、開発サーバーでPHPによって生成されたページを「ミラー化」することもできます。私はそれをお勧めしません。
CGIはまだオプションですか?ほとんどの人は、他のサーバー側のスクリプティングでは尽きるほどの可用性は無視していますが、このような状況では(このような状況も経験したように)CGIは通常オプションとなります。 – Nikko
残念ながら、いいえ。 – micmcg