HTML5 Boilerplate - 修改 WordPress 的 build.xml
我正在尝试获取 HTML5 BoilerPlate (http://html5boilerplate.com/) 中包含的构建脚本,以便与 WordPress 很好地配合。我已成功更改默认配置以压缩 WordPress 主题根目录中的 style.css,但我不确定如何修改 build.xml 以运行 WordPress header.php 和 footer.php。
通常,build.xml 会遍历 index.html 文件并删除注释,然后最重要的是更改 css 和 js 文件引用的版本名称。 我想这对于开发人员来说应该很容易弄清楚,build.xml 使用正则表达式来替换代码行。
我希望 build.xml 能够通过我的 header.php 和 footer.php,执行与 index.html 相同的优化。
谁能建议我需要修改 build.xml 的哪些部分才能完成此任务?
I'm trying to get the Build Script that's included in HTML5 BoilerPlate (http://html5boilerplate.com/) to play nicely with WordPress. I've successfully changed the default config to compress style.css in the root of a WordPress theme, but I'm not sure how to modify the build.xml to run through the WordPress header.php and footer.php.
Normally build.xml runs through the index.html file and strips out commenting then, most importantly, changes the version name of the css and js file references.
I'm imagining this should be pretty easy for a developer to figure out, the build.xml uses regular expressions to replace lines of code.
I'd like the build.xml to wizz through my header.php and footer.php, performing the same optimisations as it does with index.html.
Can anyone suggest which parts of the build.xml I need to modify to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要编辑 build.xml 文件。只需将要解析的文件添加到 build/config/default.properties :
you do not need to edit the build.xml file. Just add the files you want parsed to build/config/default.properties :