nfreear / nfreear-blog

My (re-developed) personal blog. A work-in-progress! —
https://nick.freear.org.uk
MIT License
0 stars 1 forks source link

Javascript fixes / "performance" #17

Open nfreear opened 9 years ago

nfreear commented 9 years ago
Nick@~/workspace/nfreear.github.io (master>)$ git diff
diff --git a/_includes/footer-javascript.html b/_includes/footer-javascript.html
index 04a191f..092b2e9 100644
--- a/_includes/footer-javascript.html
+++ b/_includes/footer-javascript.html
@@ -3,15 +3,19 @@
  id="js-config"
 {% for cfg in site.js_config %} data-{{ cfg[0] }}={{ cfg[1] | jsonify }}{% endfor %}
  data-post_title={{ page.title | jsonify }}
- data-post_id={{ page.id | jsonify }}
+ data-post_id="{{ page.id | slugify }}"
  data-post_count="{{ site.posts | size | jsonify }}"
  data-site_time={{ site.time | jsonify }}
 ></div>

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
-{% if page.url != '/index.html' %}
+{% case page.url %}
+{% when '/index.html' or '/tag/' or '/search/' %}
+<!--no-embed-->
+{% else %}
 <script src="http://embed.open.ac.uk/scripts/jquery.oembed.js"></script>
-{% endif %}
+{% endcase %}
+<!--page.url: {{ page.url }} -->
 <script src="/js/main.js"></script>

 {% if site.ex_comments and page.excerpt %}
diff