How to make CSS and Javascript 302-redirect a direct path

Solved

How to make CSS and Javascript 302-redirect a direct path

WoutervdMeer
Shopify Partner
85 1 15

Hi there,

 

My website is: https://www.biervaneigenbodem.nl/

 

I have used the following tutorial to built a product slider using Flickity: https://pastebin.com/vBiVPqyD 

Currently, the links from this tutorial in the theme.liquid file direct to an external online css and javascript file.

 

Using the following code

How can I avoid this and insert the css and javascript files completely into my Shopify store?

For example by creating the files: flickity.min.css and flickity.pkgd.min.js

The 302 redirect has an effect on the loading speed of my webshop so that is why I want to remove it.

 

Looking forward to the answers guys.

 

kind regards,

Wouter vd Meer

Kind regards,
Wouter van der Meer
info@biervaneigenbodem.nl
https://www.biervaneigenbodem.nl/
Accepted Solution (1)

GabrielS
Shopify Partner
486 107 115

This is an accepted solution.

Hi,

 

You can download the reference JS/CSS files and upload it to your website by navigating to Edit Code -> Assets section.

 

Your liquid code would be similar to the following:

<link rel="stylesheet" href="{{ 'flickity.min.css' | asset_url }}">
<script src="{{ 'flickity.pkgd.min.js' | asset_url }}"></script>

 

 

Cheers!

 

 

Gabriel Soare | Web Developer
Are you looking to customize your Shopify or to fix a website bug?
You can reach me through my website gabrielsoare.com, DM, or email hello@gabrielsoare.com.
Have I helped you? Like my post.

View solution in original post

Reply 1 (1)

GabrielS
Shopify Partner
486 107 115

This is an accepted solution.

Hi,

 

You can download the reference JS/CSS files and upload it to your website by navigating to Edit Code -> Assets section.

 

Your liquid code would be similar to the following:

<link rel="stylesheet" href="{{ 'flickity.min.css' | asset_url }}">
<script src="{{ 'flickity.pkgd.min.js' | asset_url }}"></script>

 

 

Cheers!

 

 

Gabriel Soare | Web Developer
Are you looking to customize your Shopify or to fix a website bug?
You can reach me through my website gabrielsoare.com, DM, or email hello@gabrielsoare.com.
Have I helped you? Like my post.