fix: fixed demos

This commit is contained in:
Pavlik Kiselev 2025-10-05 12:35:39 +02:00 committed by Thijs Louisse
parent 5af3c24248
commit 890cd49895
3 changed files with 15 additions and 6 deletions

View file

@ -19,12 +19,15 @@ if (!entry) {
}
const { remarkPluginFrontmatter } = await render(entry);
const importPath = `${remarkPluginFrontmatter.mdjsStoriesPath}`;
const loadDemoAttributes = {};
if (remarkPluginFrontmatter.mdjsStoriesPath) {
loadDemoAttributes['data-import-path'] = remarkPluginFrontmatter.mdjsStoriesPath;
}
---
<InPageNavLayout entry={entry}>
<load-demo ?data-import-path={importPath}></load-demo>
<load-demo {...loadDemoAttributes}></load-demo>
<script>
class LoadDemo extends HTMLElement {

View file

@ -20,12 +20,15 @@ if (!entry) {
}
const { remarkPluginFrontmatter } = await render(entry);
const importPath = `${remarkPluginFrontmatter.mdjsStoriesPath}`;
const loadDemoAttributes = {};
if (remarkPluginFrontmatter.mdjsStoriesPath) {
loadDemoAttributes['data-import-path'] = remarkPluginFrontmatter.mdjsStoriesPath;
}
---
<InPageNavLayout entry={entry}>
<load-demo ?data-import-path={importPath}></load-demo>
<load-demo {...loadDemoAttributes}></load-demo>
<script>
class LoadDemo extends HTMLElement {

View file

@ -20,11 +20,14 @@ if (!entry) {
}
const { remarkPluginFrontmatter } = await render(entry);
const importPath = `${remarkPluginFrontmatter.mdjsStoriesPath}`;
const loadDemoAttributes = {};
if (remarkPluginFrontmatter.mdjsStoriesPath) {
loadDemoAttributes['data-import-path'] = remarkPluginFrontmatter.mdjsStoriesPath;
}
---
<InPageNavLayout entry={entry}>
<load-demo ?data-import-path={importPath}></load-demo>
<load-demo {...loadDemoAttributes}></load-demo>
<script>
class LoadDemo extends HTMLElement {