Skip to content

Commit

Permalink
DOC: clarify JS usage in derived themes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Oct 9, 2020
1 parent 678e817 commit 6b03192
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,16 @@ Similarly, you can add further custom CSS files, if you want.
But this will increase the load time of the HTML pages!

If you want to use custom JavaScript files,
store them in the :file:`static` sub-directory and add something like this
to your :file:`layout.html` template:
store them in the :file:`static` sub-directory of your theme directory
(they will automatically be copied into the :file:`_static` sub-directory
of the HTML output directory)
and add something like this to your :file:`layout.html` template:

.. code-block:: html+jinja

{% block scripts %}
{{ super() }}
<script defer src="{{ pathto('_static/insipid.js', 1) }}"></script>
<script defer src="{{ pathto('_static/my-script.js', 1) }}"></script>
{% endblock %}

If you want your JavaScript code to be available during page load,
Expand Down

0 comments on commit 6b03192

Please sign in to comment.