| import type {
|
| DARK_MODE,
|
| LIGHT_MODE,
|
| SYSTEM_MODE,
|
| WALLPAPER_BANNER,
|
| WALLPAPER_NONE,
|
| WALLPAPER_OVERLAY,
|
| } from "../constants/constants";
|
|
|
| export type SiteConfig = {
|
| title: string;
|
| subtitle: string;
|
| site_url: string;
|
| description?: string;
|
| keywords?: string[];
|
|
|
| lang: "en" | "zh_CN" | "zh_TW" | "ja" | "ru";
|
|
|
| themeColor: {
|
| hue: number;
|
| fixed: boolean;
|
| defaultMode?: LIGHT_DARK_MODE;
|
| };
|
|
|
|
|
| card: {
|
|
|
| border: boolean;
|
| };
|
|
|
|
|
| font: FontConfig;
|
|
|
|
|
| siteStartDate?: string;
|
|
|
|
|
| timezone?: string;
|
|
|
|
|
| rehypeCallouts: {
|
| theme: "github" | "obsidian" | "vitepress";
|
| };
|
|
|
|
|
| bangumi?: {
|
| userId?: string;
|
| };
|
|
|
| generateOgImages: boolean;
|
| favicon: Array<{
|
| src: string;
|
| theme?: "light" | "dark";
|
| sizes?: string;
|
| }>;
|
|
|
| navbar: {
|
|
|
| logo?: {
|
| type: "icon" | "image" | "url";
|
| value: string;
|
| alt?: string;
|
| };
|
| title?: string;
|
| widthFull?: boolean;
|
| followTheme?: boolean;
|
| };
|
|
|
| showLastModified: boolean;
|
| outdatedThreshold?: number;
|
| sharePoster?: boolean;
|
|
|
|
|
| pages: {
|
| sponsor: boolean;
|
| guestbook: boolean;
|
| bangumi: boolean;
|
| };
|
|
|
|
|
| postListLayout: {
|
| defaultMode: "list" | "grid";
|
| allowSwitch: boolean;
|
| grid: {
|
|
|
|
|
| masonry: boolean;
|
|
|
| columns?: 2 | 3;
|
| };
|
| };
|
|
|
|
|
| pagination: {
|
| postsPerPage: number;
|
| };
|
|
|
|
|
| analytics?: {
|
| googleAnalyticsId?: string;
|
| microsoftClarityId?: string;
|
| };
|
|
|
|
|
| imageOptimization?: {
|
| |
| |
| |
| |
| |
|
|
| formats?: "avif" | "webp" | "both";
|
| |
| |
| |
|
|
| quality?: number;
|
| };
|
| };
|
|
|
| export type Favicon = {
|
| src: string;
|
| theme?: "light" | "dark";
|
| sizes?: string;
|
| };
|
|
|
| export enum LinkPreset {
|
| Home = 0,
|
| Archive = 1,
|
| About = 2,
|
| Friends = 3,
|
| Sponsor = 4,
|
| Guestbook = 5,
|
| Bangumi = 6,
|
| }
|
|
|
| export type NavBarLink = {
|
| name: string;
|
| url: string;
|
| external?: boolean;
|
| icon?: string;
|
| children?: (NavBarLink | LinkPreset)[];
|
| };
|
|
|
| export enum NavBarSearchMethod {
|
| PageFind = 0,
|
| }
|
|
|
| export type NavBarSearchConfig = {
|
| method: NavBarSearchMethod;
|
| };
|
|
|
| export type NavBarConfig = {
|
| links: (NavBarLink | LinkPreset)[];
|
| };
|
|
|
| export type ProfileConfig = {
|
| avatar?: string;
|
| name: string;
|
| bio?: string;
|
| links: {
|
| name: string;
|
| url: string;
|
| icon: string;
|
| showName?: boolean;
|
| }[];
|
| };
|
|
|
| export type LicenseConfig = {
|
| enable: boolean;
|
| name: string;
|
| url: string;
|
| };
|
|
|
|
|
| export type CommentConfig = {
|
| |
| |
| |
|
|
| type: "none" | "twikoo" | "waline" | "giscus" | "disqus" | "artalk";
|
| twikoo?: {
|
| envId: string;
|
| region?: string;
|
| lang?: string;
|
| visitorCount?: boolean;
|
| };
|
| waline?: {
|
| serverURL: string;
|
| lang?: string;
|
| login?: "enable" | "force" | "disable";
|
| visitorCount?: boolean;
|
| };
|
| artalk?: {
|
|
|
| server: string;
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| locale: string | "auto";
|
|
|
| visitorCount?: boolean;
|
| };
|
| giscus?: {
|
| repo: string;
|
| repoId: string;
|
| category: string;
|
| categoryId: string;
|
| mapping: string;
|
| strict: string;
|
| reactionsEnabled: string;
|
| emitMetadata: string;
|
| inputPosition: string;
|
| lang: string;
|
| loading: string;
|
| };
|
| disqus?: {
|
| shortname: string;
|
| };
|
| };
|
|
|
| export type LIGHT_DARK_MODE =
|
| | typeof LIGHT_MODE
|
| | typeof DARK_MODE
|
| | typeof SYSTEM_MODE;
|
|
|
| export type WALLPAPER_MODE =
|
| | typeof WALLPAPER_BANNER
|
| | typeof WALLPAPER_OVERLAY
|
| | typeof WALLPAPER_NONE;
|
|
|
| export type BlogPostData = {
|
| body: string;
|
| title: string;
|
| published: Date;
|
| description: string;
|
| tags: string[];
|
| draft?: boolean;
|
| image?: string;
|
| category?: string;
|
| pinned?: boolean;
|
| prevTitle?: string;
|
| prevSlug?: string;
|
| nextTitle?: string;
|
| nextSlug?: string;
|
| };
|
|
|
| export type ExpressiveCodeConfig = {
|
|
|
| theme?: string;
|
|
|
| darkTheme: string;
|
|
|
| lightTheme: string;
|
|
|
| pluginCollapsible?: PluginCollapsibleConfig;
|
| };
|
|
|
| export type PluginCollapsibleConfig = {
|
| enable: boolean;
|
| lineThreshold: number;
|
| previewLines: number;
|
| defaultCollapsed: boolean;
|
| };
|
|
|
| export type AnnouncementConfig = {
|
|
|
| title?: string;
|
| content: string;
|
| icon?: string;
|
| type?: "info" | "warning" | "success" | "error";
|
| closable?: boolean;
|
| link?: {
|
| enable: boolean;
|
| text: string;
|
| url: string;
|
| external?: boolean;
|
| };
|
| };
|
|
|
|
|
| export type FontItem = {
|
| id: string;
|
| name: string;
|
| src: string;
|
| family: string;
|
| weight?: string | number;
|
| style?: "normal" | "italic" | "oblique";
|
| display?: "auto" | "block" | "swap" | "fallback" | "optional";
|
| unicodeRange?: string;
|
| format?:
|
| | "woff"
|
| | "woff2"
|
| | "truetype"
|
| | "opentype"
|
| | "embedded-opentype"
|
| | "svg";
|
| };
|
|
|
|
|
| export type FontConfig = {
|
| enable: boolean;
|
| selected: string | string[];
|
| fonts: Record<string, FontItem>;
|
| fallback?: string[];
|
| preload?: boolean;
|
| };
|
|
|
| export type FooterConfig = {
|
| enable: boolean;
|
| customHtml?: string;
|
| };
|
|
|
| export type CoverImageConfig = {
|
| enableInPost: boolean;
|
| randomCoverImage: {
|
| enable: boolean;
|
| apis: string[];
|
| fallback?: string;
|
| showLoading?: boolean;
|
| };
|
| };
|
|
|
|
|
| export type WidgetComponentType =
|
| | "profile"
|
| | "announcement"
|
| | "categories"
|
| | "tags"
|
| | "sidebarToc"
|
| | "advertisement"
|
| | "stats"
|
| | "calendar"
|
| | "music";
|
|
|
| export type WidgetComponentConfig = {
|
| type: WidgetComponentType;
|
| enable: boolean;
|
| position: "top" | "sticky";
|
| configId?: string;
|
| showOnPostPage?: boolean;
|
| showOnNonPostPage?: boolean;
|
| responsive?: {
|
| hidden?: ("mobile" | "tablet" | "desktop")[];
|
| collapseThreshold?: number;
|
| };
|
| customProps?: Record<string, unknown>;
|
| };
|
|
|
| export type MobileBottomComponentConfig = {
|
| type: WidgetComponentType;
|
| enable: boolean;
|
| configId?: string;
|
| showOnPostPage?: boolean;
|
| showOnNonPostPage?: boolean;
|
| responsive?: {
|
| hidden?: ("mobile" | "tablet" | "desktop")[];
|
| collapseThreshold?: number;
|
| };
|
| customProps?: Record<string, unknown>;
|
| };
|
|
|
| export type SidebarLayoutConfig = {
|
| enable: boolean;
|
| position: "left" | "both";
|
| showRightSidebarOnPostPage?: boolean;
|
| leftComponents: WidgetComponentConfig[];
|
| rightComponents: WidgetComponentConfig[];
|
| mobileBottomComponents: MobileBottomComponentConfig[];
|
| };
|
|
|
| export type SakuraConfig = {
|
| enable: boolean;
|
| sakuraNum: number;
|
| limitTimes: number;
|
| size: {
|
| min: number;
|
| max: number;
|
| };
|
| opacity: {
|
| min: number;
|
| max: number;
|
| };
|
| speed: {
|
| horizontal: {
|
| min: number;
|
| max: number;
|
| };
|
| vertical: {
|
| min: number;
|
| max: number;
|
| };
|
| rotation: number;
|
| fadeSpeed: number;
|
| };
|
| zIndex: number;
|
| };
|
|
|
|
|
| export type SpineModelConfig = {
|
| enable: boolean;
|
| model: {
|
| path: string;
|
| scale?: number;
|
| x?: number;
|
| y?: number;
|
| };
|
| position: {
|
| corner: "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
| offsetX?: number;
|
| offsetY?: number;
|
| };
|
| size: {
|
| width?: number;
|
| height?: number;
|
| };
|
| interactive?: {
|
| enabled?: boolean;
|
| clickAnimations?: string[];
|
| clickMessages?: string[];
|
| messageDisplayTime?: number;
|
| idleAnimations?: string[];
|
| idleInterval?: number;
|
| };
|
| responsive?: {
|
| hideOnMobile?: boolean;
|
| mobileBreakpoint?: number;
|
| };
|
| zIndex?: number;
|
| opacity?: number;
|
| };
|
|
|
|
|
| export type Live2DModelConfig = {
|
| enable: boolean;
|
| model: {
|
| path: string;
|
| };
|
| position?: {
|
| corner?: "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
| offsetX?: number;
|
| offsetY?: number;
|
| };
|
| size?: {
|
| width?: number;
|
| height?: number;
|
| };
|
| interactive?: {
|
| enabled?: boolean;
|
|
|
| clickMessages?: string[];
|
| messageDisplayTime?: number;
|
| };
|
| responsive?: {
|
| hideOnMobile?: boolean;
|
| mobileBreakpoint?: number;
|
| };
|
| };
|
|
|
| export type BackgroundWallpaperConfig = {
|
| mode: "banner" | "overlay" | "none";
|
| switchable?: boolean;
|
| src:
|
| | string
|
| | string[]
|
| | {
|
| desktop?: string | string[];
|
| mobile?: string | string[];
|
| };
|
|
|
|
|
| banner?: {
|
| position?:
|
| | "top"
|
| | "center"
|
| | "bottom"
|
| | "top left"
|
| | "top center"
|
| | "top right"
|
| | "center left"
|
| | "center center"
|
| | "center right"
|
| | "bottom left"
|
| | "bottom center"
|
| | "bottom right"
|
| | "left top"
|
| | "left center"
|
| | "left bottom"
|
| | "right top"
|
| | "right center"
|
| | "right bottom"
|
| | string;
|
| homeText?: {
|
| enable: boolean;
|
| title?: string;
|
| subtitle?: string | string[];
|
| titleSize?: string;
|
| subtitleSize?: string;
|
| typewriter?: {
|
| enable: boolean;
|
| speed: number;
|
| deleteSpeed: number;
|
| pauseTime: number;
|
| };
|
| };
|
| credit?: {
|
| enable:
|
| | boolean
|
| | {
|
| desktop: boolean;
|
| mobile: boolean;
|
| };
|
| text:
|
| | string
|
| | {
|
| desktop: string;
|
| mobile: string;
|
| };
|
| url?:
|
| | string
|
| | {
|
| desktop: string;
|
| mobile: string;
|
| };
|
| };
|
| navbar?: {
|
| transparentMode?: "semi" | "full" | "semifull";
|
| enableBlur?: boolean;
|
| blur?: number;
|
| };
|
| waves?: {
|
| enable:
|
| | boolean
|
| | {
|
| desktop: boolean;
|
| mobile: boolean;
|
| };
|
| };
|
| };
|
|
|
| overlay?: {
|
| zIndex?: number;
|
| opacity?: number;
|
| blur?: number;
|
| };
|
| };
|
|
|
|
|
| export type AdConfig = {
|
| title?: string;
|
| content?: string;
|
| image?: {
|
| src: string;
|
| alt?: string;
|
| link?: string;
|
| external?: boolean;
|
| };
|
| link?: {
|
| text: string;
|
| url: string;
|
| external?: boolean;
|
| };
|
| padding?: {
|
| top?: string;
|
| right?: string;
|
| bottom?: string;
|
| left?: string;
|
| all?: string;
|
| };
|
| closable?: boolean;
|
| displayCount?: number;
|
| expireDate?: string;
|
| };
|
|
|
|
|
| export type FriendLink = {
|
| title: string;
|
| imgurl: string;
|
| desc: string;
|
| siteurl: string;
|
| tags?: string[];
|
| weight: number;
|
| enabled: boolean;
|
| };
|
|
|
| export type FriendsPageConfig = {
|
| columns: 2 | 3;
|
| };
|
|
|
|
|
| export type MusicPlayerConfig = {
|
|
|
| mode?: "meting" | "local";
|
|
|
|
|
| volume?: number;
|
|
|
|
|
| playMode?: "list" | "one" | "random";
|
|
|
|
|
| showLyrics?: boolean;
|
|
|
|
|
| showInNavbar?: boolean;
|
|
|
|
|
| meting?: {
|
|
|
| api?: string;
|
|
|
|
|
| server?: "netease" | "tencent" | "kugou" | "xiami" | "baidu";
|
|
|
|
|
| type?: "song" | "playlist" | "album" | "search" | "artist";
|
|
|
|
|
| id?: string;
|
|
|
|
|
| auth?: string;
|
|
|
|
|
| fallbackApis?: string[];
|
| };
|
|
|
|
|
| local?: {
|
| playlist?: Array<{
|
| name: string;
|
| artist: string;
|
| url: string;
|
| cover?: string;
|
| lrc?: string;
|
| }>;
|
| };
|
| };
|
|
|
|
|
| export type SponsorMethod = {
|
| name: string;
|
| icon?: string;
|
| qrCode?: string;
|
| link?: string;
|
| description?: string;
|
| enabled: boolean;
|
| };
|
|
|
|
|
| export type SponsorItem = {
|
| name: string;
|
| amount?: string;
|
| date?: string;
|
| message?: string;
|
| };
|
|
|
|
|
| export type SponsorConfig = {
|
| title?: string;
|
| description?: string;
|
| usage?: string;
|
| methods: SponsorMethod[];
|
| sponsors?: SponsorItem[];
|
| showSponsorsList?: boolean;
|
| showButtonInPost?: boolean;
|
| };
|
|
|
|
|
| export type ResponsiveImageLayout = "constrained" | "full-width" | "none";
|
|
|
|
|
| export type ImageFormat = "avif" | "webp" | "png" | "jpg" | "jpeg" | "gif";
|
|
|