Skip to content

Commit

Permalink
Merge pull request #1 from pzweuj/dev
Browse files Browse the repository at this point in the history
v0.5.0
  • Loading branch information
pzweuj authored Nov 23, 2024
2 parents 0e23ffe + f3f1330 commit f3ea201
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 60 deletions.
87 changes: 38 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,42 @@

全程由Claude AI辅助开发。不知道哪些是废弃代码,后续再进行清理。

## 设计风格

- 主题:简约现代风格
- 配色:黑白为主
- 响应式布局
- 主题模式:
- 支持手动切换主题开关

## 功能模块

### 页面结构
- **博客首页**:展示文章列表
- 显示标题、文章摘要、日期
- 分页展示
- 搜索图标触发全站搜索

- **归档页面**:时间线式展示所有文章
- 顶部搜索栏
- 按时间归档
- 按标签(Tags)快速筛选
- 仅显示标题

- **实践文档**:技术文档中心
- 顶部搜索栏
- 侧边栏导航
- 类ReadTheDocs布局

- **关于页面**:个人信息展示

### 核心功能
- 搜索
- 响应式设计
- 智能主题切换
- 基于时间的自动主题切换
- 手动主题切换开关
- 文章以Markdown进行编写
- 窗口大小自适应,多种设备兼容

## 部署方式

- 文章存储:GitHub仓库
- 自动部署:GitHub Actions
- 托管平台:GitHub Pages

## 技术栈

- NextJs
- GitHub Actions
- Markdown
示例网站:https://pzweuj.github.io



## 基本使用

```bash
git clone https://github.com/pzweuj/MyBlog.git
```

可通过下面的文件修改基本信息

```
src\config\self.config.ts
```

可自行修改icon
```
src\app\icon.ico
```

修改下面的文件达成**关于**信息的修改
```
content\about.md
```


上传Markdown博客文章到下面的路径,格式请参考示例文件
```
content\posts
```

上传Markdown文档文章到下面的路径,格式请参考示例文件,可修改该目录下的index.md。
```
content\project
```



12 changes: 4 additions & 8 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ import { Inter } from 'next/font/google'
import { ThemeProvider } from '@/components/providers/ThemeProvider'
import Header from '@/components/layout/Header'
import Footer from '@/components/layout/Footer'
import GoogleAnalytics from '@/lib/plugins/GoogleAnalytics'
import selfConfig from '@/config/self.config'
import './globals.css'
import 'katex/dist/katex.min.css'

const inter = Inter({ subsets: ['latin'] })

// 直接在代码中定义 GA ID(临时测试用)
const GA_MEASUREMENT_ID = 'G-367656923' // 替换为您的实际 GA4 测量 ID

export const metadata = {
title: '生物信息文件夹',
description: '记录生物信息学学习与工作中的点点滴滴',
title: selfConfig.title,
description: selfConfig.description,
icons: {
icon: '/icon.ico',
shortcut: '/icon.ico',
Expand All @@ -26,9 +23,8 @@ export default function RootLayout({
children: React.ReactNode
}) {
return (
<html lang="zh" suppressHydrationWarning>
<html lang={selfConfig.language} suppressHydrationWarning>
<body className={`${inter.className} min-h-screen flex flex-col bg-white dark:bg-gray-900`}>
<GoogleAnalytics GA_MEASUREMENT_ID={GA_MEASUREMENT_ID} />
<ThemeProvider
attribute="class"
defaultTheme="system"
Expand Down
7 changes: 4 additions & 3 deletions src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GithubIcon } from '../ui/Icons'
import selfConfig from '@/config/self.config'

// 添加 EmailIcon 组件
const EmailIcon = () => (
Expand Down Expand Up @@ -26,7 +27,7 @@ export default function Footer() {
{/* 社交链接 */}
<div className="flex space-x-6">
<a
href="https://github.com/pzweuj"
href={selfConfig.social.github}
target="_blank"
rel="noopener noreferrer"
className="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
Expand All @@ -35,7 +36,7 @@ export default function Footer() {
<GithubIcon />
</a>
<a
href="mailto:pzweuj@live.com"
href={`mailto:${selfConfig.social.email}`}
className="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
aria-label="Email"
>
Expand All @@ -45,7 +46,7 @@ export default function Footer() {

{/* 版权信息 */}
<div className="text-center text-sm text-gray-600 dark:text-gray-400">
<p>© {new Date().getFullYear()} pzweuj. All rights reserved.</p>
<p>© {new Date().getFullYear()} {selfConfig.author}. All rights reserved.</p>
<p className="mt-1">
Built with{' '}
<a
Expand Down
29 changes: 29 additions & 0 deletions src/config/self.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
interface SiteConfig {
// 基础信息
title: string
description: string
author: string
language: string
siteUrl: string

// 社交媒体链接
social: {
github: string
email: string
}
}

const selfConfig: SiteConfig = {
title: '生物信息文件夹',
description: '生信工作学习记录',
author: 'pzweuj',
language: 'zh-CN',
siteUrl: 'https://pzweuj.github.io',

social: {
github: 'https://github.com/pzweuj',
email: 'pzweuj@live.com',
}
}

export default selfConfig

0 comments on commit f3ea201

Please sign in to comment.