Files
fuwari/src/types/config.ts
afoim 7f9999ab5c feat(主题): 添加强制暗色模式支持并优化图片加载效果
- 在主题配置中新增forceDarkMode选项强制使用暗色模式
- 根据配置隐藏主题切换器和暗色模式切换组件
- 为图片组件添加加载动画和悬停效果
- 在页脚添加暗色模式IP检测iframe
- 格式化package.json文件
2025-06-24 22:51:40 +08:00

96 lines
1.4 KiB
TypeScript

import type { AUTO_MODE, DARK_MODE, LIGHT_MODE } from "@constants/constants";
export type SiteConfig = {
title: string;
subtitle: string;
lang: string;
themeColor: {
hue: number;
fixed: boolean;
forceDarkMode?: boolean;
};
banner: {
enable: boolean;
src: string;
position?: "top" | "center" | "bottom";
credit: {
enable: boolean;
text: string;
url?: string;
};
};
toc: {
enable: boolean;
depth: 1 | 2 | 3;
};
favicon: Favicon[];
};
export type Favicon = {
src: string;
theme?: "light" | "dark";
sizes?: string;
};
export enum LinkPreset {
Home = 0,
Archive = 1,
About = 2,
}
export type NavBarLink = {
name: string;
url: string;
external?: boolean;
};
export type NavBarConfig = {
links: (NavBarLink | LinkPreset)[];
};
export type ProfileConfig = {
avatar?: string;
name: string;
bio?: string;
links: {
name: string;
url: string;
icon: string;
}[];
};
export type LicenseConfig = {
enable: boolean;
name: string;
url: string;
};
export type ImageFallbackConfig = {
enable: boolean;
originalDomain: string;
fallbackDomain: string;
};
export type LIGHT_DARK_MODE =
| typeof LIGHT_MODE
| typeof DARK_MODE
| typeof AUTO_MODE;
export type BlogPostData = {
body: string;
title: string;
published: Date;
description: string;
tags: string[];
draft?: boolean;
image?: string;
category?: string;
prevTitle?: string;
prevSlug?: string;
nextTitle?: string;
nextSlug?: string;
};