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

How to remove all dependencies from cdn.jsdelivr.net? #263

Closed
kazukyakayashi opened this issue Jul 11, 2021 · 3 comments
Closed

How to remove all dependencies from cdn.jsdelivr.net? #263

kazukyakayashi opened this issue Jul 11, 2021 · 3 comments

Comments

@kazukyakayashi
Copy link

kazukyakayashi commented Jul 11, 2021

Hello 😊
I tried to remove all dependencies to cdn.jsdelivr.net but I can't do it, I don't understand how to stop using cdn.jsdelivr.net, often working on my blog in the train (without internet) or in the country (where the connection is very bad) and for obvious privacy reasons
I tried to put the links of the .js and the .css (locally in the theme folder static/js and static/css) in /layouts/header/custom.html it works.

<!-- CSS -->
<link rel="stylesheet" type="text/css" href='{{ "css/default-skin.css" | absURL }}' />
<link rel="stylesheet" type="text/css" href='{{ "css/katex.min.css" | absURL }}' />
<link rel="stylesheet" type="text/css" href='{{ "css/photoswipe.css" | absURL }}' />

<!-- Scripts -->
<script type="application/javascript" src='{{ "js/vibrant.min.js" | absURL }}'></script>
<script type="application/javascript" src='{{ "js/photoswipe-ui-default.min.js" | absURL }}'></script>
<script type="application/javascript" src='{{ "js/photoswipe.min.js" | absURL }}'></script>
<script type="application/javascript" src='{{ "js/auto-render.min.js" | absURL }}'></script>
<script type="application/javascript" src='{{ "js/katex.min.js" | absURL }}'></script>

I also don't understand how to remove the external.yaml file which is useless for me since I have the scripts and the css in the theme folder.

Thanks 😉

@CaiJimmy
Copy link
Owner

Search the usage of helper/external inside the codebase, and replace them with your <script> tag should do the job.

@kazukyakayashi
Copy link
Author

👍

@FarisZR
Copy link
Contributor

FarisZR commented Jul 5, 2022

For anyone searching for this issue,
I created a module to remove all CDN links from Stack, except Cactus.
Its fully automated and will check for updates from upstream daily.
https://github.com/FarisZR/Hugo-stack-no-cdn

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

3 participants