title: How to load an external script for a Jekyll page?
body: <p>I'm building a Jekyll site on GitHub Pages. I have a particular page that needs a small bit of JavaScript. The header and body tags of this page are controlled by the theme I am using. I would like to maintain this JavaScript in an external script file rather than using raw script in the middle of my page.</p>
  
  <p>Given modern web technology, is there any major gotcha to simply using an async script tag to load the file? This tag would appear inside the body content once the page is generated, but as far as I can tell the recommendation to not load external scripts in the body originally came from loading speed concerns and is somewhat no longer valid with async. The script is small and controls non-critical functionality.</p>
  
  <p>Basically:</p>
  
  <pre><code>&lt;body&gt;
    ...page content...
    &lt;script src="/assets/js/myscript.js" type="text/javascript" async=""&gt;&lt;/script&gt;
    ...page content...
  &lt;/body&gt;
  </code></pre>
  
  <p>I could override the theme layout to access the header directly and do this more traditionally, but I'd like to avoid that if possible. Is there another recommendation for using small one-off scripts with Jekyll?</p>