js-libs.html 695 B

12345678910111213141516171819
  1. {% if page-libs -%}
  2. {% capture libs-code -%}
  3. {% for lib in libs -%}
  4. {% if page-libs contains lib[0] and lib[1].head == include.head -%}
  5. {% for file in lib[1].js -%}
  6. <script src="{% if file contains 'http://' or file contains 'https://' %}{{ file | replace: 'GOOGLE_MAPS_KEY', google-maps-key }}{% else %}{{ page | relative }}/dist/libs/{{ lib[1].npm }}/{{ file }}{% if environment != 'development' %}?{{ 'now' | date: '%s' }}{% endif %}{% endif %}" defer></script>
  7. {% endfor -%}
  8. {% endif -%}
  9. {% endfor -%}
  10. {% endcapture -%}
  11. {% assign libs-code = libs-code | strip -%}
  12. {% if libs-code != "" -%}
  13. <!-- BEGIN PAGE LIBRARIES -->
  14. {{ libs-code }}
  15. <!-- END PAGE LIBRARIES -->
  16. {% endif -%}
  17. {% endif -%}