Step 1, create a new file named YourScript.js
in the site directory.
Step 2, write the following code in the YAML of the Markdown document.
---
title: YourTitle
customjs:
- https://yoursite/yourscript.js
---
Step 3, introduce JavaScript into Markdown.
{% for js in page.customjs %}
<script src="{{ js }}"></script>
{% endfor %}
Category
Markdown