From dacac74d31c94936b2d124f21f0514c54c46065e Mon Sep 17 00:00:00 2001 From: Maruan Al-Shedivat Date: Sat, 26 Sep 2020 12:26:28 -0400 Subject: [PATCH] Fix issues with loading scripts (#117) --- _config.yml | 2 +- _includes/head.html | 79 +++++--------------------------- _includes/scripts/bootstrap.html | 4 ++ _includes/scripts/jquery.html | 2 + _includes/scripts/mansory.html | 6 +++ _includes/scripts/mathjax.html | 5 ++ _includes/scripts/misc.html | 22 +++++++++ _layouts/default.html | 6 +++ _layouts/distill.html | 1 + assets/js/mansory.js | 12 +++++ 10 files changed, 71 insertions(+), 68 deletions(-) create mode 100644 _includes/scripts/bootstrap.html create mode 100644 _includes/scripts/jquery.html create mode 100644 _includes/scripts/mansory.html create mode 100644 _includes/scripts/mathjax.html create mode 100644 _includes/scripts/misc.html create mode 100644 assets/js/mansory.js diff --git a/_config.yml b/_config.yml index a627c94..ca85ac3 100644 --- a/_config.yml +++ b/_config.yml @@ -168,7 +168,7 @@ fontawesome: integrity: "sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" jquery: version: "3.5.1" - integrity: "sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" + integrity: "sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" mathjax: version: "3.1.2" mansory: diff --git a/_includes/head.html b/_includes/head.html index 02b7a0a..13cb2a5 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -5,25 +5,6 @@ {% if site.title == blank %}{{ site.title }}{% else %}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{% endif %}{% if page.title and page.url != "/" %} | {{ page.title }}{% endif %} - - - - - - - - - - - - - - - - - - - {% if site.serve_og_meta %} @@ -34,56 +15,20 @@ {% endif %} - - + + + + + + + + -{% if site.enable_math %} - - - -{% endif %} + + + -{% if site.enable_mansory %} - - - - - - -{% endif %} - -{% if site.enable_tooltips %} - - -{% endif %} - -{% if site.enable_google_analytics %} - - -{% endif %} + diff --git a/_includes/scripts/bootstrap.html b/_includes/scripts/bootstrap.html new file mode 100644 index 0000000..2c5d4ee --- /dev/null +++ b/_includes/scripts/bootstrap.html @@ -0,0 +1,4 @@ + + + + diff --git a/_includes/scripts/jquery.html b/_includes/scripts/jquery.html new file mode 100644 index 0000000..8de7788 --- /dev/null +++ b/_includes/scripts/jquery.html @@ -0,0 +1,2 @@ + + diff --git a/_includes/scripts/mansory.html b/_includes/scripts/mansory.html new file mode 100644 index 0000000..5a93a9e --- /dev/null +++ b/_includes/scripts/mansory.html @@ -0,0 +1,6 @@ +{% if site.enable_mansory %} + + + + +{% endif %} diff --git a/_includes/scripts/mathjax.html b/_includes/scripts/mathjax.html new file mode 100644 index 0000000..c8d7392 --- /dev/null +++ b/_includes/scripts/mathjax.html @@ -0,0 +1,5 @@ +{% if site.enable_math %} + + + +{% endif %} diff --git a/_includes/scripts/misc.html b/_includes/scripts/misc.html new file mode 100644 index 0000000..aa02967 --- /dev/null +++ b/_includes/scripts/misc.html @@ -0,0 +1,22 @@ +{% if site.enable_tooltips %} + + +{% endif %} + +{% if site.enable_google_analytics %} + + +{% endif %} + + + diff --git a/_layouts/default.html b/_layouts/default.html index 4487e15..bde7acc 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -3,6 +3,7 @@ {% include head.html %} + {% include scripts/mathjax.html %} @@ -23,4 +24,9 @@ + {% include scripts/jquery.html %} + {% include scripts/bootstrap.html %} + {% include scripts/mansory.html %} + {% include scripts/misc.html %} + diff --git a/_layouts/distill.html b/_layouts/distill.html index 1e01aee..23995a0 100644 --- a/_layouts/distill.html +++ b/_layouts/distill.html @@ -2,6 +2,7 @@ {% include head.html %} + {% include scripts/mathjax.html %} {% if page._styles %} diff --git a/assets/js/mansory.js b/assets/js/mansory.js new file mode 100644 index 0000000..054f3a0 --- /dev/null +++ b/assets/js/mansory.js @@ -0,0 +1,12 @@ +$(document).ready(function() { + // Init Masonry + var $grid = $('.grid').masonry({ + gutter: 10, + horizontalOrder: true, + itemSelector: '.grid-item', + }); + // Layout Masonry after each image loads + $grid.imagesLoaded().progress( function() { + $grid.masonry('layout'); + }); +});