js.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!-- Libs JS -->
  2. {% assign google-maps-key = site.googleMapsDevKey -%}
  3. {% if environment != 'development' -%}
  4. {% assign google-maps-key = site.googleMapsKey -%}
  5. {% endif -%}
  6. {% if page-libs -%}
  7. {% for lib in libs.js -%}
  8. {% if page-libs contains lib[0] or libs.global-libs contains lib[0] -%}
  9. {% for file in lib[1] -%}
  10. <script src="{% if file contains 'http://' or file contains 'https://' %}{{ file | replace: 'GOOGLE_MAPS_KEY', google-maps-key }}{% else %}{{ page | relative }}/libs/{% if environment != 'development' %}{{ file | replace: '@', '' }}{% else %}{{ file }}{% endif %}{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}{% endif %}" defer></script>
  11. {% endfor -%}
  12. {% endif -%}
  13. {% endfor -%}
  14. {% endif -%}
  15. <!-- Tabler Core -->
  16. <script src="{{ page | relative }}/dist/js/tabler{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer></script>
  17. <script src="{{ page | relative }}/preview/js/demo{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer></script>
  18. {% for script in site.captured_global.scripts %}
  19. {{ script }}
  20. {% endfor %}
  21. {% for script in site.captured_once.scripts %}
  22. {{ script }}
  23. {% endfor %}
  24. {% assign libs = page-libs | default: layout.page-libs %}
  25. {% for lib in libs.js-files %}
  26. {% if libs contains lib[0] or libs.global-libs contains lib[0] %}
  27. {% for file in lib[1] %}
  28. {% assign filename = 'js/' | append: file | append: '.html' %}
  29. {% include "{{ filename }}" %}
  30. {% endfor %}
  31. {% endif %}
  32. {% endfor %}