方便地将所有模板放入特殊目录并编译一次。现在我编写了自己的函数,例如:
make_templates(Dir)->
Files = filelib:wildcard(Dir++"/*.dtl"),
compile(Files,0).
compile([],_)->ok;
compile([File|T],N)->
io:format("Compile file ~p~n",[File]),
R=erlydtl:compile_file(
File,
"template_"++integer_to_list(N),
[{out_dir},"templates"]),
compile(T,N+1).
是否存在使用 erlydtl 执行此操作的标准方法?