【问题标题】:HTML5 Boilerplate - Modifying the build.xml for WordPressHTML5 Boilerplate - 修改 WordPress 的 build.xml
【发布时间】:2011-03-22 20:09:58
【问题描述】:

我正在尝试让 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 的哪些部分来完成此操作?

【问题讨论】:

    标签: regex wordpress optimization html boilerplate


    【解决方案1】:

    您不需要编辑 build.xml 文件。只需将要解析的文件添加到 build/config/default.properties :

    #
    # HTML, PHP, etc files to clean and update script/css references
    #
    file.pages.default.include  = index.html, 404.html, header.php, footer.php
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-08
      • 1970-01-01
      相关资源
      最近更新 更多