title: Grunt usemin with templates
body: <p>Given the following directory structure:</p>
  
  <pre><code>– Gruntfile.js
  – app
      |– index.php
      |– js
      |– css
      |– templates
           |– template.php
  – dist
  </code></pre>
  
  <p>How can I configure grunt usemin to update the references to styles and scripts in my template file relative to the index.php which uses the template?</p>
  
  <p>currently the tasks look like this:</p>
  
  <pre><code>useminPrepare: {
      html: '&lt;%= yeoman.app %&gt;/templates/template.php',
      options: {
          dest: '&lt;%= yeoman.dist %&gt;'
      }
  },
  usemin: {
      html: ['&lt;%= yeoman.dist %&gt;/{,*/}*.php'],
      css: ['&lt;%= yeoman.dist %&gt;/css/*.css'],
      options: {
          dirs: ['&lt;%= yeoman.dist %&gt;']
      }
  }
  </code></pre>
  
  <p>And the blocks inside of the template look like this:</p>
  
  <pre><code>&lt;!-- build:js js/main.js --&gt;
      &lt;script src="js/script1.js"&gt;&lt;/script&gt;
      &lt;script src="js/script2.js"&gt;&lt;/script&gt;
  &lt;!-- endbuild --&gt;
  </code></pre>