Skip to content

Replace jsDelivr w/ UNPKG #3234

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Replace jsDelivr w/ UNPKG #3234

wants to merge 1 commit into from

Conversation

SukkaW
Copy link

@SukkaW SukkaW commented Mar 15, 2025

Description

UNPKG has not been actively maintained and has been down since Mar 15, 2025 was down from Mar 15, 2025, 2:00 AM and down for 18 hours (unpkg/unpkg#412). Migrating to jsDelivr means a more stable and reliant service.

The PR replaces UNPKG usage with jsDelivr in the following places:

  • Docs
  • Previous blog articles
  • Demo and Templates

The unpkg.com usage inside the test cases are not replaced/modified.

Testing

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added the documentation Improvements or additions to documentation label Mar 17, 2025
@SukkaW
Copy link
Author

SukkaW commented Mar 31, 2025

UNPKG was down again from Mar 31, 2025, 7:00 AM UTC and lasted 8 hours (unpkg/unpkg#443), I urge everyone to immediately migrate away from unpkg to jsDelivr now.

@@ -7,7 +7,7 @@ tag = ["posts", "announcements"]

## Kutty 0.0.1 Release

I'm pleased to announce the [0.0.1 release](https://unpkg.com/browse/kutty.org@0.0.1/) of kutty, the successor
I'm pleased to announce the [0.0.1 release](https://cdn.jsdelivr.net/npm/browse/kutty.org@0.0.1/) of kutty, the successor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is erroring: Couldn't find the requested file /kutty.org@0.0.1/ in browse.

Actually, even unpkg is not finding it now. I suggest that we just don't touch the old release notes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let me drop those changes in the changelog.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yawaramin The PR has been rebased and updated.

Copy link
Contributor

@yawaramin yawaramin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. As a future improvement, I wonder if Zola has a way to factor out common blocks of Markdown and then include them. Could save a lot of duplication.

EDIT: duplication can be factored out with shortcodes, eg:

<!-- www/templates/shortcodes/htmx_js.html -->
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.js"
  integrity="sha384-oeUn82QNXPuVkGCkcrInrS1twIxKhkZiFfr2TdiuObZ3n3yIeMiqcRzkIcguaof1" crossorigin="anonymous"></script>

<!-- www/templates/shortcodes/htmx_min_js.html -->
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"
  integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script>

Usage:

<!-- www/content/docs.md -->

### Via A CDN (e.g. jsDelivr)

The fastest way to get going with htmx is to load it via a CDN. You can simply add this to
your head tag and get going:

```html
{{ htmx_min_js() }}

An unminified version is also available as well:

{{ htmx_js() }}

@SukkaW
Copy link
Author

SukkaW commented Apr 20, 2025

LGTM. As a future improvement, I wonder if Zola has a way to factor out common blocks of Markdown and then include them. Could save a lot of duplication.

EDIT: duplication can be factored out with shortcodes, eg:

<!-- www/templates/shortcodes/htmx_min_js -->

<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>

Usage:

<!-- README.md -->

## quick start

...
{{ htmx_min_js() }}

It looks like it belongs to a future PR, though. If you like, I can work on this once the PR is merged.

@yawaramin
Copy link
Contributor

Agreed!

@yawaramin
Copy link
Contributor

Just a thought...PR review might take a while. Within that time you may be able to just switch over to shortcodes for all the htmx script tags in the website code samples. Might make it a more compelling PR overall.

@SukkaW
Copy link
Author

SukkaW commented Apr 26, 2025

Just a thought...PR review might take a while. Within that time you may be able to just switch over to shortcodes for all the htmx script tags in the website code samples. Might make it a more compelling PR overall.

Sure, lemme see if I can do this.

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

Successfully merging this pull request may close these issues.

3 participants