mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
update cdn to jsdelivr for public pens
This commit is contained in:
@@ -227,7 +227,11 @@ export default async function (eleventyConfig) {
|
||||
|
||||
// Shortcodes - {% shortCode arg1, arg2 %}
|
||||
eleventyConfig.addShortcode('cdnUrl', location => {
|
||||
return `https://early.webawesome.com/webawesome@${packageData.version}/dist/` + (location || '').replace(/^\//, '');
|
||||
// We use WA (free) via the public CDN for CodePen examples
|
||||
return (
|
||||
`https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@${packageData.version}/dist-cdn/` +
|
||||
(location || '').replace(/^\//, '')
|
||||
);
|
||||
});
|
||||
|
||||
// Turns `{% server "foo" %} into `{{ server.foo | safe }}` when the WEBAWESOME_SERVER variable is set to "true"
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<link rel="stylesheet" href="/dist/styles/webawesome.css" />
|
||||
|
||||
<script type="module">
|
||||
document.addEventListener("wa-discovery-complete", loadLayout)
|
||||
document.addEventListener('wa-discovery-complete', loadLayout)
|
||||
function loadLayout () {
|
||||
if (!customElements.get("wa-layout")) {
|
||||
import("{% cdnUrl 'components/page/page.js' %}")
|
||||
if (!customElements.get('wa-page')) {
|
||||
import('https://early.webawesome.com/webawesome@3.0.0-beta.6/dist/components/page/page.js')
|
||||
.catch((e) => {
|
||||
// known errors with dual registration. This is only a thing in the free repo.
|
||||
// known errors with dual registration. This is only a thing in the free repo.
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user