Compare commits
12 Commits
d14d807aec
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bf5f57bc60 | |||
| 7996896530 | |||
| f7ea3a5d6d | |||
| 5999e49967 | |||
| bbd1232243 | |||
| 4ddf3fbe0a | |||
| 0df73b268a | |||
| ffdf0502e2 | |||
| 1f5a0795d3 | |||
| f0b859311f | |||
| 3c0bdac1f5 | |||
| 3ef662e881 |
@@ -5,17 +5,15 @@ import sitemap from '@astrojs/sitemap';
|
||||
import pkgs from './package.json';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import dotenv from 'dotenv';
|
||||
import vue from '@astrojs/vue';
|
||||
// import vue from '@astrojs/vue';
|
||||
|
||||
dotenv.config();
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
let target = process.env.VITE_API_URL || 'http://localhost:51015';
|
||||
let target = process.env.VITE_API_URL || 'http://localhost:51515';
|
||||
const apiProxy = { target: target, changeOrigin: true, ws: true, rewriteWsOrigin: true, secure: false, cookieDomainRewrite: 'localhost' };
|
||||
let proxy = {
|
||||
'/root/': {
|
||||
target: `${target}/root/`,
|
||||
},
|
||||
'/root/': apiProxy,
|
||||
'/api': apiProxy,
|
||||
'/client': apiProxy,
|
||||
};
|
||||
@@ -26,19 +24,20 @@ export default defineConfig({
|
||||
integrations: [
|
||||
mdx(),
|
||||
react(), //
|
||||
vue(),
|
||||
// vue(),
|
||||
// sitemap(), // sitemap must be site has a domain
|
||||
],
|
||||
|
||||
server: {
|
||||
port: 7008,
|
||||
host: '0.0.0.0',
|
||||
allowedHosts: true,
|
||||
},
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
define: {
|
||||
BASE_NAME: JSON.stringify(basename || ''),
|
||||
},
|
||||
server: {
|
||||
port: 7008,
|
||||
host: '0.0.0.0',
|
||||
allowedHosts: true,
|
||||
proxy,
|
||||
},
|
||||
},
|
||||
|
||||
21
kevisual.json
Normal file
21
kevisual.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"metadata": {
|
||||
"name": "kevisual",
|
||||
"share": "public"
|
||||
},
|
||||
"registry": "https://kevisual.cn/root/ai/kevisual/frontend/simple-astro-template",
|
||||
"clone": {
|
||||
".": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"syncd": [
|
||||
{
|
||||
"files": [
|
||||
"**/*"
|
||||
],
|
||||
"registry": ""
|
||||
}
|
||||
],
|
||||
"sync": {}
|
||||
}
|
||||
33
package.json
33
package.json
@@ -3,12 +3,12 @@
|
||||
"version": "0.0.2",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"basename": "/root/astro-simplate-template",
|
||||
"basename": "/root/astro-simplate-template-docs",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"pub": "envision deploy ./dist -k astro-simplate-template -v 0.0.2 -u",
|
||||
"pub": "envision deploy ./dist -k astro-simplate-template-docs -v 0.0.2 -u",
|
||||
"slide:dev": "slidev --open slides/index.md",
|
||||
"slide:build": "slidev build slides/index.md --base /root/astro-simplate-template-slide/",
|
||||
"slide:pub": "envision deploy ./slides/dist -k astro-simplate-template-slide -v 0.0.2 -u",
|
||||
@@ -19,34 +19,35 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^4.3.12",
|
||||
"@astrojs/mdx": "^4.3.13",
|
||||
"@astrojs/react": "^4.4.2",
|
||||
"@astrojs/sitemap": "^3.6.0",
|
||||
"@astrojs/vue": "^5.1.3",
|
||||
"@kevisual/query": "^0.0.29",
|
||||
"@kevisual/context": "^0.0.4",
|
||||
"@kevisual/query": "^0.0.35",
|
||||
"@kevisual/query-login": "^0.0.7",
|
||||
"@kevisual/registry": "^0.0.1",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"@uiw/react-md-editor": "^4.0.8",
|
||||
"antd": "^6.0.0",
|
||||
"astro": "^5.16.0",
|
||||
"@tailwindcss/vite": "^4.1.18",
|
||||
"@uiw/react-md-editor": "^4.0.11",
|
||||
"antd": "^6.1.3",
|
||||
"astro": "^5.16.6",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"dayjs": "^1.11.19",
|
||||
"es-toolkit": "^1.42.0",
|
||||
"es-toolkit": "^1.43.0",
|
||||
"github-markdown-css": "^5.8.1",
|
||||
"highlight.js": "^11.11.1",
|
||||
"lucide-react": "^0.554.0",
|
||||
"lucide-react": "^0.562.0",
|
||||
"marked": "^17.0.1",
|
||||
"marked-highlight": "^2.2.3",
|
||||
"nanoid": "^5.1.6",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react": "^19.2.3",
|
||||
"react-dom": "^19.2.3",
|
||||
"react-toastify": "^11.0.5",
|
||||
"tailwind-merge": "^3.4.0",
|
||||
"vue": "^3.5.25",
|
||||
"zustand": "^5.0.8"
|
||||
"vue": "^3.5.26",
|
||||
"zustand": "^5.0.9"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -56,10 +57,10 @@
|
||||
"@types/react": "^19.2.7",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"dotenv": "^17.2.3",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"tw-animate-css": "^1.4.0"
|
||||
},
|
||||
"packageManager": "pnpm@10.23.0",
|
||||
"packageManager": "pnpm@10.27.0",
|
||||
"onlyBuiltDependencies": [
|
||||
"@tailwindcss/oxide",
|
||||
"esbuild",
|
||||
|
||||
1486
pnpm-lock.yaml
generated
1486
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
17
readme.md
Normal file
17
readme.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# template
|
||||
|
||||
在开发多项目的时候,实时创建的新的模块,界面,git 已经满足不了正常开发需求,文件随时更新。以最新为标准,进行同步和开发。
|
||||
|
||||
## 使用方法
|
||||
|
||||
### simple-lit-vite
|
||||
|
||||
```sh
|
||||
ev sync clone -i https://kevisual.cn/root/ai/kevisual/frontend/simple-astro-template/kevisual.json
|
||||
```
|
||||
|
||||
### simple-slide
|
||||
|
||||
```sh
|
||||
ev sync clone -i https://kevisual.cn/root/ai/kevisual/frontend/simple-astro-template/kevisual.json
|
||||
```
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: 'astro 例子'
|
||||
title: '想要模板做什么'
|
||||
tags: ['astro', 'simple', 'template']
|
||||
createdAt: '2025-11-25 20:00:00'
|
||||
hideInMenu: true
|
||||
---
|
||||
|
||||
## astro-simplate-template
|
||||
## 模板介绍
|
||||
|
||||
astro 是一个非常好的
|
||||
合并文档内容和开发项目的模块
|
||||
24
src/layouts/MDXPost.astro
Normal file
24
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>
|
||||
4
src/layouts/docs/pagination.astro
Normal file
4
src/layouts/docs/pagination.astro
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
---
|
||||
|
||||
分页组件
|
||||
@@ -4,8 +4,9 @@ export const basename = BASE_NAME;
|
||||
console.log(basename);
|
||||
|
||||
export const wrapBasename = (path: string) => {
|
||||
const hasEnd = path.endsWith('/')
|
||||
if (basename) {
|
||||
return `${basename}${path}/`;
|
||||
return `${basename}${path}` + (hasEnd ? '' : '/');
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
import Html from '@/components/html.astro';
|
||||
import Counter from '@/components/vue/Counter.vue';
|
||||
// import Counter from '@/components/vue/Counter.vue';
|
||||
---
|
||||
|
||||
<Html>
|
||||
<main>
|
||||
<Counter count={10} client:only/>
|
||||
<!-- <Counter count={10} client:only/> -->
|
||||
</main>
|
||||
</Html>
|
||||
|
||||
@@ -22,6 +22,6 @@ const staticPaths = await getStaticPaths();
|
||||
const menu = staticPaths.map((item) => item.data);
|
||||
---
|
||||
|
||||
<Main showMenu={showMenu} menu={menu} basename={basename}>
|
||||
<Main showMenu={showMenu} menu={menu} basename={basename} title={post.data.title}>
|
||||
<Content />
|
||||
</Main>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import { getCollection } from 'astro:content';
|
||||
const posts = await getCollection('docs');
|
||||
import { basename } from '@/modules/basename';
|
||||
import { basename, wrapBasename } from '@/modules/basename';
|
||||
import Blank from '@/layouts/blank.astro';
|
||||
---
|
||||
|
||||
@@ -10,10 +10,7 @@ import Blank from '@/layouts/blank.astro';
|
||||
<div class='max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12'>
|
||||
{/* 页面标题区域 */}
|
||||
<div class='mb-12'>
|
||||
<h1
|
||||
class='text-4xl sm:text-5xl font-bold text-slate-900 dark:text-white mb-4 bg-clip-text bg-linear-to-r from-blue-600 to-purple-600'>
|
||||
📚 文档列表
|
||||
</h1>
|
||||
<h1 class='text-4xl sm:text-5xl font-bold text-slate-900 dark:text-white mb-4 bg-clip-text bg-linear-to-r from-blue-600 to-purple-600'>📚 文档列表</h1>
|
||||
<p class='text-slate-600 dark:text-slate-400 text-lg'>浏览所有可用的文档资源</p>
|
||||
<div class='mt-4 h-1 w-20 bg-linear-to-r from-blue-600 to-purple-600 rounded-full'></div>
|
||||
</div>
|
||||
@@ -23,11 +20,12 @@ import Blank from '@/layouts/blank.astro';
|
||||
{
|
||||
posts.map((post) => {
|
||||
const tags = post.data.tags || [];
|
||||
const postUrl = wrapBasename(`/docs/${post.id}`);
|
||||
return (
|
||||
<article class='group bg-white dark:bg-slate-800 rounded-xl shadow-sm hover:shadow-xl transition-all duration-300 overflow-hidden border border-slate-200 dark:border-slate-700 hover:border-blue-500 dark:hover:border-blue-400'>
|
||||
<div class='p-6'>
|
||||
{/* 文档标题 */}
|
||||
<a href={`${basename}/docs/${post.id}/`} class='block'>
|
||||
<a href={postUrl} class='block'>
|
||||
<h2 class='text-xl sm:text-2xl font-semibold text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors duration-200 mb-3'>
|
||||
{post.data.title}
|
||||
</h2>
|
||||
@@ -50,7 +48,7 @@ import Blank from '@/layouts/blank.astro';
|
||||
|
||||
{/* 阅读更多指示器 */}
|
||||
<a
|
||||
href={`${basename}/docs/${post.id}/`}
|
||||
href={postUrl}
|
||||
class='mt-4 flex items-center text-blue-600 dark:text-blue-400 text-sm font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200'>
|
||||
<span>阅读更多</span>
|
||||
<svg
|
||||
|
||||
Reference in New Issue
Block a user