Skip to content

Commit

Permalink
Merge pull request h5bp#685 from drublic/master
Browse files Browse the repository at this point in the history
Prefixing CSS/JS resources automatically, idea from @drublic, technique from @darktable
  • Loading branch information
paulirish committed Aug 15, 2011
2 parents 2fb6ac3 + e1702af commit bf52178
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions build/build.xml
Expand Up @@ -517,9 +517,9 @@

<checksum file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" algorithm="sha" property="scripts.sha" />
<if>
<isset property="gae.js_dir" />
<isset property="js.prefix" />
<then>
<property name="scripts.js" value="${gae.js_dir}/${scripts.sha}.js" />
<property name="scripts.js" value="${js.prefix}/${scripts.sha}.js" />
</then>
<else>
<property name="scripts.js" value="${dir.js}/${scripts.sha}.js" />
Expand Down Expand Up @@ -901,9 +901,9 @@

<checksum file="${dir.intermediate}/${dir.css}/style-concat.min.css" algorithm="sha" property="css.sha" />
<if>
<isset property="gae.css_dir" />
<isset property="css.prefix" />
<then>
<property name="style.css" value="${gae.css_dir}/${css.sha}.css" />
<property name="style.css" value="${css.prefix}/${css.sha}.css" />
</then>
<else>
<property name="style.css" value="${dir.css}/${css.sha}.css" />
Expand Down
11 changes: 7 additions & 4 deletions build/config/project.properties
Expand Up @@ -74,12 +74,15 @@ env =
# dir.css
# dir.images

# Google App Engine Directory Structure
# Optional: Maintain custom prefix on concatenated files.
#
# Prevent "static/" being included in concated file paths.
# PHP:
# css.prefix = <?php echo base_url(); ?>css
# js.prefix = <?php echo base_url(); ?>js
#
# gae.css_dir = /css
# gae.js_dir = /js
# App Engine:
# css.prefix = /css
# js.prefix = /js

# Override default JSHint Options (see http://jshint.com/ for description of options)
#tool.jshint.opts =
Expand Down
8 changes: 4 additions & 4 deletions index.html
Expand Up @@ -22,9 +22,9 @@
<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->

<!-- CSS: implied media=all -->
<!-- CSS concatenated and minified via ant build script-->
<!-- CSS concatenated and minified via ant build script -->
<link rel="stylesheet" href="css/style.css">
<!-- end CSS-->
<!-- end CSS -->

<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->

Expand Down Expand Up @@ -56,10 +56,10 @@
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>


<!-- scripts concatenated and minified via ant build script-->
<!-- scripts concatenated and minified via ant build script -->
<script defer src="js/plugins.js"></script>
<script defer src="js/script.js"></script>
<!-- end scripts-->
<!-- end scripts -->


<!-- Change UA-XXXXX-X to be your site's ID -->
Expand Down

0 comments on commit bf52178

Please sign in to comment.