Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions docs/src/.vitepress/components/DynamicLayout.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<script setup>
import { useRoute } from 'vitepress';
import DefaultTheme from 'vitepress/theme';
import ExampleLayout from './ExampleLayout.vue';
import { useRoute } from "vitepress";
import DefaultTheme from "vitepress/theme";
import ExampleLayout from "./ExampleLayout.vue";
import FooterLogo from "../components/FooterLogo.vue";
import { h } from "vue";

const route = useRoute();
if (route.path.startsWith('/craft/examples')) {

if (route.path.startsWith("/examples")) {
DefaultTheme.Layout = ExampleLayout;
} else {
DefaultTheme.Layout = h(DefaultTheme.Layout, null, {
"aside-bottom": () => h(FooterLogo),
});
}
</script>

Expand Down
22 changes: 11 additions & 11 deletions docs/src/.vitepress/components/ExampleLayout.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<script setup>
import { onMounted, ref } from 'vue';
import { onMounted, ref } from "vue";

const el = ref();

onMounted(() => {
document.querySelectorAll('head style, head link, head script').forEach((extra) => {
document.querySelectorAll("head style, head link, head script").forEach((extra) => {
extra.remove();
});
import('/public/examples/.vite/manifest.json').then((manifest) => {
import("/public/examples/.vite/manifest.json").then((manifest) => {
// use code
const linkTag = document.createElement('link');
linkTag.rel = 'stylesheet';
linkTag.href = '../examples/' + manifest.default['frontend/js/site.ts'].css;
document.head.insertAdjacentElement('beforeend', linkTag);
const linkTag = document.createElement("link");
linkTag.rel = "stylesheet";
linkTag.href = "../examples/" + manifest.default["frontend/js/site.ts"].css;
document.head.insertAdjacentElement("beforeend", linkTag);

const scriptTag = document.createElement('script');
scriptTag.src = '../examples/' + manifest.default['frontend/js/site.ts'].file;
scriptTag.type = 'module';
document.head.insertAdjacentElement('beforeend', scriptTag);
const scriptTag = document.createElement("script");
scriptTag.src = "../examples/" + manifest.default["frontend/js/site.ts"].file;
scriptTag.type = "module";
document.head.insertAdjacentElement("beforeend", scriptTag);
});
});
</script>
Expand Down
28 changes: 13 additions & 15 deletions docs/src/.vitepress/components/FooterLogo.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<template>
<div class="footer-logo">
<div>Brought to you by:</div>
<a
href="https://www.statik.be"
target="_blank"
rel="noopener"
>
<img
src="./../../images/logo.svg"
alt=""
/>
<a href="https://www.statik.be" target="_blank" rel="noopener">
<img src="./../../images/logo.svg" alt="" />
</a>
</div>
</template>

<script setup>
</script>
<script setup></script>

<style scoped>


.footer-logo {
font-size: 0.8rem;
div {
Expand All @@ -29,10 +19,18 @@
}

.footer-logo img {
/* background-color: #fff;
padding-inline: 0.4rem; */
box-sizing: border-box;
max-width: 200px;
height: 80px;
display: block;
margin: 0 auto;
margin: 0.4rem auto 0;
}

.dark {
.footer-logo img {
filter: brightness(0) invert(1);
}
}
</style>
</style>
18 changes: 5 additions & 13 deletions docs/src/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import Theme from 'vitepress/theme'
import './style.css';
import DynamicLayout from '../components/DynamicLayout.vue';
import FooterLogo from '../components/FooterLogo.vue';
import {h} from "vue";
import type { Theme } from "vitepress";
import "./style.css";
import DynamicLayout from "../components/DynamicLayout.vue";

export default {
...Theme,
Layout() {
return h(Theme.Layout, null, {
'aside-bottom': () => h(FooterLogo)
}
)
}
}
Layout: DynamicLayout,
} satisfies Theme;
4 changes: 4 additions & 0 deletions docs/src/examples/autocomplete_single.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
layout: false
---

<select name="singleSelect" id="singleSelect" data-autocomplete class="border-1">
<option value="">Select an option</option>
<option value="1">Option 1</option>
Expand Down
Loading
Loading