Files
asky/asky.config.ts
T
2026-05-17 17:00:28 +08:00

491 lines
12 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Asky 主题配置文件
* ------------------------------------------------------------------
* 本文件等同于原 WordPress 主题 options.php 中的所有可配置项。
* 每个字段的 key 与原主题的 option id 完全一致,
* 因此在原 WP 后台「主题选项」里看到的设置项都可以在这里同步。
*
* 在 .astro / .ts 文件中使用:
* import { askyOption } from '~/lib/options';
* askyOption('admin_des');
* 也支持 :
* import config from '@config';
* config.admin_des;
*
* 文件结构:上半部分 = 实际设置项(直接编辑这里),
* 下半部分 = AskyConfig 类型定义(一般无需修改)。
* ------------------------------------------------------------------
*/
const config: AskyConfig = {
/* ===== 站点基本信息 ===== */
site: {
name: 'Asky',
// 站点名称(对应 WP `name`
description: '我们的征途是星辰大海',
// 站点描述(对应 WP `description`
url: 'https://example.com',
// 站点 URL(对应 WP `url`
language: 'zh-CN',
// 站点语言
charset: 'UTF-8',
// 字符集
menu: [
{ label: '首页', url: '/' },
{ label: '归档', url: '/archive' },
{ label: '链接', url: '/links' },
{ label: '关于', url: '/about' }
],
// 主导航菜单(对应原 wp_nav_menu 'primary' 位置)
links: [
{
title: '友情链接',
items: [
{
name: 'Asky',
url: 'https://github.com/saresam/Asky',
description: 'Asky WordPress 主题原版',
image: '/images/none.png'
},
{
name: 'Astro',
url: 'https://astro.build/',
description: '当前站点使用的静态站点框架',
image: '/images/none.png'
}
]
}
]
// 友情链接页面数据(对应原 WordPress 书签/链接分类)
},
/* ===== 基本设置 ===== */
theme_skin: '#FE9600',
// 主题风格颜色
akina_logo: '',
// Logo 图片 URL,最佳尺寸 242*150
akina_meta: false,
// 是否启用自定义关键词与描述
akina_meta_keywords: '',
// 网站关键词(半角逗号分隔,建议 5 个以内)
akina_meta_description: '',
// 网站描述(建议 120 字以内)
shownav: false,
// 是否默认展开导航菜单(false=收缩,true=展开)
patternimg: false,
// 文章/独立页面/分类页是否显示头部装饰图
top_search: 'yes',
// 顶部搜索按钮 'yes' | 'no'
post_list_style: 'imageflow',
// 首页文章风格:'standard'=标准,'imageflow'=图文
list_type: 'round',
// 首页文章特色图样式:'round'=圆角,'square'=直角
pagenav_style: 'ajax',
// 分页模式:'ajax'=ajax 加载,'np'=上一页/下一页
auto_load_post: '3600',
// 自动加载下一页延时(秒),'3600' 表示不自动加载
admin_des: '我们的征途是是星辰大海',
// 博主描述(一段自我介绍的话)
footer_info: '© 2025',
// 页脚版权信息,支持 HTML
site_custom_style: '',
// 自定义 CSS 样式(无需写 <style> 标签)
/* ===== 第一屏 ===== */
head_focus: false,
// 第一屏总开关:true=关闭,false=开启
focus_infos: false,
// 社交信息:true=关闭,false=开启(显示头像、签名、SNS)
focus_height: false,
// 全屏显示:true=关闭,false=开启
focus_amv: false,
// 开启视频背景
focus_mvlive: false,
// 开启视频-Live,视频自动续播(需开启 Pjax)
amv_url: 'https://cdn.moji.com/websrc/video',
// 视频地址前缀,将拼接下方视频名,地址尾部不要加斜杠
amv_title: 'spring20200311,summer20200618,autumn20190924,video621',
// 视频名称(多个用英文逗号分隔,加载时随机抽取)
focus_logo: '/images/avatar.jpg',
// 第一屏个人头像 URL,最佳高度 130px
head_notice: true,
// 开启公告
notice_title: '欢迎来到我的小站',
// 公告内容,超过 142 字节滚动显示(移动端无效)
'notice-cursor': '',
// 公告内容尾部光标文字
bgapi: 'https://www.loliapi.com/acg/',
// 背景图 API 地址(优先级 API > 随机背景图 > 默认)
focus_img_1: 'https://www.loliapi.com/acg/',
// 第一屏背景图 1,最佳尺寸 1920*1080
focus_img_2: '',
// 第一屏背景图 2,多张时随机显示
focus_img_3: '',
// 第一屏背景图 3
focus_img_4: '',
// 第一屏背景图 4
focus_img_5: '',
// 第一屏背景图 5
focus_img_filter: 'filter-nothing',
// 背景图滤镜:'filter-nothing'=无 / 'filter-undertint'=浅色 / 'filter-dim'=暗淡 / 'filter-grid'=网格
waveloop: false,
// 开启底部波浪动画
progress_type: 'progress_no',
// 进度条:'progress_no'=不需要,'loadprogress'=加载进度
/* ===== 文章页 ===== */
post_like: 'no',
// 文章点赞 'yes' | 'no' 此功能未实现
download_zan: false,
// 点击下载=点赞 未实现
post_share: 'yes',
// 文章分享 'yes' | 'no'
'toggle-menu': 'yes',
// 评论收缩 'yes' | 'no'
open_private_message: false,
// 允许私密评论(评论对其他人不可见)未实现
open_useragent: false,
// 显示评论者的 UA 信息(浏览器/操作系统)未实现
akina_server_key: '',
// 微信评论推送 Server 酱 Key 未实现
post_nepre: 'yes',
// 上一篇/下一篇导航 'yes' | 'no'
author_profile: 'yes',
// 博主信息卡片 'yes' | 'no'
alipay_code: '',
// 支付宝二维码图片地址
wechat_code: '',
// 微信打赏二维码图片地址
/* ===== 社交网络 ===== */
wechat: '',
// 微信公众号二维码图片地址
sina: '',
// 新浪微博 URL(带 http://
qq: '80116747',
// 腾讯 QQ 号(纯数字)
qzone: '',
// QQ 空间 URL(带 http://
github: 'https://github.com/jkjoy',
// GitHub URL
lofter: '',
// Lofter URL
bili: '',
// B 站 URL
youku: '',
// 优酷 URL
wangyiyun: '',
// 网易云音乐 URL
twitter: '',
// Twitter URL
facebook: '',
// Facebook URL
googleplus: '',
// Google+ URL
/* ===== 聚焦图 ===== */
top_feature: true,
// 是否开启顶部聚焦图区域
feature_title: '聚焦',
// 聚焦区标题
feature1_img: '/images/temp.jpg',
// 聚焦图 1(尺寸 257*160
feature1_title: 'feature1',
// 聚焦图 1 标题(建议 15 字内)
feature1_link: '#',
// 聚焦图 1 链接
feature2_img: '/images/temp.jpg',
// 聚焦图 2
feature2_title: 'feature2',
// 聚焦图 2 标题
feature2_link: '#',
// 聚焦图 2 链接
feature3_img: '/images/temp.jpg',
// 聚焦图 3
feature3_title: 'feature3',
// 聚焦图 3 标题
feature3_link: '#',
// 聚焦图 3 链接
/* ===== 系统相关 ===== */
poi_pjax: false,
// 开启 PJAX 局部刷新
classify_display: '',
// 首页不显示的分类 ID(半角逗号分隔)
image_category: '',
// 图片展示分类 ID(半角逗号分隔)
mail_user_name: 'poi',
// 发件地址前缀(用于系统邮件,不要使用中文) 未实现
open_prism_codelamp: true,
// 开启 Prism 代码高亮支持(配合 Pjax 时使用)
qiniu_cdn: '',
// 七牛图片 CDN,格式:http://子域名/wp-content/uploads
/* ===== 评论系统 (Twikoo) ===== */
twikoo: {
envId: 'https://t.ittst.com',
// Twikoo 云函数地址(envId)。例:'https://your-app.vercel.app/' —— 留空时关闭评论
region: '',
// 区域,仅腾讯云时填 'ap-shanghai',其他留空
avatarUrl: 'https://cravatar.cn/avatar/',
// 头像服务前缀(Gravatar 镜像)
showUa: true,
// 是否显示评论者的 UA 图标(OS / 浏览器)
showEmotion: true,
// 是否启用 Twikoo 表情面板
emotionCdn: ''
// Twikoo 表情 CDN,多个用英文逗号分隔(留空时读取 Twikoo 后台 EMOTION_CDN,仍为空则使用默认 OwO
},
/* ===== 杂七杂八 ===== */
canvas_nest: false,
// 开启蜂窝背景动效(屏幕宽度 >800px 时生效)
flying_fish: false,
// 底部跳动小鱼动效
web_title: false,
// 网站标题自动判断(窗口失焦/获焦切换标题)
onblur: '(つ ェ ⊂)我藏好了哦~',
// 失去焦点显示的标题
onfocus: '(*゜ロ゜)ノ被发现了~',
// 获得焦点显示的标题
echo_footer_time_log: 'no',
// 页脚显示加载耗时 'yes' | 'no'
web_runtime: true,
// 页脚显示网站运行时间
web_buildtime: '01/21/2017 17:00:00',
// 建站日期,格式:MM/DD/YYYY HH:mm:ss
site_statistics: '',
// 站长统计代码(将被隐藏插入)
site_statistics_link: '',
// 站长统计后台地址(页脚显示统计按钮)
site_map_link: ''
// 网站地图地址(Sitemap
};
export default config;
/* ============================================================
* 类型定义 —— 一般无需修改,仅供 IDE 智能提示与类型检查使用
* ============================================================ */
export interface AskyConfig {
/* ===== 站点基本信息(对应 WP bloginfo ===== */
site: {
name: string;
description: string;
url: string;
language: string;
charset: string;
menu: Array<{ label: string; url: string; children?: Array<{ label: string; url: string }> }>;
links?: Array<{
title: string;
description?: string;
items: Array<{
name: string;
url: string;
description?: string;
image?: string;
}>;
}>;
};
/* ===== 基本设置 ===== */
theme_skin: string;
akina_logo: string;
akina_meta: boolean;
akina_meta_keywords: string;
akina_meta_description: string;
shownav: boolean;
patternimg: boolean;
top_search: 'yes' | 'no';
post_list_style: 'standard' | 'imageflow';
list_type: 'round' | 'square';
pagenav_style: 'ajax' | 'np';
auto_load_post: '0' | '1' | '2' | '3' | '4' | '5' | '3600';
admin_des: string;
footer_info: string;
site_custom_style: string;
/* ===== 第一屏 ===== */
head_focus: boolean;
focus_infos: boolean;
focus_height: boolean;
focus_amv: boolean;
focus_mvlive: boolean;
amv_url: string;
amv_title: string;
focus_logo: string;
head_notice: boolean;
notice_title: string;
'notice-cursor': string;
bgapi: string;
focus_img_1: string;
focus_img_2: string;
focus_img_3: string;
focus_img_4: string;
focus_img_5: string;
focus_img_filter: 'filter-nothing' | 'filter-undertint' | 'filter-dim' | 'filter-grid';
waveloop: boolean;
progress_type: 'progress_no' | 'loadprogress';
/* ===== 文章页 ===== */
post_like: 'yes' | 'no';
download_zan: boolean;
post_share: 'yes' | 'no';
'toggle-menu': 'yes' | 'no';
open_private_message: boolean;
open_useragent: boolean;
akina_server_key: string;
post_nepre: 'yes' | 'no';
author_profile: 'yes' | 'no';
alipay_code: string;
wechat_code: string;
/* ===== 社交网络 ===== */
wechat: string;
sina: string;
qq: string;
qzone: string;
github: string;
lofter: string;
bili: string;
youku: string;
wangyiyun: string;
twitter: string;
facebook: string;
googleplus: string;
/* ===== 聚焦图 ===== */
top_feature: boolean;
feature_title: string;
feature1_img: string;
feature1_title: string;
feature1_link: string;
feature2_img: string;
feature2_title: string;
feature2_link: string;
feature3_img: string;
feature3_title: string;
feature3_link: string;
/* ===== 系统相关 ===== */
poi_pjax: boolean;
classify_display: string;
image_category: string;
mail_user_name: string;
open_prism_codelamp: boolean;
qiniu_cdn: string;
/* ===== 评论系统 (Twikoo) ===== */
twikoo: {
envId: string;
region?: string;
avatarUrl?: string;
showUa?: boolean;
showEmotion?: boolean;
emotionCdn?: string;
};
/* ===== 杂七杂八 ===== */
canvas_nest: boolean;
flying_fish: boolean;
web_title: boolean;
onblur: string;
onfocus: string;
echo_footer_time_log: 'yes' | 'no';
web_runtime: boolean;
web_buildtime: string;
site_statistics: string;
site_statistics_link: string;
site_map_link: string;
}