title: Trouble Linking External JavaScript with Jekyll
body: <p>I have a site hosted by GitHub Pages that uses Jekyll, and I've been successfully using an internally defined script in each layout that will generate a random tagline from an array of them.</p>
  <p>I'm trying to move this script to an external <code>tagline.js</code>, but so far I've been unsuccessful.</p>
  <p>Here's the basic tagline generating script, in case there's something in the code causing this (which I doubt, honestly, due to its simplicity; but it's always a possibility):</p>
  <pre class="lang-js prettyprint-override"><code>var tags = [ 'tag1', 'tag2', 'tag3' ];
  
  function getTag() {
      return tags[Math.floor(Math.random() * tags.length)];
  }
  
  $(document).ready(function() {
      $(&quot;#tagline&quot;).text(getTag());
  });
  </code></pre>
  <p>Like I said, it works fine when it's internal, but it doesn't when I try linking to external. I'm pretty sure it's just a case of where I'm pointing the <code>&lt;script&gt;</code> to: the HTML file containing the <code>&lt;script&gt;</code> is in <code>_layouts/default.html</code>, but the script is in <code>scripts/tagline.js</code>:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script type=&quot;text/javascript&quot; href=&quot;../scripts/tagline.js&quot;&gt;&lt;/script&gt;
  </code></pre>