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.
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.
Basically:
<body>
...page content...
<script src="/assets/js/myscript.js" type="text/javascript" async=""></script>
...page content...
</body>
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?