SakamonWeb
New
Tools
Index
Edit
htmlフィルター
<<httpd.conf>> <pre> # JSPコメントやSmartyコメントを除去するフィルターの定義 ExtFilterDefine cutjspcomment \ mode=output intype=text/html \ cmd="/etc/httpd/conf/delimiter-cut.sh jsp" ExtFilterDefine cutsmartycomment \ mode=output intype=text/html \ cmd="/etc/httpd/conf/delimiter-cut.sh smarty" # デザインファイルの設置場所を/public/パスで公開する Alias /public/ "/srv/work/" <Directory "/srv/work"> Options Indexes FollowSymLinks AllowOverride none Order allow,deny Allow from all # キャッシュさせない FileETag None # index.html がある場合でもディレクトリツリーを表示する DirectoryIndex nothing.html # JSPファイルやSmartyテンプレートもHTMLファイルとして表示 AddType text/html .jsp AddType text/html .tpl # JSPコメントやSmartyコメントを除去する(フィルターの適用) AddOutputFilter cutjspcomment jsp AddOutputFilter cutsmartycomment tpl </Directory> </pre> <<フィルター>> delimiter-cut.sh <pre> #!/bin/sh case ${1} in 'smarty') perl -pe 's/\r\n/_RET_CODE_/g' \ | perl -pe 's/{.*?}//g' \ | perl -pe 's/_RET_CODE_/\r\n/g' ;; 'jsp') perl -pe 's/\r\n/_RET_CODE_/g' \ | perl -pe 's/<%.*?%>//g' \ | perl -pe 's/_RET_CODE_/\r\n/g' ;; '*') cat ;; esac </pre>
Sign:
freeze
sage
Attachment
New:
Sign:
Rename
Title:
Sign: