HTML5Boilerplate 0.95 Released. Please Break the Build Script.

The latest version of HTML5 Boilerplate was released and the build script I worked on is included as a beta feature. I’m happy to see it in the wild even though it reminds me that I’ve got a couple of outstanding enhancements I want to take care of at some point (soon? *fingers crossed*)

Anyway, check it out and definitely take the build script for a spin. Know Ant and want to help out? Want to port it to another build system (that would be awesome)? Dive in. We’re happy for the help.

14 thoughts on “HTML5Boilerplate 0.95 Released. Please Break the Build Script.

  1. @Rob, I’ve been looking at the HTML5Boilerplate and was wondering where I can ask a question on the build script you’ve been heavily involved with. Just in case I’m at the right place; I like the work very much but noticed no recent updates. My query is how do I include sub-folders into the build?

    I keep each page of my web site in an individual folder, which allows me to use friendly URLs (mysite/chapter2/html5/). Each file is; index.something with all the extensions registered on my web server. I want to target my static index.html files; which are all dynamically created using XML/XSLT. How and where would I target /chapter2/html5/index.html? Thanks.

  2. There are actually some interesting updates coming with version 1.0.

    You basically just need the path rewriting to work across a set of files. That happens in the html target. With the version you have you could do something like this, using the fileset argument to get ant to go through the publishing directory and grab *.html files

      
    <target name="html" depends="">
    <echo message="Clean up the html..."/>
    <!-- style.css replacement handled as a replacetoken above -->
    <replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*?!-- end concatenated and minified scripts--&gt;" replace="&lt;script src='${dir.js}/scripts-${build.number}.min.js\'&gt;&lt;/script&gt;" flags="m">
    <fileset dir="./${dir.publish}/" includes="**/*.html"/>
    </replaceregexp>
    <replaceregexp match="&lt;!-- yui profiler[\d\w\s\W]*?end profiling code --&gt;" file="./${dir.publish}/${file.index}" replace=" " flags="m"/>
    <!--[! use comments like this one to avoid having them get minified -->
    </target>

  3. Thanks for the quick reply @Rob. I replace <target name=”html” depends=””> section with your code in build.xml, created a new sub-folder, copied index.html into it, run ant minify. Both get copied to publish OK but only the root index.html gets compressed. Where am I going wrong please.

  4. Sorry, you need to do the same in the next three targets, replacing

    <fileset dir="./${dir.publish}/" includes="*.html"/>

    with

    <fileset dir="./${dir.publish}/" includes="**/*.html"/>

  5. Curious about the mapper element. Does that need modifying to read **/*.html instead of *.html?

  6. Maybe each element and attribute will need descriptive comments/documentation once you have everything ironed out; such as all the empty <srcfile/> elements! Thanks for the help.

  7. @Rob, was version 1.0 you mentioned earlier referring to the build script or the HTML5boilerplate? Is there somewhere I can take a look at it? What’s the most exciting change/s do you think? If you don’t ask …

  8. I have decided to learn Ant because I’m impressed with what it can do for you. The first task will be to fully understand what your build.xml file is doing. I’ve downloaded Oreilly Ant The Definitive Guide 2nd Edition for starters. Do you have a good resource for learning Ant?

  9. that’s a really good resource. Beyond that, and the Apache Docs, I learned a lot about Ant just reading about people’s solutions. There are a lot of people out there who share interesting solutions to project specific problems. You can see some patterns and adapt a lot of code that way.

  10. Thanks for that @Rob. Here’s my first task to try and solve.

    I have a batch file that transforms a source file;index.htm (which contains all the content that changes across each page; the title, description,author,breadcrumb trail and content), using an XSL style-sheet that merges in global content (header, footer, menus, etc.) to produce the output document; index.html, in a friendly URL named folder.

    xsltproc -o ../index.html html5.xsl ../x/index.htm
    xsltproc -o ../sitemap/index.html html5.xsl ../x/sitemap/index.htm
    xsltproc -o ../address-form/index.html html5.xsl ../x/address-form/index.htm
    xsltproc -o ../tutorial/strict/index.html strict.xsl ../x/tutorial/strict/index.htm
    xsltproc
    -o ../tutorial/html5/index.html
    html5.xsl
    ../x/tutorial/html5/index.htm
    … and so on …

    Note how I use different XSL style-sheets to produce different DOCTYPES; strict.xsl or html5.xsl

    This works great but I have to update this batch file every time I add a new page to the site. Every time I update any of the source files (Which I can do on-line), I run the batch file which updates the whole site. If I add a new menu item to menu.xml and run the batch file, every output page is updated with the new menu item.

    It would be great to do this task dynamically so I do not need to update the batch file manually.

    The source folder (x) would have to be parsed to dynamically execute xsltproc based on the folder name:
    * Execute xsltproc
    * Pass the output argumant (-o ../folderName/index.html)
    * The style-sheet (either strict.xsl or html5.xsl); not sure how I’d do that dynamically yet (I might use a .xhtml extension (index.xhtml instead of index.htm for the source files) to differentiate strict from html5)
    * The source file argument (../x/folderName/index.htm)

    Dynamically capturing the folderNames within the x folder is my main challenge.

    Any heads-up on resolving this?

  11. in build script…. i dont want to concatination of my css file …..how can i do that…

    2)in html minification..i want to target my subfolder .html file…when i type ant build..it only compress index.html

    3)if i type ant .minigy…then i dont want to create publish folder..i want to override all file..please help

Leave a Reply

Your email address will not be published. Required fields are marked *