Compare commits
10 Commits
45906e6e0f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 69770c635b | |||
| 23398da9db | |||
| 98ed0b6ad4 | |||
| c9c71955c0 | |||
| 52dbab5fa7 | |||
| ced2361985 | |||
| 9c8564e14a | |||
| 309cce14ab | |||
| bfcdbec4d2 | |||
| c1a601fbde |
49
.env.example
Normal file
49
.env.example
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# Mizuki 博客环境变量配置示例
|
||||||
|
# 复制此文件为 .env 并根据需要填写实际值
|
||||||
|
|
||||||
|
# ============================================
|
||||||
|
# 内容仓库配置 (代码内容分离)
|
||||||
|
# 项目地址:https://github.com/matsuzaka-yuki/Mizuki-Content
|
||||||
|
# ============================================
|
||||||
|
|
||||||
|
# 是否启用内容分离功能 (true/false)
|
||||||
|
# true: 启用内容分离,从独立仓库同步内容
|
||||||
|
# false: 禁用内容分离,使用本地内容 (默认模式)
|
||||||
|
# 注意: 如果不使用内容分离功能,可以注释掉或设置为 false
|
||||||
|
ENABLE_CONTENT_SYNC=true
|
||||||
|
|
||||||
|
# 内容仓库的 Git URL (仅在 ENABLE_CONTENT_SYNC=true 时需要)
|
||||||
|
# 支持 HTTPS 和 SSH 两种方式:
|
||||||
|
# HTTPS: https://github.com/your-username/Mizuki-Content.git
|
||||||
|
# SSH: git@github.com:your-username/Mizuki-Content.git
|
||||||
|
CONTENT_REPO_URL=https://gitea.namyki.top/namyki/BlogContent.git
|
||||||
|
USE_SUBMODULE=true
|
||||||
|
|
||||||
|
# 内容目录路径 (相对于项目根目录)
|
||||||
|
# 默认: ./content 一般无需改动
|
||||||
|
# CONTENT_DIR=./content
|
||||||
|
|
||||||
|
# ============================================
|
||||||
|
# 自动构建触发配置 (内容仓库更新时)
|
||||||
|
# ============================================
|
||||||
|
|
||||||
|
# 问题: 内容仓库更新不会自动触发代码仓库的部署
|
||||||
|
# 解决: 配置自动触发机制,推荐使用 Repository Dispatch
|
||||||
|
# 详见: docs/AUTO_BUILD_TRIGGER.md (5 步快速配置)
|
||||||
|
|
||||||
|
# ============================================
|
||||||
|
# 统计与分析
|
||||||
|
# ============================================
|
||||||
|
|
||||||
|
# Umami API 密钥,用于访问 Umami 统计数据
|
||||||
|
# 如果在 config.ts 中启用了 Umami,建议在此配置 API 密钥
|
||||||
|
#UMAMI_API_KEY=your_umami_api_key_here
|
||||||
|
|
||||||
|
# ============================================
|
||||||
|
# 安全配置
|
||||||
|
# ============================================
|
||||||
|
|
||||||
|
# bcrypt 盐值轮数,用于加密文章密码
|
||||||
|
# 值越大越安全,但构建时间越长
|
||||||
|
# 推荐值:10-14(默认:12)
|
||||||
|
BCRYPT_SALT_ROUNDS=12
|
||||||
1
content
1
content
Submodule content deleted from fb2a4f05d2
@@ -41,14 +41,11 @@ if (footerConfig.enable) {
|
|||||||
{customFooterHtml && (
|
{customFooterHtml && (
|
||||||
<div class="mb-2" set:html={customFooterHtml}></div>
|
<div class="mb-2" set:html={customFooterHtml}></div>
|
||||||
)}
|
)}
|
||||||
© <span id="copyright-year">{currentYear}</span> {profileConfig.name}. All Rights Reserved. /
|
© <span id="copyright-year">{currentYear}</span> {profileConfig.name}. 千里之行,始于足下.
|
||||||
|
Powered by
|
||||||
|
<a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://astro.namyki.top">Namyki</a> <br/>
|
||||||
<a class="transition link text-[var(--primary)] font-medium" href={url('rss/')} onclick={`event.preventDefault(); navigateToPage('${url('rss/')}')`}>RSS</a> /
|
<a class="transition link text-[var(--primary)] font-medium" href={url('rss/')} onclick={`event.preventDefault(); navigateToPage('${url('rss/')}')`}>RSS</a> /
|
||||||
<a class="transition link text-[var(--primary)] font-medium" href={url('atom/')} onclick={`event.preventDefault(); navigateToPage('${url('atom/')}')`}>Atom</a> /
|
<a class="transition link text-[var(--primary)] font-medium" href={url('atom/')} onclick={`event.preventDefault(); navigateToPage('${url('atom/')}')`}>Atom</a> /
|
||||||
<a class="transition link text-[var(--primary)] font-medium" target="_blank" href={url('sitemap-index.xml')}>Sitemap</a><br>
|
<a class="transition link text-[var(--primary)] font-medium" target="_blank" href={url('sitemap-index.xml')}>Sitemap</a>
|
||||||
Powered by
|
|
||||||
<a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://astro.build">Astro</a> &
|
|
||||||
<a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://github.com/matsuzaka-yuki/mizuki">Mizuki</a> Version <a class="transition link text-[var(--primary)] font-medium" target="_blank" href="https://github.com/matsuzaka-yuki/mizuki">7.6</a><br>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const SITE_TIMEZONE = 8; //设置你的网站时区 from -12 to 12 default in UT
|
|||||||
export const siteConfig: SiteConfig = {
|
export const siteConfig: SiteConfig = {
|
||||||
title: "海の小屋",
|
title: "海の小屋",
|
||||||
subtitle: "工于至诚,学以致用",
|
subtitle: "工于至诚,学以致用",
|
||||||
siteURL: "https://blog.namyki.com/", // 请替换为你的站点URL,以斜杠结尾
|
siteURL: "https://astro.namyki.com/", // 请替换为你的站点URL,以斜杠结尾
|
||||||
siteStartDate: "2025-12-01", // 站点开始运行日期,用于站点统计组件计算运行天数
|
siteStartDate: "2025-12-01", // 站点开始运行日期,用于站点统计组件计算运行天数
|
||||||
|
|
||||||
timeZone: SITE_TIMEZONE,
|
timeZone: SITE_TIMEZONE,
|
||||||
@@ -184,15 +184,15 @@ export const siteConfig: SiteConfig = {
|
|||||||
// 英文字体 - 优先级最高
|
// 英文字体 - 优先级最高
|
||||||
// 指定为英文字体则无论字体包含多大范围,都只会保留 ASCII 字符子集
|
// 指定为英文字体则无论字体包含多大范围,都只会保留 ASCII 字符子集
|
||||||
fontFamily: "ZenMaruGothic-Medium",
|
fontFamily: "ZenMaruGothic-Medium",
|
||||||
fontWeight: "400",
|
fontWeight: "500",
|
||||||
localFonts: ["ZenMaruGothic-Medium.ttf"],
|
localFonts: ["ZenMaruGothic-Medium.ttf"],
|
||||||
enableCompress: true, // 启用字体子集优化,减少字体文件大小
|
enableCompress: true, // 启用字体子集优化,减少字体文件大小
|
||||||
},
|
},
|
||||||
cjkFont: {
|
cjkFont: {
|
||||||
// 中日韩字体 - 作为回退字体
|
// 中日韩字体 - 作为回退字体
|
||||||
fontFamily: "萝莉体 第二版",
|
fontFamily: "XiangcuiDengcusong",
|
||||||
fontWeight: "500",
|
fontWeight: "400",
|
||||||
localFonts: ["萝莉体 第二版.ttf"],
|
localFonts: ["XiangcuiDengcusong.ttf"],
|
||||||
enableCompress: true, // 启用字体子集优化,减少字体文件大小
|
enableCompress: true, // 启用字体子集优化,减少字体文件大小
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
// 设备数据配置文件
|
|
||||||
|
|
||||||
export interface Device {
|
|
||||||
name: string;
|
|
||||||
image: string;
|
|
||||||
specs: string;
|
|
||||||
description: string;
|
|
||||||
link: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设备类别类型,支持品牌和自定义类别
|
|
||||||
export type DeviceCategory = {
|
|
||||||
[categoryName: string]: Device[];
|
|
||||||
} & {
|
|
||||||
自定义?: Device[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export const devicesData: DeviceCategory = {
|
|
||||||
Xiaomi: [
|
|
||||||
{
|
|
||||||
name: "Xiaomi 14Pro",
|
|
||||||
image: "/images/device/mi14p.jpg",
|
|
||||||
specs: "Black / 12G + 256TB",
|
|
||||||
description: "Xiaomi 14 Pro,超越旗舰,超乎所想。",
|
|
||||||
link: "https://www.mi.com/xiaomi-14-pro",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
// 日记数据配置
|
|
||||||
// 用于管理日记页面的数据
|
|
||||||
|
|
||||||
export interface DiaryItem {
|
|
||||||
id: number;
|
|
||||||
content: string;
|
|
||||||
date: string;
|
|
||||||
images?: string[];
|
|
||||||
location?: string;
|
|
||||||
mood?: string;
|
|
||||||
tags?: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 示例日记数据
|
|
||||||
const diaryData: DiaryItem[] = [
|
|
||||||
// {
|
|
||||||
// id: 1,
|
|
||||||
// content:
|
|
||||||
// "The falling speed of cherry blossoms is five centimeters per second!",
|
|
||||||
// date: "2025-01-15T10:30:00Z",
|
|
||||||
// images: ["/images/diary/sakura.jpg", "/images/diary/1.jpg"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 2,
|
|
||||||
// content:
|
|
||||||
// "The falling speed of cherry blossoms is five centimeters per second!",
|
|
||||||
// date: "2025-01-15T10:30:00Z",
|
|
||||||
// images: ["/images/diary/sakura.jpg", "/images/diary/1.jpg"],
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
||||||
// 获取日记统计数据
|
|
||||||
export const getDiaryStats = () => {
|
|
||||||
const total = diaryData.length;
|
|
||||||
const hasImages = diaryData.filter(
|
|
||||||
(item) => item.images && item.images.length > 0,
|
|
||||||
).length;
|
|
||||||
const hasLocation = diaryData.filter((item) => item.location).length;
|
|
||||||
const hasMood = diaryData.filter((item) => item.mood).length;
|
|
||||||
|
|
||||||
return {
|
|
||||||
total,
|
|
||||||
hasImages,
|
|
||||||
hasLocation,
|
|
||||||
hasMood,
|
|
||||||
imagePercentage: Math.round((hasImages / total) * 100),
|
|
||||||
locationPercentage: Math.round((hasLocation / total) * 100),
|
|
||||||
moodPercentage: Math.round((hasMood / total) * 100),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取日记列表(按时间倒序)
|
|
||||||
export const getDiaryList = (limit?: number) => {
|
|
||||||
const sortedData = diaryData.sort(
|
|
||||||
(a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (limit && limit > 0) {
|
|
||||||
return sortedData.slice(0, limit);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sortedData;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取最新的日记
|
|
||||||
export const getLatestDiary = () => {
|
|
||||||
return getDiaryList(1)[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 根据ID获取日记
|
|
||||||
export const getDiaryById = (id: number) => {
|
|
||||||
return diaryData.find((item) => item.id === id);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取包含图片的日记
|
|
||||||
export const getDiaryWithImages = () => {
|
|
||||||
return diaryData.filter((item) => item.images && item.images.length > 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 根据标签筛选日记
|
|
||||||
export const getDiaryByTag = (tag: string) => {
|
|
||||||
return diaryData
|
|
||||||
.filter((item) => item.tags?.includes(tag))
|
|
||||||
.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取所有标签
|
|
||||||
export const getAllTags = () => {
|
|
||||||
const tags = new Set<string>();
|
|
||||||
diaryData.forEach((item) => {
|
|
||||||
if (item.tags) {
|
|
||||||
item.tags.forEach((tag) => tags.add(tag));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return Array.from(tags).sort();
|
|
||||||
};
|
|
||||||
|
|
||||||
export default diaryData;
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
// 友情链接数据配置
|
|
||||||
// 用于管理友情链接页面的数据
|
|
||||||
|
|
||||||
export interface FriendItem {
|
|
||||||
id: number;
|
|
||||||
title: string;
|
|
||||||
imgurl: string;
|
|
||||||
desc: string;
|
|
||||||
siteurl: string;
|
|
||||||
tags: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 友情链接数据
|
|
||||||
export const friendsData: FriendItem[] = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
title: "Astro",
|
|
||||||
imgurl: "https://avatars.githubusercontent.com/u/44914786?v=4&s=640",
|
|
||||||
desc: "The web framework for content-driven websites",
|
|
||||||
siteurl: "https://github.com/withastro/astro",
|
|
||||||
tags: ["Framework"],
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// id: 2,
|
|
||||||
// title: "Mizuki Docs",
|
|
||||||
// imgurl:
|
|
||||||
// "http://q.qlogo.cn/headimg_dl?dst_uin=3231515355&spec=640&img_type=jpg",
|
|
||||||
// desc: "Mizuki User Manual",
|
|
||||||
// siteurl: "https://docs.mizuki.mysqil.com",
|
|
||||||
// tags: ["Docs"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 3,
|
|
||||||
// title: "Vercel",
|
|
||||||
// imgurl: "https://avatars.githubusercontent.com/u/14985020?v=4&s=640",
|
|
||||||
// desc: "Develop. Preview. Ship.",
|
|
||||||
// siteurl: "https://vercel.com",
|
|
||||||
// tags: ["Hosting", "Cloud"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 4,
|
|
||||||
// title: "Tailwind CSS",
|
|
||||||
// imgurl: "https://avatars.githubusercontent.com/u/67109815?v=4&s=640",
|
|
||||||
// desc: "A utility-first CSS framework for rapidly building custom designs",
|
|
||||||
// siteurl: "https://tailwindcss.com",
|
|
||||||
// tags: ["CSS", "Framework"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 5,
|
|
||||||
// title: "TypeScript",
|
|
||||||
// imgurl: "https://avatars.githubusercontent.com/u/6154722?v=4&s=640",
|
|
||||||
// desc: "TypeScript is JavaScript with syntax for types",
|
|
||||||
// siteurl: "https://www.typescriptlang.org",
|
|
||||||
// tags: ["Language", "JavaScript"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 6,
|
|
||||||
// title: "React",
|
|
||||||
// imgurl: "https://avatars.githubusercontent.com/u/6412038?v=4&s=640",
|
|
||||||
// desc: "A JavaScript library for building user interfaces",
|
|
||||||
// siteurl: "https://reactjs.org",
|
|
||||||
// tags: ["Framework", "JavaScript"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 7,
|
|
||||||
// title: "GitHub",
|
|
||||||
// imgurl: "https://avatars.githubusercontent.com/u/9919?v=4&s=640",
|
|
||||||
// desc: "Where the world builds software",
|
|
||||||
// siteurl: "https://github.com",
|
|
||||||
// tags: ["Development", "Platform"],
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 8,
|
|
||||||
// title: "MDN Web Docs",
|
|
||||||
// imgurl: "https://avatars.githubusercontent.com/u/7565578?v=4&s=640",
|
|
||||||
// desc: "The web's most comprehensive resource for web developers",
|
|
||||||
// siteurl: "https://developer.mozilla.org",
|
|
||||||
// tags: ["Docs", "Reference"],
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
||||||
// 获取所有友情链接数据
|
|
||||||
export function getFriendsList(): FriendItem[] {
|
|
||||||
return friendsData;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取随机排序的友情链接数据
|
|
||||||
export function getShuffledFriendsList(): FriendItem[] {
|
|
||||||
const shuffled = [...friendsData];
|
|
||||||
for (let i = shuffled.length - 1; i > 0; i--) {
|
|
||||||
const j = Math.floor(Math.random() * (i + 1));
|
|
||||||
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
||||||
}
|
|
||||||
return shuffled;
|
|
||||||
}
|
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: '萝莉体 第二版';
|
font-family: 'XiangcuiDengcusong';
|
||||||
src: url('/assets/font/萝莉体 第二版.woff2') format('woff2');
|
src: url('/assets/font/XiangcuiDengcusong.woff2') format('woff2');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"ignoreDeprecations": "6.0",
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
|
|||||||
Reference in New Issue
Block a user