Note that there are some explanatory texts on larger screens.

plurals
  1. PONanoc + Bower = Error - Found 2 content files for
    text
    copied!<p>I'm using nanoc to generate an static site.</p> <p>Recently I added <a href="https://github.com/twitter/bower" rel="nofollow">Bower</a> to manage front end dependencies.</p> <p>When I add Bootstrap via Bower I place the package in <code>/assets/bower/</code></p> <p>The Bootstrap package contains multiple files, including:</p> <pre><code>bootstrap/js/tests/vendor/qunit.css bootstrap/js/tests/vendor/qunit.js </code></pre> <p>My <code>Rules</code> file has these rules:</p> <pre><code>route '/assets/*' do extension = item[:extension] if extension == 'coffee' extension = 'js' end item.identifier.chop + '.' + extension end compile '*', :rep =&gt; :spec do if !item[:spec_files].nil? &amp;&amp; !item.binary? filter :erb layout 'spec' end end route '*', :rep =&gt; :spec do if !item[:spec_files].nil? &amp;&amp; !item.binary? '/specs' + @item.identifier[0..-2] + '.html' end end compile '*' do if !item.binary? filter :erb layout_name = item[:layout] || 'default' layout layout_name end end route '*' do if item.binary? item.identifier.chop + '.' + item[:extension] else item.identifier[0..-2] + '.html' end end </code></pre> <p>When running <code>nanoc</code> I get the following error:</p> <pre><code> RuntimeError: Found 2 content files for content/assets/bower/bootstrap/js/tests/vendor/qunit; expected 0 or 1 </code></pre> <p>I tried adding 2 new 'empty' rules for the /assets/bower/ folder but still getting the error.</p> <pre><code>route '/assets/bower/*' do end compile '/assets/bower/*' do end </code></pre> <p>Any suggestions?</p> <p><strong>Later edit:</strong></p> <p>Looks like nanoc supports a static datasource that also takes in consideration the file extension.</p> <p><a href="https://github.com/nanoc/nanoc-site/blob/master/content/docs/troubleshooting.md" rel="nofollow">https://github.com/nanoc/nanoc-site/blob/master/content/docs/troubleshooting.md</a></p> <p>Still not sure if I can use both data sources in parallel.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload