Skip to content

Commit

Permalink
围绕heo样式进行部分修补
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiehsu66 committed Sep 11, 2024
1 parent 74fef37 commit fff943a
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 56 deletions.
36 changes: 18 additions & 18 deletions blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const BLOG = {
// Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5
NOTION_PAGE_ID:
process.env.NOTION_PAGE_ID ||
'02ab3b8678004aa69e9e415905ef32a5,en:7c1d570661754c8fbc568e00a01fd70e',
'9747d0e49394481e8e04dd962f80d964,en:9747d0e49394481e8e04dd962f80d964',
PSEUDO_STATIC: process.env.NEXT_PUBLIC_PSEUDO_STATIC || false, // 伪静态路径,开启后所有文章URL都以 .html 结尾。
NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新内容缓存间隔 单位(秒);即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。
THEME: process.env.NEXT_PUBLIC_THEME || 'simple', // 当前主题,在themes文件夹下可找到所有支持的主题;主题名称就是文件夹名,例如 example,fukasawa,gitbook,heo,hexo,landing,matery,medium,next,nobelium,plog,simple
THEME: process.env.NEXT_PUBLIC_THEME || 'hexo', // 当前主题,在themes文件夹下可找到所有支持的主题;主题名称就是文件夹名,例如 example,fukasawa,gitbook,heo,hexo,landing,matery,medium,next,nobelium,plog,simple
THEME_SWITCH: process.env.NEXT_PUBLIC_THEME_SWITCH || false, // 是否显示切换主题按钮
LANG: process.env.NEXT_PUBLIC_LANG || 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more.
SINCE: process.env.NEXT_PUBLIC_SINCE || 2021, // e.g if leave this empty, current year will be used.
Expand All @@ -24,17 +24,17 @@ const BLOG = {

CUSTOM_MENU: process.env.NEXT_PUBLIC_CUSTOM_MENU || false, // 支持Menu 类型,从3.12.0版本起,各主题将逐步支持灵活的二级菜单配置,替代了原来的Page类型,此配置是试验功能、默认关闭。

AUTHOR: process.env.NEXT_PUBLIC_AUTHOR || 'NotionNext', // 您的昵称 例如 tangly1024
BIO: process.env.NEXT_PUBLIC_BIO || '一个普通的干饭人🍚', // 作者简介
LINK: process.env.NEXT_PUBLIC_LINK || 'https://tangly1024.com', // 网站地址
AUTHOR: process.env.NEXT_PUBLIC_AUTHOR || 'eddie', // 您的昵称 例如 tangly1024
BIO: process.env.NEXT_PUBLIC_BIO || 'quantity,efficacy,quality', // 作者简介
LINK: process.env.NEXT_PUBLIC_LINK || 'https://www.binlog.com', // 网站地址
KEYWORDS: process.env.NEXT_PUBLIC_KEYWORD || 'Notion, 博客', // 网站关键词 英文逗号隔开

// 社交链接,不需要可留空白,例如 CONTACT_WEIBO:''
CONTACT_EMAIL: process.env.NEXT_PUBLIC_CONTACT_EMAIL || '', // 邮箱地址 例如[email protected]
CONTACT_WEIBO: process.env.NEXT_PUBLIC_CONTACT_WEIBO || '', // 你的微博个人主页
CONTACT_TWITTER: process.env.NEXT_PUBLIC_CONTACT_TWITTER || '', // 你的twitter个人主页
CONTACT_TWITTER: process.env.NEXT_PUBLIC_CONTACT_TWITTER || 'https://x.com/eddiehsu66', // 你的twitter个人主页
CONTACT_GITHUB: process.env.NEXT_PUBLIC_CONTACT_GITHUB || '', // 你的github个人主页 例如 https://github.com/tangly1024
CONTACT_TELEGRAM: process.env.NEXT_PUBLIC_CONTACT_TELEGRAM || '', // 你的telegram 地址 例如 https://t.me/tangly_1024
CONTACT_TELEGRAM: process.env.NEXT_PUBLIC_CONTACT_TELEGRAM || 'https://t.me/notez6', // 你的telegram 地址 例如 https://t.me/tangly_1024
CONTACT_LINKEDIN: process.env.NEXT_PUBLIC_CONTACT_LINKEDIN || '', // 你的linkedIn 首页
CONTACT_INSTAGRAM: process.env.NEXT_PUBLIC_CONTACT_INSTAGRAM || '', // 您的instagram地址
CONTACT_BILIBILI: process.env.NEXT_PUBLIC_CONTACT_BILIBILI || '', // B站主页
Expand Down Expand Up @@ -129,21 +129,21 @@ const BLOG = {
'/signup': 'LayoutSignUp'
},

CAN_COPY: process.env.NEXT_PUBLIC_CAN_COPY || true, // 是否允许复制页面内容 默认允许,如果设置为false、则全栈禁止复制内容。
CAN_COPY: process.env.NEXT_PUBLIC_CAN_COPY ||true, // 是否允许复制页面内容 默认允许,如果设置为false、则全栈禁止复制内容。
// 自定义右键菜单
CUSTOM_RIGHT_CLICK_CONTEXT_MENU:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU || true, // 自定义右键菜单,覆盖系统菜单
CUSTOM_RIGHT_CLICK_CONTEXT_MENU_THEME_SWITCH:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_THEME_SWITCH ||
true, // 是否显示切换主题
false, // 是否显示切换主题
CUSTOM_RIGHT_CLICK_CONTEXT_MENU_DARK_MODE:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_DARK_MODE || true, // 是否显示深色模式
CUSTOM_RIGHT_CLICK_CONTEXT_MENU_SHARE_LINK:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_SHARE_LINK || true, // 是否显示分享链接
CUSTOM_RIGHT_CLICK_CONTEXT_MENU_RANDOM_POST:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_RANDOM_POST || true, // 是否显示随机博客
CUSTOM_RIGHT_CLICK_CONTEXT_MENU_CATEGORY:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_CATEGORY || true, // 是否显示分类
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_CATEGORY || false, // 是否显示分类
CUSTOM_RIGHT_CLICK_CONTEXT_MENU_TAG:
process.env.NEXT_PUBLIC_CUSTOM_RIGHT_CLICK_CONTEXT_MENU_THEME_TAG || true, // 是否显示标签

Expand Down Expand Up @@ -202,10 +202,10 @@ const BLOG = {
BACKGROUND_DARK: '#000000', // use hex value, don't forget '#'
SUB_PATH: '', // leave this empty unless you want to deploy in a folder

POST_SHARE_BAR_ENABLE: process.env.NEXT_PUBLIC_POST_SHARE_BAR || 'true', // 文章分享功能 ,将在底部显示一个分享条
POST_SHARE_BAR_ENABLE: process.env.NEXT_PUBLIC_POST_SHARE_BAR || 'false', // 文章分享功能 ,将在底部显示一个分享条
POSTS_SHARE_SERVICES:
process.env.NEXT_PUBLIC_POST_SHARE_SERVICES ||
'link,wechat,qq,weibo,email,facebook,twitter,telegram,messenger,line,reddit,whatsapp,linkedin', // 分享的服務,按顺序显示,逗号隔开
'link', // 分享的服務,按顺序显示,逗号隔开
// 所有支持的分享服务:link(复制链接),wechat(微信),qq,weibo(微博),email(邮件),facebook,twitter,telegram,messenger,line,reddit,whatsapp,linkedin,vkshare,okshare,tumblr,livejournal,mailru,viber,workplace,pocket,instapaper,hatena

// 文章URL前缀
Expand All @@ -215,11 +215,11 @@ const BLOG = {
// 支援類似 WP 可自訂文章連結格式的功能:https://wordpress.org/documentation/article/customize-permalinks/,目前只先實作 %year%/%month%/%day%
// 例:如想連結改成前綴 article + 時間戳記,可變更為: 'article/%year%/%month%/%day%'

POST_LIST_STYLE: process.env.NEXT_PUBLIC_POST_LIST_STYLE || 'page', // ['page','scroll] 文章列表样式:页码分页、单页滚动加载
POST_LIST_STYLE: process.env.NEXT_PUBLIC_POST_LIST_STYLE || 'scroll', // ['page','scroll] 文章列表样式:页码分页、单页滚动加载
POST_LIST_PREVIEW: process.env.NEXT_PUBLIC_POST_PREVIEW || 'false', // 是否在列表加载文章预览
POST_PREVIEW_LINES: process.env.NEXT_PUBLIC_POST_POST_PREVIEW_LINES || 12, // 预览博客行数
POST_RECOMMEND_COUNT: process.env.NEXT_PUBLIC_POST_RECOMMEND_COUNT || 6, // 推荐文章数量
POSTS_PER_PAGE: process.env.NEXT_PUBLIC_POST_PER_PAGE || 12, // post counts per page
POST_PREVIEW_LINES: process.env.NEXT_PUBLIC_POST_POST_PREVIEW_LINES || 2, // 预览博客行数
POST_RECOMMEND_COUNT: process.env.NEXT_PUBLIC_POST_RECOMMEND_COUNT || 3, // 推荐文章数量
POSTS_PER_PAGE: process.env.NEXT_PUBLIC_POST_PER_PAGE || 5, // post counts per page
POSTS_SORT_BY: process.env.NEXT_PUBLIC_POST_SORT_BY || 'notion', // 排序方式 'date'按时间,'notion'由notion控制

POST_WAITING_TIME_FOR_404:
Expand Down Expand Up @@ -251,7 +251,7 @@ const BLOG = {
],

// 鼠标跟随特效
MOUSE_FOLLOW: process.env.NEXT_PUBLIC_MOUSE_FOLLOW || true, // 开关
MOUSE_FOLLOW: process.env.NEXT_PUBLIC_MOUSE_FOLLOW || false, // 开关
// 这两个只有在鼠标跟随特效开启时才生效
// 鼠标类型 1:路劲散点 2:下降散点 3:上升散点 4:边缘向鼠标移动散点 5:跟踪转圈散点 6:路径线条 7:聚集散点 8:聚集网格 9:移动网格 10:上升粒子 11:转圈随机颜色粒子 12:圆锥放射跟随蓝色粒子
MOUSE_FOLLOW_EFFECT_TYPE: 11, // 1-12
Expand Down Expand Up @@ -289,7 +289,7 @@ const BLOG = {
DIFY_CHATBOT_BASE_URL: process.env.NEXT_PUBLIC_DIFY_CHATBOT_BASE_URL || '',
DIFY_CHATBOT_TOKEN: process.env.NEXT_PUBLIC_DIFY_CHATBOT_TOKEN || '',
// 悬浮挂件
WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件
WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || false, // 是否显示宠物挂件
WIDGET_PET_LINK:
process.env.NEXT_PUBLIC_WIDGET_PET_LINK ||
'https://cdn.jsdelivr.net/npm/[email protected]/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models
Expand Down
2 changes: 1 addition & 1 deletion themes/heo/components/BlogPostListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import PaginationNumber from './PaginationNumber'
*/
const BlogPostListPage = ({ page = 1, posts = [], postCount, siteInfo }) => {
const { NOTION_CONFIG } = useGlobal()
const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', 12, NOTION_CONFIG)
const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG)
const totalPage = Math.ceil(postCount / POSTS_PER_PAGE)
const showPagination = postCount >= POSTS_PER_PAGE
const POST_TWO_COLS = siteConfig('HEO_HOME_POST_TWO_COLS', true, CONFIG)
Expand Down
2 changes: 1 addition & 1 deletion themes/heo/components/BlogPostListScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const BlogPostListScroll = ({
}) => {
const { locale, NOTION_CONFIG } = useGlobal()
const [page, updatePage] = useState(1)
const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', null, NOTION_CONFIG)
const POSTS_PER_PAGE = siteConfig('POSTS_PER_PAGE', 6, NOTION_CONFIG)
const postsToShow = getListByPage(posts, page, POSTS_PER_PAGE)

let hasMore = false
Expand Down
50 changes: 26 additions & 24 deletions themes/hexo/components/BlogPostListScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ const BlogPostListScroll = ({
if (!hasMore) return
updatePage(page + 1)
}
// 去除监听滚动,改为响应式
// // 监听滚动自动分页加载
// const scrollTrigger = () => {
// requestAnimationFrame(() => {
// const scrollS = window.scrollY + window.outerHeight
// const clientHeight = targetRef
// ? targetRef.current
// ? targetRef.current.clientHeight
// : 0
// : 0
// if (scrollS > clientHeight + 100) {
// handleGetMore()
// }
// })
// }

// 监听滚动自动分页加载
const scrollTrigger = () => {
requestAnimationFrame(() => {
const scrollS = window.scrollY + window.outerHeight
const clientHeight = targetRef
? targetRef.current
? targetRef.current.clientHeight
: 0
: 0
if (scrollS > clientHeight + 100) {
handleGetMore()
}
})
}

// 监听滚动
useEffect(() => {
window.addEventListener('scroll', scrollTrigger)
return () => {
window.removeEventListener('scroll', scrollTrigger)
}
})
// // 监听滚动
// useEffect(() => {
// window.addEventListener('scroll', scrollTrigger)
// return () => {
// window.removeEventListener('scroll', scrollTrigger)
// }
// })

const targetRef = useRef(null)
const { locale } = useGlobal()
Expand All @@ -78,12 +78,14 @@ const BlogPostListScroll = ({
))}
</div>

<div>
<div className = 'space-y-6 px-2'>
<div
onClick={() => {
handleGetMore()
}}
className='w-full my-4 py-4 text-center cursor-pointer rounded-xl dark:text-gray-200'>
className={`w-full my-4 py-4 text-center cursor-pointer rounded-xl font-semibold
${(hasMore ? 'bg-white text-black dark:text-white dark:bg-hexo-black-gray' : 'bg-gray-300 text-gray-700 cursor-not-allowed')}`}
>
{' '}
{hasMore ? locale.COMMON.MORE : `${locale.COMMON.NO_MORE}`}{' '}
</div>
Expand Down
2 changes: 1 addition & 1 deletion themes/hexo/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Footer = ({ title }) => {

return (
<footer
className='relative z-10 dark:bg-black flex-shrink-0 bg-hexo-light-gray justify-center text-center m-auto w-full leading-6 text-gray-600 dark:text-gray-100 text-sm p-6'
className='relative z-10 dark:bg-black flex-shrink-0 bg-hexo justify-center text-center m-auto w-full leading-6 text-gray-600 dark:text-gray-100 text-sm p-6'
>
{/* <DarkModeButton/> */}

Expand Down
6 changes: 3 additions & 3 deletions themes/hexo/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const Header = props => {
id='sticky-nav'
style={{ backdropFilter: 'blur(3px)' }}
className={
'top-0 duration-300 transition-all shadow-none fixed bg-none dark:bg-hexo-black-gray dark:text-gray-200 text-black w-full z-20 transform border-transparent dark:border-transparent'
'top-0 duration-300 transition-all shadow-none fixed bg-hexo dark:bg-hexo-black dark:text-gray-200 text-black w-full z-20 transform '
}>
<div className='w-full flex justify-between items-center px-4 py-2'>
<div className='flex'>
Expand All @@ -173,8 +173,8 @@ const Header = props => {
<i className='fas fa-bars' />
)}
</div>
{showSearchButton && <SearchButton />}
{showRandomButton && <ButtonRandomPost {...props} />}
{/* {showSearchButton && <SearchButton />} */}
{/* {showRandomButton && <ButtonRandomPost {...props} />} */}
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion themes/hexo/components/Logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const Logo = props => {
return (
<Link href='/' passHref legacyBehavior>
<div className='flex flex-col justify-center items-center cursor-pointer space-y-3'>
<div className='font-medium text-lg p-1.5 rounded dark:border-white dark:text-white menu-link transform duration-200'>
<div className='font-bold text-lg p-2 rounded dark:border-white dark:text-white menu-link transform duration-200'>
{' '}
<span className = 'text-2xl'>😼</span>
{' '}
{siteInfo?.title || siteConfig('TITLE')}
</div>
Expand Down
2 changes: 0 additions & 2 deletions themes/hexo/components/SideRight.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ export default function SideRight(props) {
</Card>
)}

<Announcement post={notice} />

{siteConfig('COMMENT_WALINE_SERVER_URL') &&
siteConfig('COMMENT_WALINE_RECENT') && <HexoRecentComments />}

Expand Down
10 changes: 5 additions & 5 deletions themes/hexo/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const CONFIG = {
HEXO_HOME_BANNER_ENABLE: true,
HEXO_HOME_BANNER_ENABLE: false,
// 3.14.1以后的版本中,欢迎语在blog.config.js中配置,用英文逗号','隔开多个。
HEXO_HOME_BANNER_GREETINGS: [
'Hi,我是一个程序员',
Expand All @@ -8,15 +8,15 @@ const CONFIG = {
'欢迎来到我的博客🎉'
], // 首页大图标语文字

HEXO_HOME_NAV_BUTTONS: true, // 首页是否显示分类大图标按钮
HEXO_HOME_NAV_BUTTONS: false, // 首页是否显示分类大图标按钮
// 已知未修复bug, 在移动端开启true后会加载不出图片; 暂时建议设置为false。
HEXO_HOME_NAV_BACKGROUND_IMG_FIXED: false, // 首页背景图滚动时是否固定,true 则滚动时图片不懂动; false则随鼠标滚动 ;
// 是否显示开始阅读按钮
HEXO_SHOW_START_READING: true,

// 菜单配置
HEXO_MENU_INDEX: true, // 显示首页
HEXO_MENU_CATEGORY: true, // 显示分类
HEXO_MENU_INDEX: false, // 显示首页
HEXO_MENU_CATEGORY: false, // 显示分类
HEXO_MENU_TAG: true, // 显示标签
HEXO_MENU_ARCHIVE: true, // 显示归档
HEXO_MENU_SEARCH: true, // 显示搜索
Expand All @@ -27,7 +27,7 @@ const CONFIG = {

HEXO_POST_LIST_COVER_DEFAULT: true, // 封面为空时用站点背景做默认封面
HEXO_POST_LIST_SUMMARY: true, // 文章摘要
HEXO_POST_LIST_PREVIEW: false, // 读取文章预览
HEXO_POST_LIST_PREVIEW: true, // 读取文章预览
HEXO_POST_LIST_IMG_CROSSOVER: true, // 博客列表图片左右交错

HEXO_ARTICLE_ADJACENT: true, // 显示上一篇下一篇文章推荐
Expand Down

0 comments on commit fff943a

Please sign in to comment.