feat: 个人博客全栈实现(Rust/Axum + React/Tailwind + PostgreSQL)
后端(Axum + sqlx): - GitHub OAuth 三层权限(管理员/用户/游客),MOCK_OAUTH 本地调试开关 - 文章 CRUD、草稿自动保存、发布/私有分离,发布时渲染 HTML - 目录(folder 路径分层)、标签、评论、RSS、热门文章(按评论数) - pages 表驱动动态内容:关于页、首页标题、个人名片 - S3 兼容对象存储图片上传接口(rust-s3,未配置时明确报错) - 发布时自动提取正文首图作为封面 cover_url - sqlx migrate 管理 5 个迁移 前端(React + Tailwind): - 白天 Editorial / 黑夜星空双主题 - 首页(列表 + 热门侧栏 + 可编辑大标题)、文库(目录树+标签+搜索) - Profile 页(GitHub 风格名片卡,全部字段后台可编辑) - 后台:文件树文章管理、CodeMirror 编辑器(实时预览/自动保存/传图) - Markdown 渲染:KaTeX 公式、代码块语言标注 + 双主题语法高亮 - 有封面的文章卡片自动整行展示,全局 ErrorBoundary 部署: - docker-compose 本地三容器(postgres/backend/frontend) - k8s manifests(适配 Caddy 终结 TLS → 隧道 → traefik 明文路由) - 前端静态文件可由 Caddy 直接托管,集群只需 backend + postgres - 可选 postgres 每日备份到 S3 的 CronJob
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
darkMode: 'class',
|
||||
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
space: {
|
||||
950: '#050714',
|
||||
900: '#0B1026',
|
||||
800: '#111836',
|
||||
700: '#1A2347',
|
||||
},
|
||||
nebula: {
|
||||
DEFAULT: '#6366F1',
|
||||
glow: '#818CF8',
|
||||
dim: '#312E81',
|
||||
},
|
||||
star: {
|
||||
DEFAULT: '#E0E7FF',
|
||||
dim: '#94A3B8',
|
||||
},
|
||||
paper: {
|
||||
DEFAULT: '#fafaf9',
|
||||
dark: '#f5f5f4',
|
||||
},
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['Inter', 'system-ui', '-apple-system', 'BlinkMacSystemFont', 'sans-serif'],
|
||||
serif: ['Merriweather', 'Georgia', 'Noto Serif SC', 'Songti SC', 'serif'],
|
||||
mono: ['JetBrains Mono', 'Fira Code', 'monospace'],
|
||||
},
|
||||
animation: {
|
||||
'pulse-slow': 'pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
||||
'twinkle': 'twinkle 3s ease-in-out infinite alternate',
|
||||
},
|
||||
keyframes: {
|
||||
twinkle: {
|
||||
'0%': { opacity: '0.3' },
|
||||
'100%': { opacity: '1' },
|
||||
},
|
||||
},
|
||||
backgroundImage: {
|
||||
'space-gradient': 'radial-gradient(ellipse at top, #1e1b4b 0%, #0f172a 40%, #020617 100%)',
|
||||
},
|
||||
typography: (theme) => ({
|
||||
DEFAULT: {
|
||||
css: {
|
||||
maxWidth: 'none',
|
||||
'--tw-prose-headings': theme('colors.stone.900'),
|
||||
'--tw-prose-links': theme('colors.blue.600'),
|
||||
'--tw-prose-code': theme('colors.rose.500'),
|
||||
'--tw-prose-pre-bg': theme('colors.stone.900'),
|
||||
},
|
||||
},
|
||||
dark: {
|
||||
css: {
|
||||
color: theme('colors.slate.300'),
|
||||
'--tw-prose-headings': theme('colors.star.DEFAULT'),
|
||||
'--tw-prose-links': theme('colors.nebula.glow'),
|
||||
'--tw-prose-code': theme('colors.nebula.glow'),
|
||||
'--tw-prose-pre-bg': theme('colors.space.800'),
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
plugins: [require('@tailwindcss/typography')],
|
||||
};
|
||||
Reference in New Issue
Block a user