I have a layout file that appends the jQuery CDN at the bottom for all .html.haml
files. The layout file adds the jQuery CDN after all the html elements have been rendered.
One of my .html.haml
files will have an additional js file that uses jQuery; however, it needs to see the jQuery CDN loaded first.
How can I tell Middleman that during compile time, append the js file for this specific .html.haml
file only?
Here’s my layout file:
!!! 5
%html{lang: 'en'}
%head
%body{class: current_page.data.body_class || 'page'}
= yield
// jQuery
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"
//I need to insert my js file here, but only for a specific HTML file.
P.S. Also, I need to place the jQuery at the bottom of the file to make rendering more efficient, so I can’t place it in the head
.