how to includeJsFile in head instead of body I am using this code to include a js file, but it adds to the &lt;body&gt;:

{% includeJsFile '/path/script.min.js' %}


I need to add it to the &lt;head&gt; instead, how can I do?
You can use the getFootHtml function to tell Craft where to output HTML queued up with includeJsFile and includeJs. You'd normally have that tag somewhere at the end of your &lt;body&gt;. But all it does is to get all queued up HTML and output it, so if your JS are already "included", you can use it in &lt;head&gt;.

Another thing you could do is to not use the includeJsFile function to add the HTML to the &lt;head&gt;, but use a different approach. Here's an example using a var and an example using a dedicated Twig block:

index.html

{% extends 'base.html' %}

{% set headHtml = '&lt;script src="{{ url('assets/javascripts/myscript.js') }}"&gt;&lt;/script&gt;' %}

{% block head %}
    {{ parent() }}

    &lt;!-- Scripts --&gt;
    &lt;script src="{{ url('assets/javascripts/myscript.js') }}"&gt;&lt;/script&gt;
{% endblock %}


base.html

&lt;head&gt;
    {% block head %}
        &lt;!-- Document head --&gt;
        &lt;meta charset="utf-8"&gt;

        {% if headHtml is defined %}
            &lt;!-- Scripts --&gt;
            {{ headHtml }}
        {% endif %}
    {% endblock %}
&lt;/head&gt;