dirkfabisch / mediator

a medium inspired jekyll theme
blog.base68.com
Other
811 stars 873 forks source link

Make possible to update to latest jQuery #78

Open tsouk opened 7 years ago

tsouk commented 7 years ago

Couldn't commit to a branch so I am suggesting these two changes:

--- a/_includes/javascripts.html
+++ b/_includes/javascripts.html
@@ -1,4 +1,4 @@
-<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
 <script type="text/javascript" src="{{ "/assets/js/jquery.fitvids.js" | prepend: site.baseurl  }}"></script>
 <script type="text/javascript" src="{{ "/assets/js/index.js" | prepend: site.baseurl  }}"></script>
 <script type="text/javascript" src="{{ "/assets/js/readingTime.min.js" | prepend: site.baseurl  }}"></script>
@@ -23,7 +23,7 @@
       var height = $('.article-image').height();
       $('.post-content').css('padding-top', height + 'px');

-      $('a[href*=#]:not([href=#])').click(function() {
+      $('a[href*=\\#]:not([href=\\#])').click(function() {
         if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
           var target = $(this.hash);

First one just as it is quite likely users will have that file. Second one because it is what made jQuery 3.2.1 (latest) fail when I loaded it.

Cheers! Nikos