-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactor/vite-docs' into origin/master
- Loading branch information
Showing
332 changed files
with
26,608 additions
and
44,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { globbySync } from 'globby'; | ||
import path from 'path'; | ||
import createSvgSpritePlugin from 'vite-plugin-svg-sprite'; | ||
import { defineConfig } from 'vitepress'; | ||
|
||
const sidebarHowTo = globbySync('pages/docs/how-to/**/Readme.md', { cwd: path.resolve(__dirname, '../') }); | ||
const sidebarComponents = globbySync('pages/webitel-ui/components/**/Readme.md', { cwd: path.resolve(__dirname, '../') }); | ||
const sidebarValidators = globbySync('pages/webitel-ui/validators/**/Readme.md', { cwd: path.resolve(__dirname, '../') }); | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: 'Webitel UI', | ||
description: 'Webitel UI docs', | ||
vite: { | ||
css: { | ||
preprocessorOptions: { | ||
scss: { | ||
additionalData: `@import "./src/css/main.scss";`, | ||
}, | ||
}, | ||
}, | ||
plugins: [ | ||
createSvgSpritePlugin({ | ||
include: '**/sprite/*.svg', | ||
}), | ||
], | ||
}, | ||
|
||
// additionalData: `@import "../../src/css/main.scss";`, | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
], | ||
sidebar: [ | ||
{ text: 'How To', items: sidebarHowTo }, | ||
{ text: 'Components', items: sidebarComponents }, | ||
{ text: 'Validators', items: sidebarValidators }, | ||
].map(({ text, items }) => ( | ||
{ | ||
text, | ||
items: items.map(doc => { | ||
return { | ||
text: doc.split('/').at(-2), // get only folder name, where Readme.md is located | ||
link: '/' + doc.replace(/\.md$/, ''), | ||
}; | ||
}), | ||
})), | ||
|
||
// socialLinks: [ | ||
// { icon: 'github', link: 'https://github.com/vuejs/vitepress' } | ||
// ] | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- .vitepress/theme/Layout.vue --> | ||
|
||
<script setup> | ||
import { useData } from 'vitepress'; | ||
import DefaultTheme from 'vitepress/theme'; | ||
import { provide } from 'vue'; | ||
|
||
const { isDark } = useData(); | ||
|
||
const toggleComponentsDarkTheme = (value) => { | ||
const html = document.querySelector('html'); | ||
if (value) html.classList.add('theme--dark'); | ||
else html.classList.remove('theme--dark'); | ||
}; | ||
|
||
toggleComponentsDarkTheme(isDark.value); | ||
|
||
provide('toggle-appearance', () => { | ||
isDark.value = !isDark.value; | ||
toggleComponentsDarkTheme(isDark.value); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<DefaultTheme.Layout /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// .vitepress/theme/index.js | ||
import DefaultTheme from 'vitepress/theme'; | ||
import WebitelUI from '../../../src/install.js'; | ||
import i18n from '../../../src/locale/i18n'; | ||
import sharedComponents from '../../shared'; | ||
import '../../../src/assets//icons/sprite'; | ||
import 'prismjs/themes/prism.min.css'; | ||
import Layout from './Layout.vue'; | ||
|
||
/** @type {import('vitepress').Theme} */ | ||
export default { | ||
extends: DefaultTheme, | ||
Layout, | ||
enhanceApp({ app }) { | ||
app.use(i18n); | ||
WebitelUI.install(app, {}); | ||
Object.keys(sharedComponents).forEach((name) => { | ||
app.component(name, sharedComponents[name]); | ||
}); | ||
return app; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Webitel UI Docs |
Oops, something went wrong.