diff --git a/docs/.eleventy.js b/docs/.eleventy.js index c5f2a9fc7..fe807b788 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -40,7 +40,7 @@ export default function (eleventyConfig) { // Shortcodes - {% shortCode arg1, arg2 %} eleventyConfig.addShortcode('cdnUrl', location => { - return `https://early.webawesome.com/webawesome@${packageData.version}/` + location.replace(/^\//, ''); + return `https://early.webawesome.com/webawesome@${packageData.version}/dist/` + location.replace(/^\//, ''); }); // Helpers diff --git a/docs/assets/scripts/code-examples.js b/docs/assets/scripts/code-examples.js index 0347bc21c..b64ae12ee 100644 --- a/docs/assets/scripts/code-examples.js +++ b/docs/assets/scripts/code-examples.js @@ -16,12 +16,9 @@ document.addEventListener('click', event => { const codeExample = pen.closest('.code-example'); const code = codeExample.querySelector('code'); const cdnUrl = document.documentElement.dataset.cdnUrl; - const html = - `` + `\n\n` + `${code.textContent}`; + const html = `` + `\n\n` + `${code.textContent}`; const css = - `import '${cdnUrl}/dist/themes/default.css';` + - `\n\n` + - `body {\n font: 16px sans-serif;\n padding: 1rem;\n}\n`; + `import '${cdnUrl}themes/default.css';` + `\n\n` + `body {\n font: 16px sans-serif;\n padding: 1rem;\n}\n`; const js = ''; const form = document.createElement('form'); diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 8e43bd2ba..f894c88be 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -26,8 +26,8 @@ As a Web Awesome backer, this early alpha release is _just for you_. Please refr The autoloader is the easiest way to use Web Awesome. A lightweight script watches the DOM for unregistered Web Awesome elements and lazy loads them for you — even if they're added dynamically. ```html - - + + ``` Now you can [start using Web Awesome!](/getting-started/usage) diff --git a/docs/docs/localization.md b/docs/docs/localization.md index 394cef22a..64996828f 100644 --- a/docs/docs/localization.md +++ b/docs/docs/localization.md @@ -57,7 +57,7 @@ Available translations include: You can import translations using the following syntax, where `` is replaced with any language code shown above. ```js -import '{% cdnUrl "dist/translations/.js" %}'; +import '{% cdnUrl "translations/.js" %}'; ``` You do not need to load translations up front. You can import them dynamically even after updating the `lang` attribute. Once a translation is registered, localized components will update automatically. @@ -67,7 +67,7 @@ You do not need to load translations up front. You can import them dynamically e document.documentElement.lang = 'de'; // Import the translation -import('/path/to/shoelace/dist/translations/de.js'); +import('{% cdnUrl "translations/.js" %}'); ``` ### Translation Resolution