Allow <head> and footer scripts to be changed via config (#1241)

* Allow `<head>` and footer scripts to be changed via config
* Update JavaScript documentation

Close #1238
This commit is contained in:
Michael Rose
2017-09-12 12:27:36 -04:00
committed by GitHub
parent 93c4fbc4b9
commit 8fc9bccda8
8 changed files with 83 additions and 7 deletions

View File

@ -29,4 +29,15 @@
height: 100%;
}
</style>
<![endif]-->
<![endif]-->
{% if site.head_scripts %}
{% for script in site.head_scripts %}
{% if script contains "://" %}
{% capture script_path %}{{ script }}{% endcapture %}
{% else %}
{% capture script_path %}{{ script | absolute_url }}{% endcapture %}
{% endif %}
<script src="{{ script_path }}"></script>
{% endfor %}
{% endif %}

View File

@ -1,4 +1,15 @@
<script src="{{ '/assets/js/main.min.js' | absolute_url }}"></script>
{% if site.footer_scripts %}
{% for script in site.footer_scripts %}
{% if script contains "://" %}
{% capture script_path %}{{ script }}{% endcapture %}
{% else %}
{% capture script_path %}{{ script | absolute_url }}{% endcapture %}
{% endif %}
<script src="{{ script_path }}"></script>
{% endfor %}
{% else %}
<script src="{{ '/assets/js/main.min.js' | absolute_url }}"></script>
{% endif %}
{% include analytics.html %}
{% include /comments-providers/scripts.html %}