Skip to content
Open

1 #39

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NOTION_PAGE_ID=9fd80f60b1d54dcfa893db9da14b1a6f
NOTION_SPACES_ID=fff2d8331ef0811dbf54000c3df82816
TELEGRAM_TOKEN=
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

123 changes: 60 additions & 63 deletions blog.config.js
Original file line number Diff line number Diff line change
@@ -1,82 +1,79 @@
const BLOG = {
title: 'Notionic',
author: '左蓝',
email: 'i@zuolan.me',
link: 'https://zuolan.me',
newsletter: 'Notionic Weekly',
description: 'A static blog build on top of Notion and Next.js',
lang: 'en-US', // ['en-US', 'zh-CN', 'zh-HK', 'zh-TW', 'ja-JP', 'es-ES']
timezone: 'Asia/Shanghai', // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for all options.
appearance: 'auto', // ['light', 'dark', 'auto'],
font: 'sans-serif', // ['sans-serif', 'serif']
lightBackground: '#F6F8FA', // use hex value, don't forget '#' e.g #fffefc
darkBackground: '#212936', // use hex value, don't forget '#'
path: '', // leave this empty unless you want to deploy Notionic in a folder
since: 2022, // If leave this empty, current year will be used.
postsPerPage: 10,
sortByDate: true,
pagesShow: {
title: '810C', // 博客的标题
author: 'FuHeng', // 博主的名字
email: '2827162018@qq.com', // 博主的电子邮件
link: 'https://810C.cn', // 博客链接
newsletter: 'Notionic Weekly', // 新闻订阅的名称
description: 'FuHeng的个人博客', // 博客的描述
lang: 'zh-CN', // 博客语言,支持多种语言
timezone: 'Asia/Shanghai', // 时区设置
appearance: 'auto', // 外观模式,支持亮色、暗色和自动模式
font: 'sans-serif', // 字体类型,可选择无衬线或有衬线字体
lightBackground: '#F6F8FA', // 亮色背景的十六进制颜色值
darkBackground: '#212936', // 暗色背景的十六进制颜色值
path: '', // 部署时的路径,默认为空即根路径
since: 2022, // 博客开始年份,如果留空则使用当前年份
postsPerPage: 10, // 每页显示的文章数量
sortByDate: true, // 是否按日期排序
pagesShow: { // 控制哪些页面显示
newsletter: true,
notes: true,
notes: false,
projects: true,
contact: true,
books: true,
friends: true
},
showWeChatPay: true,
previewImagesEnabled: true,
autoCollapsedNavBar: false, // The automatically collapsed navigation bar
ogImageGenerateHost: 'og-zl.vercel.app', // The link to generate OG image, don't end with a slash
defaultCover: '/cover.jpg',
socialLink: {
twitter: 'https://twitter.com/izuolan',
github: 'https://github.com/izuolan',
telegram: 'https://t.me/zuolan'
showWeChatPay: true, // 是否显示微信支付选项
previewImagesEnabled: true, // 是否启用预览图像
autoCollapsedNavBar: false, // 导航栏是否自动折叠
ogImageGenerateHost: 'og-zl.vercel.app', // 生成OG图像的链接
defaultCover: '/cover.jpg', // 默认封面图片路径
socialLink: { // 社交媒体链接
twitter: '', // Twitter链接
github: '', // GitHub链接
telegram: '' // Telegram链接
},
seo: {
keywords: ['Notionic', 'Zuolan', 'Blog'],
googleSiteVerification: '' // Remove the value or replace it with your own google site verification code
seo: { // SEO设置
keywords: ['Notionic', 'Zuolan', 'Blog'], // 关键词
googleSiteVerification: '' // Google站点验证代码
},
notionPageId: process.env.NOTION_PAGE_ID, // DO NOT CHANGE THIS! Edit .env file!
notionSpacesId: process.env.NOTION_SPACES_ID, // DO NOT CHANGE THIS! Edit .env file!
notionAccessToken: process.env.NOTION_ACCESS_TOKEN, // Useful if you prefer not to make your database public
notionDomain: 'izuolan.notion.site',
telegramToken: process.env.TELEGRAM_TOKEN, // The token of your Telegram bot
telegramChatId: '263895784', // The chat id of your Telegram bot
telegramChannelUrl: 'https://channel.zuolan.me/', // The link of your Telegram channel
telegramChannelName: 'zuolan_me', // The name of your Telegram channel
craftConfigShareUrl: 'https://www.craft.do/s/kQtcWqkv98cHhB', // The link to share your craft config
analytics: {
provider: '', // Currently we support Google Analytics, Ackee, Umami and Cloudflare Insights, please fill with 'ga' or 'ackee' or 'umami' or 'cf', leave it empty to disable it.
ackeeConfig: {
tracker: '', // e.g 'https://ackee.example.com/tracker.js'
dataAckeeServer: '', // e.g https://ackee.example.com , don't end with a slash
domainId: '' // e.g '0e2257a8-54d4-4847-91a1-0311ea48cc7b'
notionPageId: process.env.NOTION_PAGE_ID, // Notion页面ID,需在.env文件中设置
notionSpacesId: process.env.NOTION_SPACES_ID, // Notion空间ID,需在.env文件中设置
notionAccessToken: process.env.NOTION_ACCESS_TOKEN, // Notion访问令牌,用于私有数据库
notionDomain: 'fuheng-blog.notion.site', // Notion域名
telegramChannelUrl: 'https://channel.zuolan.me/', // Telegram频道链接
telegramChannelName: 'zuolan_me', // Telegram频道名称
craftConfigShareUrl: 'https://www.craft.do/s/kQtcWqkv98cHhB', // Craft配置分享链接
analytics: { // 分析设置
provider: '', // 可选分析提供者: Google Analytics, Ackee, Umami, Cloudflare Insights
ackeeConfig: { // Ackee配置
tracker: '', // Ackee跟踪器URL
dataAckeeServer: '', // Ackee数据服务器URL
domainId: '' // Ackee域ID
},
cfConfig: {
scriptUrl: 'https://static.cloudflareinsights.com/beacon.min.js', // Default
token: '' // Like '{"token": "xxxxxxxxxxxxxxxxxx"}'
cfConfig: { // Cloudflare配置
scriptUrl: 'https://static.cloudflareinsights.com/beacon.min.js', // Cloudflare默认跟踪脚本
token: '' // Cloudflare令牌
},
gaConfig: {
measurementId: '' // e.g: G-XXXXXXXXXX
gaConfig: { // Google Analytics配置
measurementId: '' // Google测量ID
},
umamiConfig: {
scriptUrl: '', // The url of your Umami script
websiteId: '' // The website id of your Umami instance
umamiConfig: { // Umami配置
scriptUrl: '', // Umami脚本URL
websiteId: '' // Umami网站ID
}
},
comment: {
// support provider: utterances, supacomments
provider: '', // leave it empty if you don't need any comment plugin
supaCommentsConfig: {
supabaseUrl: '', // The url of your Supabase instance
supabaseAnonKey: '' // The anonymous key of your Supabase instance
comment: { // 评论设置
provider: '', // 支持的评论提供者,可以为空
supaCommentsConfig: { // SupaComments配置
supabaseUrl: '', // Supabase实例URL
supabaseAnonKey: '' // Supabase匿名密钥
},
utterancesConfig: {
repo: ''
utterancesConfig: { // Utterances配置
repo: '' // GitHub仓库
}
},
isProd: process.env.VERCEL_ENV === 'production' // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables)
isProd: process.env.VERCEL_ENV === 'production' // 判断是否为生产环境
}
// export default BLOG
module.exports = BLOG
module.exports = BLOG // 导出博客配置
31 changes: 16 additions & 15 deletions components/Common/Logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
import * as React from 'react'

const Logo = (props) => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='24'
height='24'
viewBox='0 0 100 100'
style={{
opacity: 1
}}
{...props}
>
<g transform='translate(0.000000,100) scale(0.080000,-0.080000)'>
<path d='M762 1203 c-6 -15 -13 -46 -17 -68 -4 -22 -13 -49 -20 -61 -15 -23 -122 -69 -257 -109 -49 -14 -88 -28 -88 -29 0 -2 33 -20 73 -40 49 -24 87 -36 115 -36 28 0 42 -4 42 -13 0 -34 -295 -517 -390 -639 -40 -52 -4 -28 86 56 49 46 105 109 124 141 19 31 64 98 100 148 77 108 125 186 173 283 20 39 46 78 59 86 13 8 69 34 126 58 107 45 118 57 110 111 -3 21 -10 25 -78 34 l-75 10 -5 45 c-5 42 -7 45 -36 48 -26 3 -33 -1 -42 -25z' />
<path d='M754 616 c-40 -19 -88 -39 -108 -46 -43 -14 -45 -30 -7 -72 25 -28 33 -31 80 -30 39 1 54 -3 58 -15 7 -18 -30 -140 -58 -192 -36 -67 6 -93 135 -84 l86 6 0 -26 c0 -14 -4 -37 -10 -51 -5 -14 -8 -26 -6 -26 7 0 110 68 129 85 11 10 17 30 17 60 0 62 -22 70 -150 57 -52 -5 -98 -6 -103 -2 -4 3 3 31 16 61 13 30 32 78 42 108 10 30 28 70 41 89 26 38 30 63 14 93 -17 31 -91 25 -176 -15z' />
</g>
</svg>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="35.000000pt" height="35.000000pt" viewBox="0 0 35.000000 35.000000"
preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,35.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M95 305 c-24 -23 -25 -29 -25 -160 l0 -135 25 0 c24 0 25 2 25 70 l0
70 55 0 55 0 0 -35 c0 -36 -20 -55 -59 -55 -16 0 -21 -6 -21 -26 0 -25 2 -26
42 -21 26 3 51 15 67 31 25 25 26 32 30 156 l3 130 -31 0 -31 0 0 -65 0 -65
-56 0 -55 0 3 38 c3 36 4 37 46 40 37 3 42 6 42 28 0 22 -4 24 -45 24 -35 0
-52 -6 -70 -25z"/>
</g>
</svg>



)

export default Logo
132 changes: 0 additions & 132 deletions components/ContactForm.js

This file was deleted.

19 changes: 4 additions & 15 deletions lib/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const lang = {
NOTES: '笔记',
NEWSLETTER: '周刊',
BOOKS: '书架',
CONTACT: '私信'
CONTACT: '联系'
},
PAGINATION: {
PREV: '上一页',
Expand All @@ -18,7 +18,7 @@ export const lang = {
LAYOUT: {
NOTICE_TEXT: '对于本文内容有任何疑问, 可与我联系.',
PAY_BUTTON: '微信赞赏',
NOTICE_BUTTON: '一键私信',
NOTICE_BUTTON: '联系我',
COMMENT_TITLE: '评论区'
},
SEARCH: {
Expand All @@ -28,7 +28,7 @@ export const lang = {
},
HERO: {
HOME: {
CONTACT_BUTTON: '一键私信',
CONTACT_BUTTON: '联系我',
CONTACT_BUTTON_DES: '快速与我联系',
RSS_BUTTON: '订阅博客'
},
Expand All @@ -44,18 +44,7 @@ export const lang = {
RSS_BUTTON_COPIED: '已复制',
RSS_BUTTON_DES_COPIED: '已复制 RSS 链接'
},
CONTACT: {
TITLE: '一键私信',
DESCRIPTION: '如有疑问或建议需与我联系, 请填写下面表单.',
TG_DESCRIPTION: '也可直接联系 Telegram: ',
SUCCESS_MESSAGE: '消息已发送, 我会尽快回复到你的邮箱.',
FORM_USERNAME: '你的昵称',
FORM_EMAIL: '你的邮箱*',
FORM_CONTENT: '消息内容',
SEND_BUTTON: '发送',
FORM_EMAIL_REQUIRED: '*可以填写其他有效联系方式',
FAILED_MESSAGE: '抱歉, 发送失败, 请直接联系我的 Telegram 吧.'
},

FOOTER: {
COPYRIGHT_START: '本站原创内容基于 ',
COPYRIGHT_NAME: 'CC BY-SA 4.0',
Expand Down
22 changes: 0 additions & 22 deletions pages/api/sendtotg.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,2 @@
import BLOG from '@/blog.config'

export default async function sendtotg(req, res) {
const TG_TOKEN = BLOG.telegramToken
const TG_CHAT_ID = BLOG.telegramChatId
const tgUrl = 'https://api.telegram.org/bot' + TG_TOKEN + '/sendMessage'
const init = {
method: 'POST',
headers: {
'content-type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({
chat_id: TG_CHAT_ID,
text: req.body
})
}
const response = await fetch(tgUrl, init)
if (response.status === 200) {
// const respText = await response.text()
res.send({ status: 'Success' })
} else {
res.send({ status: 'Fail to send message to Telegram' })
}
}
Loading