Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

chore: Add native API docs to website

Matt Kilgore76b6c3453300
diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
index 19535d27..263b1ceb 100644
--- a/docs/.vitepress/config.mts
+++ b/docs/.vitepress/config.mts
@@ -41,7 +41,7 @@ export default defineConfig({
},
// https://vitepress.dev/reference/default-theme-config
nav: [
- { text: 'API', link: 'https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/sysadminsmedia/homebox/main/docs/docs/api/openapi-2.0.json' },
+ { text: 'API Docs', link: '/en/api' },
{ text: 'Demo', link: 'https://demo.homebox.software' },
],
diff --git a/docs/en/api.md b/docs/en/api.md
new file mode 100644
index 00000000..9ecce9a3
--- /dev/null
+++ b/docs/en/api.md
@@ -0,0 +1,31 @@
+---
+layout: page
+sidebar: false
+---
+
+<script setup lang="ts">
+import { useData } from 'vitepress';
+
+const elementScript = document.createElement('script');
+elementScript.src = 'https://unpkg.com/@stoplight/elements/web-components.min.js';
+document.head.appendChild(elementScript);
+
+const elementStyle = document.createElement('link');
+elementStyle.rel = 'stylesheet';
+elementStyle.href = 'https://unpkg.com/@stoplight/elements/styles.min.css';
+document.head.appendChild(elementStyle);
+
+const { isDark } = useData();
+let theme = 'light';
+if (isDark.value) {
+ theme = 'dark';
+}
+</script>
+
+<elements-api
+apiDescriptionUrl="https://cdn.jsdelivr.net/gh/sysadminsmedia/homebox@main/docs/docs/api/openapi-2.0.json"
+router="hash"
+layout="responsive"
+hideSchemas="true"
+:data-theme="theme"
+/>
\ No newline at end of file