add home mdx
This commit is contained in:
@@ -32,7 +32,7 @@ export default defineConfig({
|
||||
// 添加 rehype 插件
|
||||
],
|
||||
// 启用 MDX 表达式
|
||||
optimize: true,
|
||||
optimize: true
|
||||
}),
|
||||
react(), //
|
||||
// sitemap(), // sitemap must be site has a domain
|
||||
|
||||
@@ -16,39 +16,39 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^4.3.7",
|
||||
"@astrojs/react": "^4.4.0",
|
||||
"@astrojs/mdx": "^4.3.12",
|
||||
"@astrojs/react": "^4.4.2",
|
||||
"@astrojs/sitemap": "^3.6.0",
|
||||
"@kevisual/query": "^0.0.29",
|
||||
"@kevisual/query-login": "^0.0.6",
|
||||
"@kevisual/query-login": "^0.0.7",
|
||||
"@kevisual/registry": "^0.0.1",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"astro": "^5.14.5",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"astro": "^5.16.3",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"dayjs": "^1.11.18",
|
||||
"dayjs": "^1.11.19",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lucide-react": "^0.546.0",
|
||||
"lucide-react": "^0.555.0",
|
||||
"nanoid": "^5.1.6",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-toastify": "^11.0.5",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"zustand": "^5.0.8"
|
||||
"tailwind-merge": "^3.4.0",
|
||||
"zustand": "^5.0.9"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kevisual/types": "^0.0.10",
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.2",
|
||||
"@types/react": "^19.2.7",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-basic-ssl": "^2.1.0",
|
||||
"dotenv": "^17.2.3",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"tw-animate-css": "^1.4.0"
|
||||
},
|
||||
"packageManager": "pnpm@10.18.3",
|
||||
"packageManager": "pnpm@10.24.0",
|
||||
"onlyBuiltDependencies": [
|
||||
"@tailwindcss/oxide",
|
||||
"esbuild",
|
||||
|
||||
954
docs/pnpm-lock.yaml
generated
954
docs/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
26
docs/src/layouts/MDXPost.astro
Normal file
26
docs/src/layouts/MDXPost.astro
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
export interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
const { title, description } = Astro.props;
|
||||
---
|
||||
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>{title || '文档'}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github-dark.min.css">
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen">
|
||||
<div class="container mx-auto px-4 py-8 max-w-4xl">
|
||||
<article class="markdown-body bg-white rounded-lg shadow-lg p-8">
|
||||
<slot />
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
title: "Home 配置文档"
|
||||
description: "Home Assistant 自动化配置文档"
|
||||
layout: ../layouts/MDXPost.astro
|
||||
---
|
||||
|
||||
# home配置文档
|
||||
|
||||
## configuration.yaml
|
||||
@@ -5,6 +11,7 @@
|
||||
配置调用rest_command服务,文件地址在 docker 内部根目录下,`config/configuration.yaml` 位置
|
||||
|
||||
添加以下内容
|
||||
|
||||
```yaml
|
||||
rest_command:
|
||||
set_floor_notify:
|
||||
@@ -12,8 +19,8 @@ rest_command:
|
||||
method: POST
|
||||
content_type: application/json
|
||||
```
|
||||
然后配置脚本位置 `config/scripts.yaml` 文件,添加以下内容
|
||||
(scripts 被 configuration.yaml 引用)
|
||||
|
||||
然后配置脚本位置 `config/scripts.yaml` 文件,添加以下内容(scripts 被 configuration.yaml 引用)
|
||||
|
||||
```yaml
|
||||
notify_floor:
|
||||
@@ -22,7 +29,9 @@ notify_floor:
|
||||
sequence:
|
||||
- service: rest_command.set_floor_notify
|
||||
```
|
||||
|
||||
## 触发使用
|
||||
|
||||
home 可视化页面可以编辑自动化,编辑后台也可以,在 automations.yaml 文件中添加以下类似内容
|
||||
|
||||
```yaml
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
---
|
||||
title: "Python 代码示例"
|
||||
description: "SIP 消息发送和 FastAPI 服务示例"
|
||||
---
|
||||
|
||||
# python 代码示例
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user