title: How to include a javascript from /js/ in jekyll
body: <p>I've added the cookie consent code from <a href="https://jekyllcodex.org/without-plugin/cookie-consent/" rel="nofollow noreferrer">here</a></p>
  
  <p>It has </p>
  
  <pre><code>&lt;script&gt;
  ...
  if(readCookie('cookie-notice-dismissed')=='true') {
      {% include ga.js %}
      {% include chatbutton.js %}
  }
  ...
  &lt;/script&gt;
  </code></pre>
  
  <p>in the html. This is placed within <code>_includes</code> but I can't figure out how to include javascript like <code>/js/foo.js</code>, located in another directory. I believe this is bundled with bundler within the jekyll assets.</p>
  
  <p>Up to now, I've added javascript on my layouts in the following way, but haven't used <code>{% include %}</code> for this yet and I don't know how to let the <code>_includes/cookie_consent.html</code> know ẁhere to find it.</p>
  
  <pre><code>&lt;script src="/js/foo.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $(function(){
          new Foo(".js-foo");
      });
  &lt;/script&gt;
  </code></pre>