mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-24 06:28:34 +01:00
chore: Add native API docs to website
This commit is contained in:
@@ -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' },
|
||||
],
|
||||
|
||||
|
||||
31
docs/en/api.md
Normal file
31
docs/en/api.md
Normal file
@@ -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"
|
||||
/>
|
||||
Reference in New Issue
Block a user