init cli center
This commit is contained in:
24
cli-center/src/layouts/MDXPost.astro
Normal file
24
cli-center/src/layouts/MDXPost.astro
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
export interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
import 'github-markdown-css/github-markdown-light.css';
|
||||
import 'highlight.js/styles/github-dark.css';
|
||||
const { title, description } = Astro.props;
|
||||
---
|
||||
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>{title || '文档'}</title>
|
||||
</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>
|
||||
47
cli-center/src/layouts/blank.astro
Normal file
47
cli-center/src/layouts/blank.astro
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
import '../styles/theme.css';
|
||||
export interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
lang?: string;
|
||||
charset?: string;
|
||||
}
|
||||
|
||||
const { title = 'Light Code', description = 'A lightweight code editor', lang = 'zh-CN', charset = 'UTF-8' } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang={lang}>
|
||||
<head>
|
||||
<meta charset={charset} />
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
||||
<meta name='description' content={description} />
|
||||
<title>{title}</title>
|
||||
<!-- 样式 -->
|
||||
<slot name='head' />
|
||||
</head>
|
||||
<body>
|
||||
<slot />
|
||||
|
||||
<!-- 脚本 -->
|
||||
<slot name='scripts' />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
html {
|
||||
font-family: system-ui, sans-serif;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
4
cli-center/src/layouts/docs/pagination.astro
Normal file
4
cli-center/src/layouts/docs/pagination.astro
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
---
|
||||
|
||||
分页组件
|
||||
73
cli-center/src/layouts/mdx.astro
Normal file
73
cli-center/src/layouts/mdx.astro
Normal file
@@ -0,0 +1,73 @@
|
||||
---
|
||||
export interface Props {
|
||||
children: any;
|
||||
}
|
||||
import '../styles/global.css';
|
||||
import '../styles/theme.css';
|
||||
import 'github-markdown-css/github-markdown-light.css';
|
||||
import { Menu, MenuItem } from '../apps/menu';
|
||||
export interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
lang?: string;
|
||||
charset?: string;
|
||||
showMenu?: boolean;
|
||||
menu?: MenuItem[];
|
||||
basename?: string;
|
||||
}
|
||||
|
||||
const {
|
||||
title = 'Light Code',
|
||||
description = 'A lightweight code editor',
|
||||
lang = 'zh-CN',
|
||||
charset = 'UTF-8',
|
||||
showMenu = true,
|
||||
menu,
|
||||
basename = '',
|
||||
} = Astro.props;
|
||||
---
|
||||
|
||||
<html lang={lang}>
|
||||
<head>
|
||||
<meta charset={charset} />
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
||||
<title>{title}</title>
|
||||
<meta name='description' content={description} />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class='flex flex-col items-center bg-background'>
|
||||
<div class='w-full'>
|
||||
<slot name='header' />
|
||||
</div>
|
||||
<main class='flex-1 flex overflow-hidden w-full max-w-7xl px-4 py-4'>
|
||||
{
|
||||
showMenu && (
|
||||
<aside class='w-64 min-w-64 h-full flex flex-col'>
|
||||
<slot name='menu'>
|
||||
<Menu items={menu!} client:only basename={basename} />
|
||||
</slot>
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
<div class='flex-1 h-full flex items-start justify-center overflow-hidden'>
|
||||
<article class='markdown-body h-full scrollbar overflow-auto px-8 py-6 w-full max-w-4xl border border-border rounded-lg shadow-sm bg-card'>
|
||||
<slot />
|
||||
</article>
|
||||
</div>
|
||||
</main>
|
||||
<footer class='w-full border-t border-border bg-card/50 backdrop-blur-sm'>
|
||||
<slot name='footer'>
|
||||
<div class='text-center text-sm text-muted-foreground py-4'>Copyright © 2025</div>
|
||||
</slot>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user