works with a 24 second docs refresh 😕

This commit is contained in:
Cory LaViska
2023-06-06 09:21:07 -04:00
parent de5ad1b1b9
commit b8b6175a64
8 changed files with 2267 additions and 130 deletions

View File

@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html
lang="en"
<html
lang="en"
data-layout="{{ layout }}"
data-shoelace-version="{{ meta.version }}"
>
@@ -31,9 +31,9 @@
<meta property="og:image" content="{{ assetUrl(meta.image, true) }}" />
{# Shoelace #}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/themes/light.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/themes/dark.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/shoelace-autoloader.js"></script>
<link rel="stylesheet" href="/dist/themes/light.css" />
<link rel="stylesheet" href="/dist/themes/dark.css" />
<script type="module" src="/dist/shoelace-autoloader.js"></script>
{# Set the initial theme and menu states here to prevent flashing #}
<script>
@@ -101,7 +101,7 @@
</sl-button>
<sl-button size="small" class="repo-button repo-button--twitter" href="https://twitter.com/shoelace_style" target="_blank">
<sl-icon slot="prefix" name="twitter"></sl-icon> Follow
</sl-button>
</sl-button>
</div>
<button class="search-box" type="button" title="Press / to search" aria-label="Search" data-plugin="search">
@@ -125,7 +125,7 @@
</ul>
</div>
{% endif %}
<div class="content__body">
{% block content %}
{{ content | safe }}

View File

@@ -1,7 +1,4 @@
//
// TODO - switch to local dist
//
const customElementsManifest = require('@shoelace-style/shoelace/dist/custom-elements.json');
const customElementsManifest = require('../../dist/custom-elements.json');
//
// Export it here so we can import it elsewhere and use the same version
@@ -42,17 +39,17 @@ module.exports.getAllComponents = function () {
});
// Build dependency graphs
allComponents.map(component => {
allComponents.forEach(component => {
const dependencies = [];
// Recursively fetch sub-dependencies
function getDependencies(tag) {
const component = allComponents.find(c => c.tagName === tag);
if (!component || !Array.isArray(component.dependencies)) {
const cmp = allComponents.find(c => c.tagName === tag);
if (!cmp || !Array.isArray(component.dependencies)) {
return;
}
component.dependencies?.forEach(dependentTag => {
cmp.dependencies?.forEach(dependentTag => {
if (!dependencies.includes(dependentTag)) {
dependencies.push(dependentTag);
}

View File

@@ -685,7 +685,7 @@ If you want to change the icons Shoelace uses internally, you can register an ic
item.setAttribute('data-terms', [i.name, i.title, ...(i.tags || []), ...(i.categories || [])].join(' '));
item.innerHTML = `
<svg width="1em" height="1em" fill="currentColor">
<use xlink:href="/assets/icons/sprite.svg#${i.name}"></use>
<use xlink:href="/assets/images/sprite.svg#${i.name}"></use>
</svg>
`;
list.appendChild(item);