Vimux / Mainroad

Responsive, simple, clean and content-focused Hugo theme based on the MH Magazine lite WordPress theme
https://mainroad-demo.netlify.app/
GNU General Public License v2.0
911 stars 459 forks source link

Is there any way to use locally placed jquery libs instead of cdn? #370

Closed spacedrone404 closed 3 months ago

spacedrone404 commented 3 months ago

I am trying to setup picture gallery viewer in a local manner, but not with a generic cdn. For eg i have following working code in header.html:

<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.0/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.0/jquery.fancybox.min.css" />

If i try something like with locally placed files:

<script src="assets/js/jquery-3.3.1.min.js"></script>
<script src="assets/js/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="assets/css/jquery.fancybox.min.css" />

code is simply not working, however the paths to files are correct by opinion of vscodium.

Tried to place files into static folder of the project and static folder of theme. Also tried

 customCSS = ["css/custom.css"] # Include custom CSS files
  customJS = ["js/custom.js"] # Include custom JS files

Can't get it working.

Any thoughts on this?

spacedrone404 commented 3 months ago

Also i find out that there is a thing related code in baseof.html:

<script async defer src="{{ "js/menu.js" | relURL }}"></script>
{{ range .Site.Params.customJS -}}
<script src="{{ . | relURL }}"></script>
{{- end }}

Currently is looking for solution.

Vimux commented 3 months ago

I do not provide free personal technical support.

As stated in CONTRIBUTING.md, please do not use the issue tracker for personal support. This includes any reports like “how to do this or that”; “everything broken, help me”; “I changed something, it doesn't work anymore”; “It's not a personal issue, I just want to ask how X or Y works”; “I forked your repository, then something broken, fix this immediately” and so on. The issue tracker is the preferred channel for bug reports, feature requests, and discussions that comply with our contributing rules, nothing more.