|
1 |
| -const BLOG = { |
2 |
| - title: '小唐笔记', // 站点标题 |
3 |
| - description: '分享编程技术与记录生活', // 站点描述 |
4 |
| - author: 'tangly1024', // 作者 |
5 |
| - bio: '一个普通的干饭人🍚', // 作者简介 |
6 |
| - email: '[email protected]', // 联系邮箱 |
7 |
| - link: 'https://tangly1024.com', // 网站地址 |
8 |
| - keywords: ['Notion', '写作', '博客'], // 网站关键词 |
9 |
| - lang: 'zh-CN', // ['zh-CN','en-US'] default lang => see /lib/lang.js for more. |
10 |
| - beian: '闽ICP备20010331号', // 备案号 |
11 |
| - notionPageId: process.env.NOTION_PAGE_ID || 'bee1fccfa3bd47a1a7be83cc71372d83', // Important page_id!!! |
12 |
| - notionAccessToken: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public |
13 |
| - appearance: 'auto', // ['light', 'dark', 'auto'], |
14 |
| - font: 'font-serif tracking-wider subpixel-antialiased', // 文章字体 ['font-sans', 'font-serif', 'font-mono'] @see https://www.tailwindcss.cn/docs/font-family |
15 |
| - lightBackground: '#eeeeee', // use hex value, don't forget '#' e.g #fffefc |
16 |
| - darkBackground: '#111827', // use hex value, don't forget '#' |
17 |
| - path: '', // leave this empty unless you want to deploy in a folder |
18 |
| - since: 2020, // if leave this empty, current year will be used. |
19 |
| - postListStyle: 'page', // ['page','scroll] 文章列表样式:页码分页、单页滚动加载 |
20 |
| - postsPerPage: 6, // post counts per page |
21 |
| - previewLines: 12, // 预览博客行数 |
22 |
| - sortByDate: false, |
23 |
| - socialLink: { // 社交链接,如不需要展示可以留空白,例如 weibo:'' |
24 |
| - weibo: 'https://weibo.com/tangly1024', |
25 |
| - twitter: 'https://twitter.com/troy1024_1', |
26 |
| - github: 'https://github.com/tangly1024', |
27 |
| - telegram: 'https://t.me/tangly_1024' |
28 |
| - }, |
29 |
| - comment: { // 评论插件,支持 gitalk, utterances, cusdis |
30 |
| - provider: 'gitalk', // 不需要则留空白 |
31 |
| - gitalkConfig: { |
32 |
| - repo: 'NotionNext', // The repository of store comments |
33 |
| - owner: 'tangly1024', |
34 |
| - admin: ['tangly1024'], |
35 |
| - clientID: process.env.GITALK_ID || 'be7864a16b693e256f8f', |
36 |
| - clientSecret: process.env.GITALK_SECRET || 'dbd0f6d9ceea8940f6ed20936b415274b8fe66a2', |
37 |
| - distractionFreeMode: false |
38 |
| - }, |
39 |
| - cusdisConfig: { |
40 |
| - appId: '445ba48e-f751-487f-b22f-cdbe3310d28f', // data-app-id |
41 |
| - host: 'https://cusdis.com', // data-host, change this if you're using self-hosted version |
42 |
| - scriptSrc: 'https://cusdis.com/js/cusdis.es.js' // change this if you're using self-hosted version |
43 |
| - }, |
44 |
| - utterancesConfig: { |
45 |
| - repo: 'tangly1024/NotionNext' |
46 |
| - }, |
47 |
| - gitter: '', // gitter聊天室 |
48 |
| - DaoVoiceId: '', // DaoVoice http://dashboard.daovoice.io/get-started |
49 |
| - TidioId: '' // https://www.tidio.com/ |
50 |
| - }, |
51 |
| - // --- 高级设置 |
52 |
| - analytics: { // 文章访问量统计 |
53 |
| - busuanzi: true, // 展示网站阅读量、访问数 see http://busuanzi.ibruce.info/ |
54 |
| - provider: 'ga', // 支持 Google Analytics and Ackee, please fill with 'ga' or 'ackee', leave it empty to disable it. |
55 |
| - baiduAnalytics: 'f683ef76f06bb187cbed5546f6f28f28', // e.g only need xxxxx -> https://hm.baidu.com/hm.js?[xxxxx] |
56 |
| - cnzzAnalytics: '', // 站长统计id only need xxxxxxxx -> https://s9.cnzz.com/z_stat.php?id=[xxxxxxxx]&web_id=[xxxxxxx] |
57 |
| - gaConfig: { |
58 |
| - measurementId: 'G-68EK0W049N' // e.g: G-XXXXXXXXXX |
59 |
| - }, |
60 |
| - ackeeConfig: { |
61 |
| - tracker: '', // e.g 'https://ackee.tangly1024.net/tracker.js' |
62 |
| - dataAckeeServer: '', // e.g https://ackee.tangly1024.net , don't end with a slash |
63 |
| - domainId: '' // e.g '0e2257a8-54d4-4847-91a1-0311ea48cc7b' |
64 |
| - } |
65 |
| - }, |
66 |
| - seo: { |
67 |
| - googleSiteVerification: '' // Remove the value or replace it with your own google site verification code |
68 |
| - }, |
69 |
| - googleAdsenseId: 'ca-pub-2708419466378217', // 谷歌广告ID |
| 1 | +// 注: 配置文件可以读取Vercel的环境变量,配置方式参考:https://docs.tangly1024.com/zh/features/personality |
| 2 | +const BLOG = mergeDeep(process.env, { |
| 3 | + TITLE: 'NotionNext BLOG', // 站点标题 |
| 4 | + DESCRIPTION: '这是一个由NotionNext生成的站点', // 站点描述 |
| 5 | + AUTHOR: 'tangly1024', // 作者 |
| 6 | + BIO: '一个普通的干饭人🍚', // 作者简介 |
| 7 | + LINK: 'https://tangly1024.com', // 网站地址 |
| 8 | + NOTION_PAGE_ID: '02ab3b8678004aa69e9e415905ef32a5', // Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5 |
| 9 | + NOTION_ACCESS_TOKEN: '', // Useful if you prefer not to make your database public |
| 10 | + KEYWORDS: 'Notion, 博客', // 网站关键词 英文逗号隔开 |
| 11 | + LANG: 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more. |
| 12 | + BEI_AN: '', // 备案号 闽ICP备XXXXXXX |
| 13 | + SINCE: 2020, // if leave this empty, current year will be used. |
| 14 | + |
| 15 | + APPEARANCE: 'auto', // ['light', 'dark', 'auto'], |
| 16 | + FONT: 'font-serif tracking-wider subpixel-antialiased', // 文章字体 ['font-sans', 'font-serif', 'font-mono'] @see https://www.tailwindcss.cn/docs/font-family |
| 17 | + BACKGROUND_LIGHT: '#eeeeee', // use hex value, don't forget '#' e.g #fffefc |
| 18 | + BACKGROUND_DARK: '#111827', // use hex value, don't forget '#' |
| 19 | + PATH: '', // leave this empty unless you want to deploy in a folder |
| 20 | + |
| 21 | + POST_LIST_STYLE: 'page', // ['page','scroll] 文章列表样式:页码分页、单页滚动加载 |
| 22 | + POST_PREVIEW_LINES: 12, // 预览博客行数 |
| 23 | + POSTS_PER_PAGE: 6, // post counts per page |
| 24 | + POSTS_SORT_BY_DATE: false, // 是否强制按时间排序,否则默认由notion排序文章 |
| 25 | + |
| 26 | + // 社交链接,不需要可留空白,例如 CONTACT_WEIBO:'' |
| 27 | + CONTACT_EMAIL: '[email protected]', // 联系邮箱 |
| 28 | + CONTACT_WEIBO: 'https://weibo.com/tangly1024', |
| 29 | + CONTACT_TWITTER: 'https://twitter.com/troy1024_1', |
| 30 | + CONTACT_GITHUB: 'https://github.com/tangly1024', |
| 31 | + CONTACT_TELEGRAM: 'https://t.me/tangly_1024', |
| 32 | + |
| 33 | + COMMENT_PROVIDER: '', // 支持 gitalk, utterances, cusdis |
| 34 | + |
| 35 | + COMMENT_GITALK_REPO: '', // e.g NotionNext |
| 36 | + COMMENT_GITALK_OWNER: '', // e.g tangly1024 |
| 37 | + COMMENT_GITALK_ADMIN: '', // e.g 'tangly1024' |
| 38 | + COMMENT_GITALK_CLIENT_ID: '', |
| 39 | + COMMENT_GITALK_CLIENT_SECRET: '', |
| 40 | + COMMENT_GITALK_DISTRACTION_FREE_MODE: false, |
| 41 | + |
| 42 | + COMMENT_CUSDIS_APP_ID: '', // data-app-id |
| 43 | + COMMENT_CUSDIS_HOST: 'https://cusdis.com', // data-host, change this if you're using self-hosted version |
| 44 | + COMMENT_CUSDIS_SCRIPT_SRC: 'https://cusdis.com/js/cusdis.es.js', // change this if you're using self-hosted version |
| 45 | + |
| 46 | + COMMENT_UTTERRANCES_REPO: '', // e.g 'tangly1024/NotionNext' |
| 47 | + |
| 48 | + COMMENT_GITTER_ENABLE: false, // gitter see https://gitter.im/ |
| 49 | + COMMENT_GITTER_ROOM: '', // gitter聊天室 |
| 50 | + |
| 51 | + COMMENT_DAO_VOICE_ENABLE: false, // DaoVoice see http://dashboard.daovoice.io/get-started |
| 52 | + COMMENT_DAO_VOICE_ID: '', // DaoVoice http://dashboard.daovoice.io/get-started |
| 53 | + |
| 54 | + COMMENT_TIDIO_ENABLE: false, // https://www.tidio.com/ |
| 55 | + COMMENT_TIDIO_ID: '', // [tidio_id] -> //code.tidio.co/[tidio_id].js |
| 56 | + |
| 57 | + // 站点统计 |
| 58 | + |
| 59 | + ANALYTICS_BUSUANZI_ENABLE: true, // 展示网站阅读量、访问数 see http://busuanzi.ibruce.info/ |
| 60 | + |
| 61 | + ANALYTICS_BAIDU_ENABLE: false, |
| 62 | + ANALYTICS_BAIDU_ID: '', // e.g 只需要填写百度统计的id,[baidu_id] -> https://hm.baidu.com/hm.js?[baidu_id] |
| 63 | + |
| 64 | + ANALYTICS_CNZZ_ENABLE: false, |
| 65 | + ANALYTICS_CNZZ_ID: '', // 只需要填写站长统计的id, [cnzz_id] -> https://s9.cnzz.com/z_stat.php?id=[cnzz_id]&web_id=[cnzz_id] |
| 66 | + |
| 67 | + ANALYTICS_GOOGLE_ENABLE: false, |
| 68 | + ANALYTICS_GOOGLE_ID: '', // 谷歌Analytics的id e.g: G-XXXXXXXXXX |
| 69 | + |
| 70 | + ANALYTICS_ACKEE_ENABLE: false, |
| 71 | + ANALYTICS_ACKEE_TRACKER: '', // e.g 'https://ackee.tangly1024.net/tracker.js' |
| 72 | + ANALYTICS_ACKEE_DATA_SERVER: '', // e.g https://ackee.tangly1024.net , don't end with a slash |
| 73 | + ANALYTICS_ACKEE_DOMAIN_ID: '', // e.g '0e2257a8-54d4-4847-91a1-0311ea48cc7b' |
| 74 | + |
| 75 | + SEO_GOOGLE_SITE_VERIFICATION: '', // Remove the value or replace it with your own google site verification code |
| 76 | + |
| 77 | + GOOGLE_ADSENSE_ENABLE: false, |
| 78 | + GOOGLE_ADSENSE_ID: process.env.GOOGLE_AD_ID, // 谷歌广告ID |
70 | 79 | isProd: process.env.VERCEL_ENV === 'production'// distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables)
|
| 80 | +}) |
| 81 | + |
| 82 | +/** |
| 83 | + * 深度合并两个对象 |
| 84 | + * @param target |
| 85 | + * @param sources |
| 86 | + */ |
| 87 | +function mergeDeep (target, ...sources) { |
| 88 | + if (!sources.length) return target |
| 89 | + const source = sources.shift() |
| 90 | + |
| 91 | + if (isObject(target) && isObject(source)) { |
| 92 | + for (const key in source) { |
| 93 | + if (isObject(source[key])) { |
| 94 | + if (!target[key]) Object.assign(target, { [key]: {} }) |
| 95 | + mergeDeep(target[key], source[key]) |
| 96 | + } else { |
| 97 | + Object.assign(target, { [key]: source[key] }) |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + return mergeDeep(target, ...sources) |
| 102 | +} |
| 103 | + |
| 104 | +function isObject (item) { |
| 105 | + return (item && typeof item === 'object' && !Array.isArray(item)) |
71 | 106 | }
|
72 |
| -// export default BLOG |
| 107 | + |
73 | 108 | module.exports = BLOG
|
0 commit comments