Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jquery/scripts from hasper #29

Open
dencold opened this issue Jan 13, 2017 · 0 comments
Open

Remove jquery/scripts from hasper #29

dencold opened this issue Jan 13, 2017 · 0 comments

Comments

@dencold
Copy link
Owner

dencold commented Jan 13, 2017

Linked into every page on the hasper theme is this partial include:

  {{partial "scripts.html" .}}

Which comprises of these three script tags:

<script type="text/javascript" src="{{.Site.BaseURL}}js/jquery.js"></script>
<script type="text/javascript" src="{{.Site.BaseURL}}js/jquery.fitvids.js"></script>
<script type="text/javascript" src="{{.Site.BaseURL}}js/index.js"></script>

Adding around 200ms of load time to the page on a 4g device:
image

The only thing we use all the jquery code for is some smooth scrolling to jump from the cover page down to the content:

$.fn.arctic_scroll = function (options) {

Definitely not worth all that load.

Look to replace this with a simple function that achieves the same functionality and drops the jquery requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant