js.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!-- BEGIN PAGE LEVEL SCRIPTS -->
  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. <!-- END PAGE LEVEL SCRIPTS -->
  16. <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
  17. <script src="{{ page | relative }}/dist/js/tabler{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer></script>
  18. <!-- END GLOBAL MANDATORY SCRIPTS -->
  19. <!-- BEGIN DEMO SCRIPTS -->
  20. <script src="{{ page | relative }}/preview/js/demo{% if environment != 'development' %}.min{% endif %}.js{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}" defer></script>
  21. <!-- END DEMO SCRIPTS -->
  22. {% for script in site.captured_global.scripts %}
  23. {{ script }}
  24. {% endfor %}
  25. {% for script in site.captured_once.scripts %}
  26. {{ script }}
  27. {% endfor %}
  28. {% assign libs = page-libs | default: layout.page-libs %}
  29. {% for lib in libs.js-files %}
  30. {% if libs contains lib[0] or libs.global-libs contains lib[0] %}
  31. {% for file in lib[1] %}
  32. {% assign filename = 'js/' | append: file | append: '.html' %}
  33. {% include "{{ filename }}" %}
  34. {% endfor %}
  35. {% endif %}
  36. {% endfor %}