本文最后更新于:1 个月前
写在前面 我们演示使用 Hexo 静态站点生成器 快速搭建个人博客,并使用 Gitee / GitHub 托管 静态站点。
2024 年 8 月 9 日
自从昨天晚上优化完毕博客所有首页图片之后,都由不得每天想点开多看两眼这全新的博客界面。
建站五百多天,也是时候给这篇博客栏目添加一些新鲜血液了,从来没有正式介绍过我的个人博客 - Memory‘s Blog。
我是从去年六月初开始在个人博客上着手记录个人生活的,到现在也有十四个月了,时间过得真快。
一年多的生活记录,每天的日常生活我都会尽量记录在《我的编程生活之旅》栏目中,事无巨细。
简直无法想象没有成功搭建个人博客之前,我的生活到底是怎样的。
有太多有趣的事情没有记录下来,有太多值得纪念的瞬间慢慢在脑海中消散,而自己对此却全然不知。
遗憾是人生之常事,但如果选择忘记甚至是丢弃自己曾经拥有过的那些快乐时光,那无疑是最大的遗憾。
我在今年一月份创建的全新栏目《岁月如歌:我的人生回忆录》,那天早上我第一次意识到原来我的过去也是那么精彩,那么值得回味。
仅仅是因为那些是过去的事情就不值得怀恋了吗,恰恰是那些曾经我经历过的事情,才最终成就了今天完整的我。
上个月应该是九号左右的某个晚上,在我兄弟的陪伴下,我躺在床上梦呓般地回顾了我短暂又精彩绝伦的上半年。
又过了半个多月,我俩又不禁回忆起过去十几年的岁月,同上学时期经常聊起小时候那般,我来聊起了上学的那段时光。
为什么当时不能主动点呢,我简直受不了三五年前唯唯诺诺的我自己,我兄弟也是一样的。
现在回忆起以前那些受尽“苦难”的生活,有时候竟会觉得滑稽可笑,看来只要时间过得足够久,连自己都没那么容易相信和理解自己了。
但那些日子又何尝不精彩呢,我恨不得用现在就用文字把它们记录下来,把我身上发生过的所有故事都写下来,因为那才是真正的我啊。
整理成册,在我老去的时候,在一个平平无奇的下午茶时间,拉出一把躺椅躺上去慢慢翻看,回顾我这短暂又充实的一生。
写下去吧,这个信念要贯穿几十年的岁月。
希望在十年后某一个闲适的下午,我还能坐在电脑桌前,用心品读自己曾经写下的平凡故事。
翻看一篇文章,续写下去,看看十年的岁月是否让我的初心改变。
十年后的我已然不在年轻,十年后的我可能对生活缺少了更多的激情,十年后的我也许找到的生活全新的意义。
十年的岁月不会改变我的初心,更不会消磨我的勇气。
二零二四年八月九日下午三点三分,我热烈期盼那一天的到来。
期待那一天的到来。
正文 博客搭建 前言 常见的博客站点生成器有很多,最主要的有俩:Hexo 和 Hugo
那我们就先使用 Hexo 来搭建了
Hexo 是一个静态博客站点生成工具,可以把 Markdown 格式的文档转换成静态页面,非常适合用来作个人技术博客
其实所有的搭建流程上官网就能找到,跟着文档一步一步来也能完成,那我们这个笔记就是要教会你快速完成初始搭建
先放几个辅助资源:
各站点生成器的入口:Static Site Generators - Top Open Source SSGs | Jamstack
Hexo 官网:建站 | Hexo
准备工作 使用 Hexo 搭建博客前要做的准备(这里不细讲)
也没别的,就两点:Node.js 和 Git
有关 Node.js 环境安装及相关知识,可以移步至《配置指南-掌握 Node-js 配置》一文中进行相关了解
有关 Git 基础知识,可以移步至《入门指南:掌握 Git 的基本操作及进阶学习》一文中进行相关了解
建站
全局安装 hexo-cli(这玩意儿是个构建工具,就是用来安装 hexo 的)
1 npm install --save hexo-theme-fluid
如你所见,_config.yml 就是全局配置文件,我们建议复制一个_config.fluid.yml 拷贝初始配置,然后在_config.yml 里大刀阔斧地修改
至此,基本的 hexo 博客站点搭建完成
主题不好看,接下来我们着手配置主题
主题配置 默认主题 这里可以在 hexo 官方文档里详细了解,修改默认主题定制特色主题
第三方主题 这里推荐一个 Hexo 搭建个人博客教程:Hexo 全过程记录 从 Centos 到 Fluid - IRIDIUM-SUB - 博客园 (cnblogs.com)
这个教程超级详细,从博客的搭建到主题配置介绍一应俱全,非常值得一看
比起默认主题,我会更加建议使用第三方主题,更加优秀和美观
这里会简单地涉及到如何安装各式各样的主题,详细的主题配置请前往《大道至简:快速搭建博客与文档站点的终极指南 3-0》一文中学习
各站点生成器的入口:Static Site Generators - Top Open Source SSGs | Jamstack
在这个网站下,进入 Hexo 主题选择(都是人家写好的,会拉下来,拿来用就行),这里拿 fluid 主题举例
看文档,按部就班地走就行:
执行下以下命令,成功访问到 fluid 主题的博客页面了,效果如下:
这个静态页面是由 Hexo 帮我们在本地搭建了一个 Web 服务,来支持我们访问的,适用于开发环境下的调试
实际生产过程中,我们需要把它部署到 Nginx 服务器上,方法也非常简单,
每个主题都有好多配置,那我们总要配置自己的特色主题吧?改成我们自己喜欢的,那就执行下面这行命令:
这时 theme 文件夹下找到一个_config.yml 文件(往下找几层),这里我们就能自由配置、定制主题了
详细的页面配置、主题配置在《大道至简:快速搭建博客与文档站点的终极指南 3-0》一文中有所介绍,可跳转阅读
下面放上我的博客访问地址以及具体的页面效果:
使用 Hexo 搭建个人博客站点教程结束(2023/05/27 晚)
2024 年 4 月 11 日
一年时间一晃而过,这么快就 2024 年四月份了,我的个人博客网站也在不断地充实。
截至二零二四年二月二十七日,下午四时四十五分,我的个人博客共有七十余篇博文,总计九百余张图片、五十余万文字
我的个人博客网站博文更新到七十五篇了!
再展示一下现在的博客吧:s
晚风几许撩人意,夕阳半刻醉人心
2024 年 8 月 8 日
一晃又是四个多月,截至今晚:
二零二四年八月八日晚十点十三分,所有八十三篇博文首页图片配置工作圆满结束,值得留念。
这项工作拖欠很长时间了,今晚总算完成,感觉整个博客都焕然一新。
放几张截图留念一下吧:
上面几张是首页图,上个月中旬那会儿就已经更新完毕了,再展示一下现在的文章列表:
有没有焕然一新的感觉呢,这些都是我最喜欢的图片呢。
这次的文章首页整顿就先到这里,下次再见。
站点生成 前言
常见的文档站点生成器有很多,最主要的有:VitePress、Vuepress 和 Docsify 等
那我们就先使用 Vuepress 来生成文档站点了
其实所有的搭建流程上官网就能找到,跟着文档一步一步来也能完成,那我们这个笔记就是要教会你快速完成初始搭建
先放几个辅助资源:
Docsify 官网:
准备工作
那必然是提前配置好 Node.js 环境了,这里不详细阐述,如有需请移步至文章:《配置指南-掌握 Node.js 配置》
建站
这部分我们会给出两种流行的文档站点生成器:VuePress 和 VitePress
Vitepress 与 VuePress 相似度很高,相对来讲,VitePress 更加轻量级、易上手
VuePress
推荐阅读:(2023/11/27 晚) Getting Started | VuePress (vuejs.org)
VuePress 起步 - VuePress 中文网 (caibaojian.com)
快速上手 | VuePress (vuejs.org)
跟着官网操作,简简单单(手动安装和快速安装二选一即可,前者能更好的清楚执行每一条命令的目的,后者则是一键安装):
快速安装在指定目录下,执行一条命令
1 yarn create vuepress-site [optionalDirectoryName]
目前还没有解决,待解决。。。
手动安装,跟着官网一步步操作:
创建并更改为新目录
1 mkdir vuepress-starter && cd vuepress-starter
1 mkdir docs && echo '# Hello VuePress' > docs/README.md
1 2 3 4 5 6 { "scripts" : { "docs:dev" : "vuepress dev docs" , "docs:build" : "vuepress build docs" } }
VuePress(新的尝试)
哎,全局安装 Vuepress 不支持了,本来挺好用的:
1 yarn global add vuepress / npm install -g vuepress
直接在 Github 下载了官方文档源码,呃,还是局部安装吧
下载地址:vuejs/vuepress at v1.9.10 (github.com)
拉取代码后执行依次以下命令,即可成功在本地部署文档站点:
这两天在研究这个 Vuepress,感觉比 VitePress 更成熟、更好用
等我把局部安装的配置搞清楚之后,再来此处作详细记录(2023/11/27 晚)
Vdoing
1 2 3 [超链接 ](http://www.baidu.com ) [Markdown ](https://xugaoyi.com/pages/ad247c4332211551/ )
链接前添加http
或https
,这样就可以展示超链接后的图标了:(2023/12/14 晚)
VitePress
安装构建工具 vitepress,可以选择执行以下命令中的其中一条:
1 npm install -D vitepress
注意,如若使用后两条命令来安装 vitepress,请确保 pnpm 和 yarn 包管理器已正确安装
有兴趣了解这方面内容的话,请转移至《理解 npm、pnpm 和 yarn:选出最适合你的包管理器》一文中查看
我们选择使用 yarn 来安装,效果如下:
等待安装完成后,方可执行下一步操作:
初始化构建工具 vitepress
当然,选择执行以下其中一条命令即可:
执行命令后,会提示你输入初始化路径、项目名、项目描述和主题配置等等,我们这里就全部设置为默认
这一步执行完毕后,会在本地指定路径生成 VitePress 文档站点目录,效果如下:
有关该目录下文件作用以及相关配置,将会在《大道至简:快速搭建博客与文档站点的终极指南 3-0》一文中详细讲解到,接下来我们在本地启动文档站点
在该目录下,执行以下命令中的其中一条:
我们可以看到,整个页面的结构和排版都是默认主题样式的
主题配置 默认主题
我们可以在主题官网里找到相关配置,在默认主题的基础上,定制自己的主题风格
相关指导资料:
第三方主题
或者选择使用 VuePress 的第三方主题,VuePress 提供了许多优秀的第三方主题供我们使用
这些主题可以看官方文档,自己玩玩,这里不详细介绍
我们这里以 vuepress-theme-hope 为例,下载安装该主题,执行以下两条命令其一:
1 pnpm create vuepress-theme-hope hope-project
1 pnpm create vuepress-theme-hope add .
执行命令,安装过程中会有提示,我们这里都选择默认,如图所示:
安装完成,在 hope-project 目录下执行以下任意一条命令,在本地开启文档站点服务
站点生成器
vuepress(支持 vue 语法、插件丰富)(2023/08/22 午)
docsify(简单易用、插件多、轻量)
hugo(主题略少)
hexo(主题略少)
vitepress
storybook(展示组件库)
wordpress(搭建个人博客)
docute
dumi(React 展示项目文档,展示组件库)
jekyll
gatsby
评论功能
2024 年 7 月 17 日
🌭 推荐阅读:
Hexo 博客添加评论功能 - eagle.supper - 博客园 (cnblogs.com)
Hexo giscus 配置评论功能_hexo 博客 giscus-CSDN 博客
hexo 博客的评论功能-腾讯云开发者社区-腾讯云 (tencent.com)
Hexo 博客添加 GitHub 评论功能-阿里云开发者社区 (aliyun.com)
为使用 hexo 搭建的博客加入评论系统 gitalk - 简书 (jianshu.com)
Hexo 搭建博客系列:(五)Hexo 添加不蒜子和 LeanCloud 统计无标题文章 - 简书 (jianshu.com)
hexo 魔改 | 添加 Valine 评论系统_hexo butterfly valine 评论-CSDN 博客
🍖 尤其推荐下面这篇文档,因为我使用的 Hexo 建站主题是 Fluid ,不同主题的评论插件相关配置还是有些许出入。
hexo-fluid 添加 valine 评论记录-腾讯云开发者社区-腾讯云 (tencent.com)
基本实现
2024 年 7 月 17 日
介绍 | Valine 一款快速、简洁且高效的无后端评论系统。
我们使用 Valine 无后端评论系统,这篇文档写的相当详细了,跟着教程走就行。
LeanCloud
这个网站下注册登陆账号,再经过实名制和邮箱验证之后,创建的应用就可以正常使用了。
进入控制台 后点击左上角创建应用
:
创建应用:
应用创建好以后,进入刚刚创建的应用,选择左边的设置
>应用凭证
,然后就能看到你的AppID
和AppKey
了:
然后在博客主题的 _config.yml
下做好相关评论插件的配置:
1 2 3 4 5 6 7 8 comments: enable: true type: valine
搜索 valine
,可看到如下,将 enbled:true
, 并填写 appid
, appkey
和 REST API 服务地址。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 valine: appId: T1hUHH9Ks1ggG9DBE3HgUPpV-gzGzoHsz appKey: XFkgzzvzNo3J3uNCbBiSOFKc path: window.location.pathname placeholder: avatar: "retro" meta: ["nick" , "mail" , "link" ] requiredFields: [] pageSize: 10 lang: "zh-CN" highlight: false recordIP: false serverURLs: https://t1huhh9k.lc-cn-n1-shared.com emojiCDN: emojiMaps: enableQQ: false
还需要设置安全域名,用来维护数据安全,不过暂时我用不到的:
再次尝试部署博客,可以看到博文的评论功能已经开启了:
可以自由选择评论昵称,邮箱地址,输入评论信息就能直接在文章下发表评论了。
我叫来我的好兄弟测试了一番,评论功能一切正常,我这个站主还能删评论的,真不错:
在网页中引入无后端的 valine 评论系统,使用 leancloud 作为免费存储和评论管理 - 简书 (jianshu.com)
样式美化
2024 年 7 月 17 日
把 valine.ejs 下的这段代码,粘贴到 about.ejs 最后,就能实现关于页面的评论功能了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 <% if (theme.valine.appId && theme.valine.appKey) { %> <div id="valine"></div> <script type="text/javascript"> Fluid.utils.loadComments('#valine', function() { Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine , 'https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js' ) %>' , function() { var options = Object.assign( <%- JSON .stringify(theme.valine | | {}) %>, { el: "#valine" , path: <%= theme.valine.path %>, master: "<%= theme.valine.master%>" , friends: "<%= theme.valine.friends%>" , tagMeta: ["博主" ,"友人" ,"访客" ], } ) new Valine(options); Fluid.utils.waitElementVisible('#valine .vcontent' , () => { var imgSelector = '#valine .vcontent img:not(.vemoji)' ; Fluid.plugins.imageCaption(imgSelector); Fluid.plugins.fancyBox(imgSelector); }) }); }); </script> <noscript>Please enable JavaScript to view the comments</noscript> <% } %>
Hexo’s Fluid 主题私人定制(持续更新) - Eren の 宇宙船 (erenship.com)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 <div id ="vcomments" > </div > <script type ="text/javascript" > function loadValine ( ) { addScript ( "https://cdn.staticfile.org/valine/1.4.14/Valine.min.js" , function ( ) { new Valine ({ el : "#vcomments" , app_id : "T1hUHH9Ks1ggG9DBE3HgUPpV-gzGzoHsz" , app_key : "XFkgzzvzNo3J3uNCbBiSOFKc" , placeholder : "留下点什么叭... ᶘ ᵒᴥᵒᶅ(自行修改)" , path : window .location .pathname , avatar : "monsterid" , meta : ["nick" , "mail" , "link" ], pageSize : "10" , lang : "zh-CN" , highlight : false , recordIP : false , serverURLs : "https://t1huhh9k.lc-cn-n1-shared.com" , }); } ); } createObserver (loadValine, "vcomments" ); </script > <noscript > Please enable JavaScript to view the <a href ="https://valine.js.org" target ="_blank" rel ="nofollow noopener noopener" > comments powered by Valine.</a ></noscript >
MD5 在线加密 - MD5 加密工具 - MD5 在线生成 (bmcx.com)
研究了一中午,评论功能不需要优化了,本来就是为了无需登录而设置的,允许读取 QQ 信息头像也不错的。
自定义背景:
在 themes/next/layout/_partials/footer.ejs 中引入:
1 2 3 4 5 6 7 8 9 10 11 <!-- 评论框美化 --> <style> min-height: 10rem; background-image: url(http://blog.memory-life.icu/bradge.jpg); background-size: contain; background-repeat: no -repeat; background-position: right; background-color: rgba(255,255,255,0); resize: none;} </style>
浏览量
2024 年 7 月 17 日
Hexo-fluid 主题设置统计博客阅读量_hexo-theme-fluid 字数统计-CSDN 博客
Hexo 搭建博客系列:(五)Hexo 添加不蒜子和 LeanCloud 统计无标题文章 - 简书 (jianshu.com)
1 2 3 4 5 6 7 8 9 views: enable: true source: "leancloud" format: "{} 次"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 leancloud: appId: T1hUHH9Ks1ggG9DBE3HgUPpV-gzGzoHsz appKey: XFkgzzvzNo3J3uNCbBiSOFKc server_url: https://t1huhh9k.lc-cn-n1-shared.com path: window.location.pathname ignore_local: false
配置完成后,部署博客。从部署的过程就能看出来,访问次数统计其实已经生效了:
好像还不管用。。。
介绍 | Valine 一款快速、简洁且高效的无后端评论系统。
1 2 3 4 5 <!-- id 将作为查询条件 --> <span id="<Your/Path/Name>" class="leancloud_visitors" data-flag-title="Your Article Title"> <em class="post-meta-item-text">阅读量 </em> <i class="leancloud-visitors-count">1000000</i> </span>
身份标识
2024 年 7 月 17 日
Hexo’s Fluid 主题私人定制(持续更新) - Eren の 宇宙船 (erenship.com)
MD5 在线加密 - MD5 加密工具 - MD5 在线生成 (bmcx.com)
分别加密自己的邮箱号和好友的邮箱号,得到 MD5 字符串:
更新配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 valine: appId: T1hUHH9Ks1ggG9DBE3HgUPpV-gzGzoHsz appKey: XFkgzzvzNo3J3uNCbBiSOFKc path: window.location.pathname placeholder: 填取QQ邮箱号后评论,支持读取头像以及新消息提醒,留下点什么叭... ᶘ ᵒᴥᵒᶅ avatar: Gravatar meta: ["nick" , "mail" , "link" ] requiredFields: [] pageSize: 10 lang: "zh-CN" highlight: true recordIP: false serverURLs: https://t1huhh9k.lc-cn-n1-shared.com emojiCDN: emojiMaps: enableQQ: true master: 8c9b6d6637904da62d74d019cc6982de friends: 0188229a9cfc284176ea9135cb9514cc visitor: true
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 <% if (theme.valine.appId && theme.valine.appKey) { %> <div id="valine"></div> <script type="text/javascript"> Fluid.utils.loadComments('#valine', function() { Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine , 'https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js' ) %>' , function() { var options = Object.assign( <%- JSON .stringify(theme.valine | | {}) %>, { el: "#valine" , path: <%= theme.valine.path %>, app_id: "<%= theme.valine.appid %>" , app_key: "<%= theme.valine.appkey %>" , placeholder: "<%= theme.valine.placeholder %>" , avatar: "<%= theme.valine.avatar %>" , ............................................ master: "<%= theme.valine.master%>" , friends: "<%= theme.valine.friends%>" , tagMeta: ["博主" ,"友人" ,"访客" ], visitor: <%= theme.valine.visitor %> // 阅读量统计 } ) new Valine(options); Fluid.utils.waitElementVisible('#valine .vcontent' , () => { var imgSelector = '#valine .vcontent img:not(.vemoji)' ; Fluid.plugins.imageCaption(imgSelector); Fluid.plugins.fancyBox(imgSelector); }) }); }); </script> <noscript>Please enable JavaScript to view the comments</noscript> <% } %>
这样,博主 、友人 和访客 的身份就能成功区分了:
自定义背景
2024 年 7 月 17 日
Hexo NexT 评论系统 Valine 的使用_hexo next valine-CSDN 博客
1 2 3 4 5 6 7 8 9 10 11 12 <!-- 评论框美化 --> <style> min-height: 11rem; background-image: url(http://blog.memory-life.icu/pathway0716.jpg); background-size: contain; background-repeat: no -repeat; background-position: right; background-color: rgba(255,255,255,0); resize: none;} </style>
顺便了解下 CSS 基础语法,font-size 字体大小自适应:
CSS 字体大小怎么实现自适应屏幕 - 问答 - 亿速云 (yisu.com)
使用rem
实现自适应屏幕:
1 2 3 4 5 6 html { font-size : 16px ; }h1 { font-size : 2rem ; }
复制代码
使用em
实现自适应屏幕:
1 2 3 4 5 6 body { font-size : 16px ; }h1 { font-size : 2em ; }
复制代码
使用vw
实现自适应屏幕:
1 2 3 h1 { font-size : 5vw ; }
2024 年 7 月 22 日
关于页评论背景失败,不搞了就这样子吧。
1 2 3 4 5 6 7 8 9 10 11 <!-- 评论框美化 --> <style> #valine{ height: 20vh; background-image: url(http://blog.memory-life.icu/pathway0716.jpg); background-size: contain; background-repeat: no-repeat; background-position: right 6vh; background-color: rgba(255,255,255,0); resize: none;} </style>
自定义表情
2024 年 7 月 17 日
自定义表情 | Valine 一款快速、简洁且高效的无后端评论系统。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 // 设置Bilibili表情包地址 emojiCDN: '//i0.hdslb.com/bfs/emote/' , // 表情title和图片映射 emojiMaps: { "tv_doge": "6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png" , "tv_亲亲" : "a8111ad55953ef5e3be3327ef94eb4a39d535d06.png" , "tv_偷笑" : "bb690d4107620f1c15cff29509db529a73aee261.png" , "tv_再见" : "180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png" , "tv_冷漠" : "b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png" , "tv_发怒" : "34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png" , "tv_发财" : "34db290afd2963723c6eb3c4560667db7253a21a.png" , "tv_可爱" : "9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png" , "tv_吐血" : "09dd16a7aa59b77baa1155d47484409624470c77.png" , "tv_呆" : "fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png" , "tv_呕吐" : "9f996894a39e282ccf5e66856af49483f81870f3.png" , "tv_困" : "241ee304e44c0af029adceb294399391e4737ef2.png" , "tv_坏笑" : "1f0b87f731a671079842116e0991c91c2c88645a.png" , "tv_大佬" : "093c1e2c490161aca397afc45573c877cdead616.png" , "tv_大哭" : "23269aeb35f99daee28dda129676f6e9ea87934f.png" , "tv_委屈" : "d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png" , "tv_害羞" : "a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png" , "tv_尴尬" : "7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png" , "tv_微笑" : "70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png" , "tv_思考" : "90cf159733e558137ed20aa04d09964436f618a1.png" , "tv_惊吓" : "0d15c7e2ee58e935adc6a7193ee042388adc22af.png" , },
2024 年 7 月 22 日
继续来 B 站抓取更多表情:
邮箱提醒
2024 年 7 月 17 日
zhaojun1998/Valine-Admin: 一个 Valine 的拓展应用,用来增强 Valine 的邮件通知。 (github.com)
自定义页面
2024 年 7 月 17 日
我直到今晚才发现,使用 Hexo 搭建的静态博客站点本质上还是前端三件套构成的,有很高的自由度来重构页面。
我开始尝试去了解各个页面对应的代码位置,再用我贫瘠的 HTML + CSS 基础去美化页面,实现自定义页面。
中台前端框架 AntDesignPro document.ejs 文件详解-CSDN 博客
页脚优化
2024 年 7 月 17 日
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <div class="footer-inner"> <% if (theme.footer.content) { %> <div class="footer-content"> <%- theme.footer.content %> </div> <% } %> <% if (theme.footer.statistics.enable) { %> <%- partial('_partials/footer/statistics.ejs' ) %> <% } %> <% if (theme.footer.beian.enable) { %> <!-- 备案信 ICP for China --> <%- partial('_partials/footer/beian.ejs' ) %> <% } %> <% if (theme.web_analytics.cnzz) { %> <!-- cnzz Analytics Icon --> <span id="cnzz_stat_icon_<%= theme.web_analytics.cnzz %>" style="display: none"></span> <% } %></div>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 <footer class="text-center mt-5 py-3"> <%- theme.footer.content %> <!-- 添加网站运行时间 --> <div class="footer-content"> <div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script> var now = new Date(); function createtime(){ var grt= new Date("04/03/2020 00 :00:00");//此处修改你的建站时间或者网站上线时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24 ; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){ hnum = "0" + hnum; } minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){ mnum = "0" + mnum; } seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){ snum = "0" + snum; } document.getElementById("timeDate").innerHTML = "🚀  " +dnum+" 天"; //此次自定义显示内容 document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒" ; } //此次自定义显示内容 setInterval("createtime()",250); </script> </div> </div> <!-- 统计访问量信息 --> <%- partial('_partial/statistics.ejs' ) %> <!-- 个人和备案信息 --> <div>©2020-2021<a href="https://clearlight.blog.csdn.net/">ClearlightY</a> <a href="http://beian.miit.gov.cn/">冀ICP备19019307号-2</a></div> <!-- <%- partial('_partial/beian.ejs' ) %> --> <% if (theme.web_analytics.cnzz) { %> <!-- cnzz Analytics Icon --> <span id="cnzz_stat_icon_<%- theme.web_analytics.cnzz %>" style="display: none"></span> <% } %></footer> <!-- SCRIPTS --> <%- partial('_partial/scripts.ejs' ) %>
首页优化
2024 年 7 月 17 日
Hexo Fluid 主题 细节优化_hexo-fluid 标签页优化-CSDN 博客
Hexo’s Fluid 主题私人定制(持续更新) - Eren の 宇宙船 (erenship.com)
页脚优化不打紧的,谁没事会去看页脚,所以我把页脚下的建站时间显示,放在了博客首页中,效果如下:
只需要编辑 banner.ejs 文件即可:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 <%var banner_img = page.banner_img | | theme.index.banner_img var banner_img_height = parseFloat(page.banner_img_height | | theme.index.banner_img_height) var banner_mask_alpha = parseFloat(page.banner_mask_alpha | | theme.index.banner_mask_alpha) var subtitle = page.subtitle | | page.title %><div id="banner" class="banner" <%- theme.banner && theme.banner.parallax && 'parallax=true' %> style="background: url('<%- url_for(banner_img) %>') no -repeat center center; background-size: cover;"> <div class="full-bg-img"> <div class="mask flex-center" style="background-color: rgba(0, 0 , 0 , <%= parseFloat(banner_mask_alpha) %>)"> <div class="banner-text text-center fade-in-up"> <div class="h2"> <% if (theme.fun_features.typing.enable && in_scope(theme.fun_features.typing.scope)) { %> <span id="subtitle" data-typed-text="<%= subtitle %>"></span> <% } else { %> <span id="subtitle"><%- subtitle %></span> <% } %> </div> <% if (is_post()) { %> <%- inject_point('postMetaTop' ) %> <% } %> <!-- 添加网站运行时间 --> <div class="footer-content"> <div> <span id="timeDate"></span> <span id="times"></span> <script> var now = new Date(); function createtime(){ var grt= new Date("03/07/2023 00 :00:00");//此处修改你的建站时间或者网站上线时间 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24 ; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){ hnum = "0" + hnum; } minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){ mnum = "0" + mnum; } seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){ snum = "0" + snum; } document.getElementById("timeDate").innerHTML = "🚀  " +dnum+" 天"; //此次自定义显示内容 document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒" ; } //此次自定义显示内容 setInterval("createtime()",250); </script> </div> </div> </div> <% if (theme.scroll_down_arrow.enable && theme.scroll_down_arrow.banner_height_limit <= banner_img_height && page.layout !== '404' ) { %> <div class="scroll-down-bar"> <i class="iconfont icon-arrowdown"></i> </div> <% } %> </div> </div> </div>
简直像是打开了新世界,这样的话,我的博客可优化的地方还很多,而且相对来说更加自由了。
曲线救国,把文章内容页面的建站时间显示删除了:
1 2 3 if (!window .location .href .includes ("/20" )) { setInterval ("createtime()" , 250 ); }
博文排版
2024 年 7 月 31 日
今年四月底那会儿就执手优化过部分博客,可惜这项工作没有做到位。
五月初 Gitee Pages 服务停用,在那之后一个多月的时间里我的博客是没有更新的,准确的说没有同步本地到线上。
好在六月初初步解决了这个问题,六月下旬最终完善博客访问链接,六月底最终完成七牛云图床整合实现图片正常显示。
七月份中旬,我新增了博客评论功能,首页展示博客建站时间以及友情链接优化,更加深入理解了 Hexo 生成静态站点的自定义多样性。
这会儿总算能静下心来,重新排版布局这八十二篇博客的排列顺序,以及对应的博文封面图了。
日常
技术
转载
其他
公告栏
2025 年 5 月 28 日
模仿搜索页面,自定义公告栏弹窗。
1 2 3 4 5 6 7 8 <% if(theme.search.enable) { %> <li class="nav-item" id="search-btn"> <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search"> <i class="iconfont icon-search"></i> </a> </li> <% import_js(theme.static_prefix.internal_js, 'local-search.js') %> <% } %>
主要修改点:
将 <i class="iconfont icon-search"></i>
替换为 公告栏
文字
将 id="search-btn"
改为 id="notice-btn"
以更符合新功能
保留了原有的模态框触发功能(data-toggle="modal"
和 data-target="#modalSearch"
)
1 2 3 4 5 6 7 8 <% if(theme.search.enable) { %> <li class="nav-item" id="notice-btn"> <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search"> 公告栏 </a> </li> <% import_js(theme.static_prefix.internal_js, 'local-search.js') %> <% } %>
属性值
功能
必备配合属性/类
典型场景
data-toggle="modal"
打开弹窗
data-target="#id"
弹窗、对话框
data-toggle="collapse"
展开/折叠内容
.collapse
+ data-target
手风琴、折叠菜单
data-toggle="dropdown"
下拉菜单
.dropdown
+ .dropdown-menu
导航下拉选项
data-toggle="tab"
切换标签页
.nav-tabs
+ .tab-content
多标签内容切换
data-toggle="tooltip"
提示框
title
+ JS 初始化
按钮提示
1 2 3 4 5 6 notice: enable: true title: "网站公告" content: | <p>2024-02-01:系统维护通知</p> <p>2024-01-15:新增公告栏功能</p>
控制台测试弹窗,执行结果表明 HTML 未渲染。
1 2 3 4 5 6 7 8 9 10 11 12 13 $("body" ).append (` <div class="modal fade" id="modalNotice"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body">测试弹窗</div> </div> </div> </div> ` ); $("#modalNotice" ).modal ("show" );
明白了显示原理,那就是页面未渲染成功,全局搜索search.ejs
页面在哪里被引用,最终定位到layout.ejs
博客布局页面。
1 2 3 <% if (theme.search.enable) { %> <%- partial('_partials/search.ejs') %> <% } %>
1 2 3 <% if (theme.search.enable) { %> <%- partial('_partials/notice.ejs') %> <% } %>
这样子调整,公告栏终于成功显示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <div class="modal fade" id="modalNotice" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">公告</h5> <button type="button" class="close" data-dismiss="modal"> <span>×</span> </button> </div> <div class="modal-body"> "这里是公告内容" </div> </div> </div> </div>
实现公告栏弹窗自动弹出。
1 2 3 4 5 6 7 8 9 10 11 12 13 <script> document .addEventListener ('DOMContentLoaded' , function ( ) { if (!localStorage .getItem ('hexoAnnounceShown' )) { $('#modalNotice' ).modal ('show' ); localStorage .setItem ('hexoAnnounceShown' , 'true' ); setTimeout (() => { localStorage .removeItem ('hexoAnnounceShown' ); }, 86400000 ); } }); </script>
这个逻辑还需要完善下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <script>document .addEventListener ('DOMContentLoaded' , function ( ) { if (!sessionStorage.getItem ('hasShownPopup' )) { const popupHTML = ` <div class="popup-overlay" style=" position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; justify-content: center; align-items: center; "> <div class="popup-content" style=" background: white; padding: 20px; border-radius: 5px; max-width: 80%; "> <h3>重要公告</h3> <p>欢迎访问我们的网站!</p> <button class="close-btn" style=" padding: 5px 10px; background: #007bff; color: white; border: none; border-radius: 3px; cursor: pointer; ">我知道了</button> </div> </div> ` ; document .body .insertAdjacentHTML ('beforeend' , popupHTML); document .querySelector ('.popup-overlay .close-btn' ).addEventListener ('click' , function ( ) { document .querySelector ('.popup-overlay' ).style .display = 'none' ; sessionStorage.setItem ('hasShownPopup' , 'true' ); }); } }); </script>
。。这是个什么效果,够难看的,不过基本实现了,现在需要替换这个难看的页面。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 <script> document .addEventListener ('DOMContentLoaded' , function ( ) { if (!localStorage .getItem ('hasShownPopup' )) { fetch ('_partials/notice.ejs' ) .then (response => response.text ()) .then (html => { document .body .insertAdjacentHTML ('beforeend' , html); $('#modalNotice' ).modal ('show' ); localStorage .setItem ('hasShownPopup' , 'true' ); $('#modalNotice' ).on ('hidden.bs.modal' , function ( ) { }); }) .catch (error => { console .error ('加载公告栏失败:' , error); const fallbackHTML = ` <div class="modal-backdrop" style="/* 样式 */"> <div class="modal-content">/* 内容 */</div> </div>` ; document .body .insertAdjacentHTML ('beforeend' , fallbackHTML); }); } }); </script>
效果不错。
iconfont-阿里巴巴矢量图标库
1 2 3 4 5 6 7 8 9 <% if(theme.search.enable) { %> <li class="nav-item" id="search-btn"> <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalNotice" aria-label="Search"> <i class="iconfont icon-book"></i> <span>公告</span> </a> </li> <% import_js(theme.static_prefix.internal_js, 'local-search.js') %> <% } %>
在zh-CH.yml
配置中,编写公告基本配置。
1 2 3 notice: title: "公告" content: "公告内容"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 <!-- 博客 - 公告栏 --> <div class="modal fade" id="modalNotice" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true" > <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document"> <div class="modal-content"> <div class="modal-header text-center"> <h4 class="modal-title w-100 font-weight-bold"> <%= __('notice.title') %> </h4> <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close" > <span aria-hidden="true">×</span> </button> </div> <div class="modal-body mx-3"> <div class="md-form mb-5"> <input type="text" id="local-search-input" class="form-control validate" /> <label data-error="x" data-success="v" for="local-search-input" ><%= __('notice.content') %></label > </div> <div class="list-group" id="local-search-result"></div> </div> </div> </div> </div>
新的公告栏。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 <!-- 博客 - 公告栏 --> <div class="modal fade" id="modalNotice" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document"> <div class="modal-content" style=" background: linear-gradient(135deg, #fff9f0 0%, #fff3e0 100%); border: 1px solid #e6d8b5; box-shadow: 0 5px 20px rgba(0,0,0,0.15); border-radius: 10px; overflow: hidden; "> <!-- 公告头部 --> <div class="modal-header text-center" style=" background: #8b6d3b; color: white; border-bottom: 2px solid #7a5f32; padding: 15px 20px; "> <h4 class="modal-title w-100 font-weight-bold" style=" font-family: 'Microsoft YaHei', sans-serif; letter-spacing: 1px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); "> <i class="fas fa-bullhorn mr-2"></i> <%= __('notice.title') || '站点公告' %> </h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: white;"> <span aria-hidden="true" style="font-size: 1.5em;">×</span> </button> </div> <!-- 公告内容区 --> <div class="modal-body" style="padding: 25px;"> <!-- 静态公告列表 --> <div class="announcement-list" style="margin-bottom: 20px;"> <div class="announcement-item mb-3 p-3" style=" background: white; border-left: 4px solid #8b6d3b; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: all 0.3s ease; "> <h5 style="color: #5c4d3d; font-weight: 600;"> <i class="fas fa-calendar-check mr-2"></i>系统维护通知 </h5> <p class="mb-0" style="color: #666; line-height: 1.6;"> 站点将于本周六凌晨2:00-4:00进行例行维护,期间可能出现短暂无法访问的情况。 </p> <div class="text-right mt-2" style="color: #999; font-size: 0.85em;"> <i class="far fa-clock mr-1"></i>2023-11-15 </div> </div> <div class="announcement-item mb-3 p-3" style=" background: white; border-left: 4px solid #6b8b3b; box-shadow: 0 2px 5px rgba(0,0,0,0.05); "> <h5 style="color: #4d5c3d; font-weight: 600;"> <i class="fas fa-book-open mr-2"></i>阅读体验升级 </h5> <p class="mb-0" style="color: #666; line-height: 1.6;"> 我们优化了文章排版和字体渲染,夜间模式现已支持自定义色调调节功能。 </p> </div> </div> <!-- 动态搜索区(保留原有结构) --> <div class="md-form mb-4"> <input type="text" id="local-search-input" class="form-control validate" placeholder="搜索公告..." style=" border-radius: 20px; padding: 10px 15px; border: 1px solid #ddd; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); "> </div> <!-- 公告搜索结果 --> <div class="list-group" id="local-search-result" style=" max-height: 300px; overflow-y: auto; border-radius: 8px; "></div> </div> <!-- 公告页脚 --> <div class="modal-footer" style=" background: #f8f5ee; border-top: 1px solid #e6d8b5; padding: 12px 20px; justify-content: space-between; "> <small style="color: #8b6d3b;"> <i class="fas fa-info-circle mr-1"></i>公告更新于 <%= new Date().toLocaleDateString() %> </small> <button type="button" class="btn btn-sm" data-dismiss="modal" style=" background: #8b6d3b; color: white; border-radius: 4px; padding: 5px 15px; border: none; "> <i class="fas fa-check mr-1"></i>我知道了 </button> </div> </div> </div> </div>
这个效果确实有点一言难尽,不过仍有可取之处。
1 2 3 4 5 <div class="modal-body"> <div class="md-form"> <label data-error="x" data-success="v" for="local-search-input"><%= __('notice.keyword') %></label> </div> </div>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <!-- 静态公告列表 --> <div class="announcement-list" style="margin-bottom: 20px;"> <div class="announcement-item mb-3 p-3"> <h5 style="color: #d38532; font-weight: 600;"> <i class="fas fa-calendar-check mr-2"></i>系统维护通知 </h5> <p class="mb-0" style="line-height: 1.6;"> 站点将于本周六凌晨2:00-4:00进行例行维护,期间可能出现短暂无法访问的情况。 </p> </div> <div class="announcement-item mb-3 p-3"> <h5 style="color: #6cc70b; font-weight: 600;"> <i class="fas fa-book-open mr-2"></i>阅读体验升级 </h5> <p class="mb-0" style=" line-height: 1.6;"> 我们优化了文章排版和字体渲染,夜间模式现已支持自定义色调调节功能。 </p> </div> </div>
基本调整完毕。
1 2 3 <button type ="button" class ="close" data-dismiss ="modal" aria-label ="Close" style ="color: white;" > <span aria-hidden ="true" style ="font-size: 1.5em;" > × </span > </button >
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <!-- 博客 - 公告栏 --> <div class="modal fade" id="modalNotice" tabindex="-1" role="dialog" aria-hidden="true" style="font-family: 'Ma Shan Zheng', cursive; /* 需引入此中文字体 */color: #ffffff;"> <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document"> <div class="modal-content" style="border-radius: 6px;"> <!-- 公告头部 --> <div class="modal-header text-center"> <h4 class="modal-title w-100 font-weight-bold" style="font-family: 'Microsoft YaHei', sans-serif;letter-spacing: 1px;text-shadow: 1px 1px 2px rgba(0,0,0,0.2);color: #ffffff"> <i class="fas fa-bullhorn mr-2"> <%= __('notice.title') || '站点公告' %></i> </h4> </div> <!-- 公告内容区 --> <div class="modal-body" style="padding: 25px;"> <!-- 静态公告列表 --> <div class="announcement-list" style="margin-bottom: 20px;"> <div class="announcement-item mb-3 p-3"> <h5 style="color: #d38532; font-weight: 600;"> <i class="fas fa-calendar-check mr-2"></i>系统维护通知 </h5> <p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 站点将于本周六凌晨2:00-4:00进行例行维护,期间可能出现短暂无法访问的情况。 </p> </div> <div class="announcement-item mb-3 p-3"> <h5 style="color: #6cc70b; font-weight: 600;"> <i class="fas fa-book-open mr-2"></i>阅读体验升级 </h5> <p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 我们优化了文章排版和字体渲染,夜间模式现已支持自定义色调调节功能。 </p> </div> </div> <!-- 公告页脚 --> <div class="modal-footer" style="border-top: 1px solid #ffffff;padding: 12px 20px;justify-content: space-between;"> <small style="color: #ffffff;"> <i class="iconfont icon-pen"></i> <i class="fas fa-info-circle mr-1"></i>芒种前夕 · 旅途第813天 · <%= new Date().toLocaleDateString() %> </small> <button id="confirm-btn" type="button" class="btn btn-sm" data-dismiss="modal" style="background: #a0a0a0;color: #ffffff;border-radius: 4px;padding: 5px 15px;border: none;"> <i class="fas fa-check mr-1" style="color: #ffffff;font-size: medium">心已阅</i> </button> </div> </div> </div> </div>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 <!-- 公告内容区 --> <div class="modal-body" style="padding: 25px;"> <!-- 静态公告列表 --> <div class="announcement-list" style="margin-bottom: 20px;"> <div class="announcement-item mb-3 p-3"> <h2 style="color: #d38532; font-weight: 600;"> <i class="fas fa-calendar-check mr-2"></i>系统维护通知 </h2> <p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 你们好! </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 建站后的第813天,在百忙之中总算又能抽出时间来,对整个博客站点功能做整体的规划及优化完善。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 在刚刚过去的几年时间里,往事皆以笔墨挥毫于时光素笺之上,数百天如一日,故事的书写从未间断过。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 时光悠悠,日月如流,过往的蹉跎岁月总在不经意间在心间回眸。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 俯仰之间,轻舟已过万重山。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 蹉跎之处,往事皆成云烟散。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 这几年的时光过得太快了,好像过去这段岁月里的所有事情都发生在一瞬间。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 这几年的时光同样太久了,久到那些时日里仿佛囊括了自己的整个前半生。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 八百余个昼夜,当时只道是地久天长,如今回望,不过浮光掠影间的一瞬。 </p> </div> <div class="announcement-item mb-3 p-3"> <h2 style="color: #6cc70b; font-weight: 600;"> <i class="fas fa-book-open mr-2"></i>阅读体验升级 </h2> <p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 言简意赅,简明扼要,即刻值此记录下本站点今日以来的功能调整,更新日志以及后续的扩展规划。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 1、新增博文“溯源计划”,旨在用先进的数字技术留住过去的旧时光,让家族的记忆在数字云端生长发芽,全站博文数量已达90+。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 2、自去年夏天站点新增了“评论回复”功能后,至今时隔十余月,在芒种前夕本站久违地上线“围栏告示”功能,本公告栏会不定时更新,持续跟进记录最新站点功能调整日志,更多精彩内容请敬请期待。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 3、最近几周时间里,考虑到图文流量费用收取问题,暂时关闭了七牛云对象存储私有空间访问权限,故博文内的图文无法正常预览,择日考虑开启访问权限。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 4、后续计划实现壁纸下载功能,均为个人收集的共150+超高分辨率精美壁纸,提供在线预览以及下载功能。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 5、规划完善文章内分页功能,并提供“最近更新”的文章列表,计划收录更新率较高的文章,譬如:阳台日记、叙事之外、岁月如歌、游戏人生等等,尽可能多的提升在线浏览和阅读体验。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 6、持续优化完善友链页面,整理归档个人常用的高质量网站合集,无偿分享给有缘人。 </p><p class="mb-0" style="color: #ffffff; line-height: 1.6;"> 此公告最后更新于:2025/05/28晚。 </p> </div> </div>
看着总感觉怪怪的。
1 2 3 <small style="display: block; font-family: 'STKaiti' , serif; font-size: 0. 6em; color: 旧梦轻拾 · 谨识 </small>
1 2 3 4 <span style="position: absolute; right: 0 ; bottom: 0 ; font-family: 'STKaiti' ; color: 旧梦轻拾 </span>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 <div class ="modal-body" style ="padding: 2rem; max-height: 70vh; overflow-y: auto; width: 800px;" > <div class ="announcement-hero" style ="margin-bottom: 2rem;" > <img src ="https://img1.baidu.com/it/u=958843530,3826099174&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800" alt ="时光溯洄题图" style ="width: 100%; max-height: 400px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.1);" loading ="lazy" srcset =" https://example.com/path/to/2k-image.webp 2048w, https://example.com/path/to/1k-image.webp 1024w, https://example.com/path/to/mobile-image.webp 640w " sizes ="(max-width: 768px) 100vw, 80vw" > </div > <div class ="announcement-list" > <div class ="announcement-item mb-4 p-4" style ="background: rgba(255,255,255,0.05); border-radius: 8px;" > <h2 style ="color: #d38532; font-weight: 600; font-size: 1.5rem; margin-bottom: 1.2rem; letter-spacing: 0.5px;" > <i class ="fas fa-calendar-check mr-2" > </i > 时光溯洄 <small style ="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;" > —— 关于本站那些被数字化的晨昏</small > </h2 > <div style ="color: #e0e0e0; line-height: 1.8; font-size: 1.05rem; letter-spacing: 0.3px;" > <p style ="margin-bottom: 1rem; text-indent: 2em;" > 你们好!</p > <p style ="margin-bottom: 1rem; text-indent: 2em;" > 建站后的第813天,在百忙之中总算又能抽出时间来,对整个博客站点功能做整体的规划及优化完善。</p > <p style ="margin-bottom: 1rem; text-indent: 2em;" > 在刚刚过去的几年时间里,往事皆以笔墨挥毫于时光素笺之上,数百天如一日,故事的书写从未间断过。</p > <p style ="margin-bottom: 1rem; text-indent: 2em; font-style: italic; color: #b8b8b8;" > 时光悠悠,日月如流,过往的蹉跎岁月总在不经意间在心间回眸。</p > <p style ="margin-bottom: 1rem; text-indent: 2em; font-weight: 500; color: #ffffff;" > 俯仰之间,轻舟已过万重山。</p > <p style ="margin-bottom: 1rem; text-indent: 2em; font-weight: 500; color: #ffffff;" > 蹉跎之处,往事皆成云烟散。</p > <p style ="margin-bottom: 1rem; text-indent: 2em;" > 这几年的时光过得太快了,好像过去这段岁月里的所有事情都发生在一瞬间。</p > <p style ="margin-bottom: 1rem; text-indent: 2em;" > 这几年的时光同样太久了,久到那些时日里仿佛囊括了自己的整个前半生。</p > <p style ="margin-bottom: 0; text-align: right; font-size: 0.95rem; color: #a0a0a0;" > —— 八百余个昼夜,当时只道是地久天长,如今回望,不过浮光掠影间的一瞬。</p > </div > </div > <div class ="announcement-item mb-4 p-4" style ="background: rgba(255,255,255,0.05); border-radius: 8px;" > <h2 style ="color: #6cc70b; font-weight: 600; font-size: 1.5rem; margin-bottom: 1.2rem; letter-spacing: 0.5px;" > <i class ="fas fa-book-open mr-2" > </i > 墨痕新注 <small style ="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;" > —— 功能迭代和未完成的书写</small > </h2 > <div style ="color: #e0e0e0; line-height: 1.8; font-size: 1.05rem; letter-spacing: 0.3px;" > <p style ="margin-bottom: 1.2rem;" > 言简意赅,简明扼要,即刻值此记录下本站点今日以来的功能调整,更新日志以及后续的扩展规划。</p > <ul style ="padding-left: 1.8rem; margin-bottom: 1.5rem;" > <li style ="margin-bottom: 0.8rem; position: relative; list-style-type: none;" > <span style ="position: absolute; left: -1.8rem; color: #6cc70b;" > ◆</span > 新增博文"溯源计划",旨在用先进的数字技术留住过去的旧时光,让家族的记忆在数字云端生长发芽,全站博文数量已达90+。 </li > <li style ="margin-bottom: 0.8rem; position: relative; list-style-type: none;" > <span style ="position: absolute; left: -1.8rem; color: #6cc70b;" > ◆</span > 自去年夏天站点新增了“评论回复”功能后,至今时隔十余月,在芒种前夕本站久违地上线“围栏告示”功能,本公告栏会不定时更新,持续跟进记录最新站点功能调整日志,更多精彩内容请敬请期待。 </li > <li style ="margin-bottom: 0.8rem; position: relative; list-style-type: none;" > <span style ="position: absolute; left: -1.8rem; color: #6cc70b;" > ◆</span > 最近几周时间里,考虑到图文流量费用收取问题,暂时关闭了七牛云对象存储私有空间访问权限,故博文内的图文无法正常预览,择日考虑开启访问权限。 </li > <li style ="margin-bottom: 0.8rem; position: relative; list-style-type: none;" > <span style ="position: absolute; left: -1.8rem; color: #6cc70b;" > ◆</span > 后续计划实现壁纸下载功能,均为个人收集的共150+超高分辨率精美壁纸,提供在线预览以及下载功能。 </li > <li style ="margin-bottom: 0.8rem; position: relative; list-style-type: none;" > <span style ="position: absolute; left: -1.8rem; color: #6cc70b;" > ◆</span > 规划完善文章内分页功能,并提供“最近更新”的文章列表,计划收录更新率较高的文章,譬如:阳台日记、叙事之外、岁月如歌、游戏人生等等,尽可能多的提升在线浏览和阅读体验。 </li > <li style ="margin-bottom: 0.8rem; position: relative; list-style-type: none;" > <span style ="position: absolute; left: -1.8rem; color: #6cc70b;" > ◆</span > 持续优化完善友链页面,整理归档个人常用的高质量网站合集,无偿分享给有缘人。 </li > </ul > <p style ="margin-bottom: 0; text-align: right; font-size: 0.9rem; color: #8a8a8a;" > 此公告最后更新于:<span style ="color: #6cc70b;" > 2025/05/28晚</span > </p > </div > </div > </div > </div >
基本完善。
2025 年 5 月 29 日
保留昨晚的源码。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 <!-- 博客 - 公告栏 --> <div class="modal fade" id="modalNotice" tabindex="-1" role="dialog" aria-hidden="true" style="font-family: 'Ma Shan Zheng', cursive; /* 需引入此中文字体 */color: #ffffff;"> <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document" style="font-family: 'Ma Shan Zheng', cursive;"> <div class="modal-content" style="border-radius: 6px;"> <!-- 公告头部 --> <div class="modal-header text-center"> <h4 class="modal-title w-100 font-weight-bold" style="font-family: 'Microsoft YaHei', sans-serif;letter-spacing: 1px;text-shadow: 1px 1px 2px rgba(0,0,0,0.2);color: #ffffff"> <i class="fas fa-bullhorn mr-2"> <%= __('notice.title') || '站点公告' %></i> <small style="display: block; font-family: 'STKaiti', serif; font-size: 0.6em; color: #a0a0a0; margin-top: 3px;"> 旧梦轻拾 · 谨识 </small> </h4> </div> <!-- 公告内容区 --> <div class="modal-body" style="padding: 2rem; max-height: 70vh; overflow-y: auto; width: 800px;"> <!-- 图片容器(保持宽高比自适应) --> <div class="announcement-hero" style="margin-bottom: 2rem;"> <img src="http://blog.memory-life.icu/%E3%80%90%E5%93%B2%E9%A3%8E%E5%A3%81%E7%BA%B8%E3%80%91%E5%8A%A8%E6%BC%AB-%E5%A4%95%E9%98%B3%E9%93%81%E8%BD%A8.jpg" alt="时光溯洄题图" style="width: 100%; max-height: 400px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.1);" loading="lazy" srcset=" https://example.com/path/to/2k-image.webp 2048w, https://example.com/path/to/1k-image.webp 1024w, https://example.com/path/to/mobile-image.webp 640w " sizes="(max-width: 768px) 100vw, 80vw"> </div> <!-- 静态公告列表 --> <div class="announcement-list"> <div class="announcement-item mb-4 p-4" style="background: rgba(255,255,255,0.05); border-radius: 8px;"> <h2 style="color: #d38532; font-weight: 600; font-size: 1.5rem; margin-bottom: 1.2rem; letter-spacing: 0.5px;"> <i class="fas fa-calendar-check mr-2"></i>时光溯洄 <small style="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;">—— 关于本站那些被数字化的晨昏</small> </h2> <div style="color: #e0e0e0; line-height: 1.8; font-size: 1.05rem; letter-spacing: 0.3px;"> <p style="margin-bottom: 1rem; text-indent: 2em;">你们好!</p> <p style="margin-bottom: 1rem; text-indent: 2em;"> 建站后的第813天,在百忙之中总算又能抽出时间来,对整个博客站点功能做整体的规划及优化完善。</p> <p style="margin-bottom: 1rem; text-indent: 2em;"> 在刚刚过去的几年时间里,往事皆以笔墨挥毫于时光素笺之上,数百天如一日,故事的书写从未间断过。</p> <p style="margin-bottom: 1rem; text-indent: 2em; font-style: italic; color: #b8b8b8;"> 时光悠悠,日月如流,过往的蹉跎岁月总在不经意间在心间回眸。</p> <p style="margin-bottom: 1rem; text-indent: 2em; font-weight: 500; color: #ffffff;"> 俯仰之间,轻舟已过万重山。</p> <p style="margin-bottom: 1rem; text-indent: 2em; font-weight: 500; color: #ffffff;"> 蹉跎之处,往事皆成云烟散。</p> <p style="margin-bottom: 1rem; text-indent: 2em;"> 这几年的时光过得太快了,好像过去这段岁月里的所有事情都发生在一瞬间。</p> <p style="margin-bottom: 1rem; text-indent: 2em;"> 这几年的时光同样太久了,久到那些时日里仿佛囊括了自己的整个前半生。</p> <p style="margin-bottom: 0; text-align: right; font-size: 0.95rem; color: #a0a0a0;">—— 八百余个昼夜,当时只道是地久天长,如今回望,不过浮光掠影间的一瞬。</p> </div> </div> <div class="announcement-item mb-4 p-4" style="background: rgba(255,255,255,0.05); border-radius: 8px;"> <h2 style="color: #6cc70b; font-weight: 600; font-size: 1.5rem; margin-bottom: 1.2rem; letter-spacing: 0.5px;"> <i class="fas fa-book-open mr-2"></i>墨痕新注 <small style="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;">—— 功能迭代和未完成的书写</small> </h2> <div style="color: #e0e0e0; line-height: 1.8; font-size: 1.05rem; letter-spacing: 0.3px;"> <p style="margin-bottom: 1.2rem;"> 言简意赅,简明扼要,即刻值此记录下本站点今日以来的功能调整,更新日志以及后续的扩展规划。</p> <ul style="padding-left: 1.8rem; margin-bottom: 1.5rem;"> <li style="margin-bottom: 0.8rem; position: relative; list-style-type: none;"> <span style="position: absolute; left: -1.8rem; color: #6cc70b;">◆</span> 新增博文"溯源计划",旨在用先进的数字技术留住过去的旧时光,让家族的记忆在数字云端生长发芽,全站博文数量已达90+。 </li> <li style="margin-bottom: 0.8rem; position: relative; list-style-type: none;"> <span style="position: absolute; left: -1.8rem; color: #6cc70b;">◆</span> 自去年夏天站点新增了“评论回复”功能后,至今时隔十余月,在芒种前夕本站久违地上线“围栏告示”功能,本公告栏会不定时更新,持续跟进记录最新站点功能调整日志,更多精彩内容请敬请期待。 </li> <li style="margin-bottom: 0.8rem; position: relative; list-style-type: none;"> <span style="position: absolute; left: -1.8rem; color: #6cc70b;">◆</span> 最近几周时间里,考虑到图文流量费用收取问题,暂时关闭了七牛云对象存储私有空间访问权限,故博文内的图文无法正常预览,择日考虑开启访问权限。 </li> <li style="margin-bottom: 0.8rem; position: relative; list-style-type: none;"> <span style="position: absolute; left: -1.8rem; color: #6cc70b;">◆</span> 后续计划实现壁纸下载功能,均为个人收集的共150+超高分辨率精美壁纸,提供在线预览以及下载功能。 </li> <li style="margin-bottom: 0.8rem; position: relative; list-style-type: none;"> <span style="position: absolute; left: -1.8rem; color: #6cc70b;">◆</span> 规划完善文章内分页功能,并提供“最近更新”的文章列表,计划收录更新率较高的文章,譬如:阳台日记、叙事之外、岁月如歌、游戏人生等等,尽可能多的提升在线浏览和阅读体验。 </li> <li style="margin-bottom: 0.8rem; position: relative; list-style-type: none;"> <span style="position: absolute; left: -1.8rem; color: #6cc70b;">◆</span> 持续优化完善友链页面,整理归档个人常用的高质量网站合集,无偿分享给有缘人。 </li> </ul> <p style="margin-bottom: 0; text-align: right; font-size: 0.9rem; color: #8a8a8a;"> 此公告最后更新于:<span style="color: #6cc70b;">2025/05/28晚</span> </p> </div> </div> </div> </div> <!-- 公告页脚 --> <div class="modal-footer" style="border-top: 1px solid #ffffff;padding: 12px 20px;justify-content: space-between;"> <small style="color: #ffffff;"> <i class="iconfont icon-pen"></i> <i class="fas fa-info-circle mr-1"></i>芒种前夕 · 旅途第813天 · <%= new Date().toLocaleDateString() %> </small> <button id="confirm-btn" type="button" class="btn btn-sm" data-dismiss="modal" style="background: #a0a0a0;color: #ffffff;border-radius: 4px;padding: 5px 15px;border: none;"> <i class="fas fa-check mr-1" style="color: #ffffff;font-size: medium">心已阅</i> </button> </div> </div> </div> </div>
适配移动端,概览。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 <div class="modal fade" id="modalNotice" tabindex="-1" role="dialog" aria-hidden="true" style="font-family: 'Ma Shan Zheng', cursive; color: #ffffff;"> <div class="modal-dialog modal-dialog-scrollable" role="document" style="font-family: 'Ma Shan Zheng', cursive;"> <div class="modal-content" style="border-radius: 6px;"> <!-- 公告头部 - 响应式设计 --> <div class="modal-header text-center" style="padding: 1rem 1.5rem;"> <h4 class="modal-title w-100 font-weight-bold" style="font-family: 'Microsoft YaHei', sans-serif;letter-spacing: 1px;text-shadow: 1px 1px 2px rgba(0,0,0,0.2);color: #ffffff; font-size: 1.5rem; /* 默认PC端大小 */ /* 移动端适配 */ @media (max-width: 768px) { font-size: 1.2rem; }"> <i class="fas fa-bullhorn mr-2"> <%= __('notice.title') || '站点公告' %></i> <small style="display: block; font-family: 'STKaiti', serif; font-size: 0.6em; color: #a0a0a0; margin-top: 3px;"> 旧梦轻拾 · 谨识 </small> </h4> </div> <!-- 公告内容区 - 响应式设计 --> <div class="modal-body" style="padding: 2rem; /* PC端 */ max-height: 70vh; overflow-y: auto; /* 移动端适配 */ @media (max-width: 768px) { padding: 1rem; max-height: 60vh; }"> <!-- 图片容器(响应式设计) --> <div class="announcement-hero" style="margin-bottom: 2rem; /* PC端 */ /* 移动端适配 */ @media (max-width: 768px) { margin-bottom: 1rem; }"> <img src="http://blog.memory-life.icu/%E3%80%90%E5%93%B2%E9%A3%8E%E5%A3%81%E7%BA%B8%E3%80%91%E5%8A%A8%E6%BC%AB-%E5%A4%95%E9%98%B3%E9%93%81%E8%BD%A8.jpg" alt="时光溯洄题图" style="width: 100%; max-height: 400px; /* PC端 */ object-fit: cover; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); /* 移动端适配 */ @media (max-width: 768px) { max-height: 30vh; }" loading="lazy"> </div> <!-- 静态公告列表 - 响应式设计 --> <div class="announcement-list"> <div class="announcement-item" style="margin-bottom: 2rem; /* PC端 */ padding: 2rem; background: rgba(255,255,255,0.05); border-radius: 8px; /* 移动端适配 */ @media (max-width: 768px) { margin-bottom: 1rem; padding: 1rem; }"> <h2 style="color: #d38532; font-weight: 600; font-size: 1.5rem; /* PC端 */ margin-bottom: 1.2rem; letter-spacing: 0.5px; /* 移动端适配 */ @media (max-width: 768px) { font-size: 1.2rem; margin-bottom: 1rem; }"> <i class="fas fa-calendar-check mr-2"></i>时光溯洄 <small style="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;">—— 关于本站那些被数字化的晨昏</small> </h2> <div style="color: #e0e0e0; line-height: 1.8; /* PC端 */ font-size: 1.05rem; letter-spacing: 0.3px; /* 移动端适配 */ @media (max-width: 768px) { line-height: 1.6; font-size: 0.95rem; }"> <!-- 内容保持不变 --> <p style="margin-bottom: 1rem; text-indent: 2em;">你们好!</p> <!-- 其余段落内容... --> </div> </div> <!-- 第二个公告项 - 响应式设计 --> <div class="announcement-item" style="margin-bottom: 2rem; /* PC端 */ padding: 2rem; background: rgba(255,255,255,0.05); border-radius: 8px; /* 移动端适配 */ @media (max-width: 768px) { margin-bottom: 1rem; padding: 1rem; }"> <h2 style="color: #6cc70b; font-weight: 600; font-size: 1.5rem; /* PC端 */ margin-bottom: 1.2rem; letter-spacing: 0.5px; /* 移动端适配 */ @media (max-width: 768px) { font-size: 1.2rem; margin-bottom: 1rem; }"> <i class="fas fa-book-open mr-2"></i>墨痕新注 <small style="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;">—— 功能迭代和未完成的书写</small> </h2> <div style="color: #e0e0e0; line-height: 1.8; /* PC端 */ font-size: 1.05rem; letter-spacing: 0.3px; /* 移动端适配 */ @media (max-width: 768px) { line-height: 1.6; font-size: 0.95rem; }"> <!-- 列表内容 - 响应式设计 --> <ul style="padding-left: 1.8rem; /* PC端 */ margin-bottom: 1.5rem; /* 移动端适配 */ @media (max-width: 768px) { padding-left: 1.5rem; margin-bottom: 1.2rem; }"> <li style="margin-bottom: 0.8rem; /* PC端 */ position: relative; list-style-type: none; /* 移动端适配 */ @media (max-width: 768px) { margin-bottom: 0.6rem; }"> <span style="position: absolute; left: -1.8rem; /* PC端 */ color: #6cc70b; /* 移动端适配 */ @media (max-width: 768px) { left: -1.5rem; }">◆</span> 新增博文"溯源计划",旨在用先进的数字技术留住过去的旧时光... </li> <!-- 其余列表项... --> </ul> </div> </div> </div> </div> <!-- 公告页脚 - 响应式设计 --> <div class="modal-footer" style="border-top: 1px solid rgba(255,255,255,0.2); padding: 1rem 1.5rem; /* PC端 */ justify-content: space-between; /* 移动端适配 */ @media (max-width: 768px) { padding: 0.8rem; }"> <small style="color: #ffffff; font-size: 0.9rem; /* PC端 */ /* 移动端适配 */ @media (max-width: 768px) { font-size: 0.8rem; }"> <i class="iconfont icon-pen"></i> <i class="fas fa-info-circle mr-1"></i>芒种前夕 · 旅途第813天 · <%= new Date().toLocaleDateString() %> </small> <button id="confirm-btn" type="button" class="btn btn-sm" data-dismiss="modal" style="background: #a0a0a0; color: #ffffff; border-radius: 4px; padding: 0.5rem 1.2rem; /* PC端 */ border: none; font-size: 0.9rem; /* 移动端适配 */ @media (max-width: 768px) { padding: 0.3rem 0.8rem; font-size: 0.85rem; }"> <i class="fas fa-check mr-1" style="color: #ffffff;">心已阅</i> </button> </div> </div> </div> </div> <style> /* 响应式模态框宽度 */ @media (min-width: 992px) { #modalNotice .modal-dialog { max-width: 800px; } } @media (max-width: 991px) { #modalNotice .modal-dialog { margin: 0.5rem auto; } } </style>
全局字体
2025 年 5 月 28 日
1 2 3 4 5 6 7 font: font_size: 16px font_family: letter_spacing: 0. 02em code_font_size: 85 %
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 font: font_size: 16. 5px font_family: - "HarmonyOS Sans SC" - "Noto Sans SC" - "PingFang SC" - "Microsoft YaHei" - "Helvetica Neue" - "Arial" - "sans-serif" letter_spacing: 0. 03em code: font_size: 87 % font_family: - "JetBrains Mono" - "Fira Code" - "Consolas" - "monospace" line_height: 1.6 headings: font_scale: 1.2 letter_spacing: -0. 015em font_weight: 450 dark_mode: font_weight: 350 contrast_ratio: 1.8
2025 年 5 月 31 日
这样的字体看着挺不赖的,这么久了换一种风格也好。
1 KaiTi, "Microsoft YaHei" ,Georgia, sans, serif
1 2 3 4 5 6 7 font: font_size: 16px font_family: KaiTi,"Microsoft YaHei",Georgia, sans, serif letter_spacing: 0. 02em code_font_size: 85 %
We’re not a CDN - highlight.js (highlightjs.org)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 code: copy_btn: true language: enable: true default: "TEXT" highlight: enable: true line_number: true lib: "highlightjs" highlightjs: style: "atom-one-light" style_dark: "atom-one-dark"
代码高亮调整完毕,这下看起来舒服多了。
分页阅读
2025 年 5 月 29 日
音乐餐厅
2025 年 5 月 29 日
安装插件。
1 npm install hexo-tag-aplayer hexo-theme-cafe
插入音乐 | 🔥 一个比较特别的 Hexo 主题 (nexmoe.com)
插入音乐
本教程使用 hexo-tag-aplayer 插件来达到在 Hexo 文章中插入音乐的效果
在你的 Hexo 程序根目录(与_config.yml 同目录)下执行:
1 npm install --save hexo-tag-aplayer
引入 MetingJS 后,播放器将支持对于 QQ 音乐、网易云音乐、虾米、酷狗、百度等平台的音乐播放。
在 Hexo 配置文件 _config.yml
中设置:
1 2 3 aplayer: meting: true asset_inject: false
Hexo 博客增加歌单播放想到要为自己的 Hexo 博客添加播放音乐的功能,首先就是去搜索查询一些大佬们是怎么实现的,在大佬们 - 掘金 (juejin.cn)
hexo 博客 fluid 主题添加 aplayer 组件_hexo aplayer-CSDN 博客
Hexo 主题插入音乐之 aplayer 音乐播放器_hexo-tag-aplayer-CSDN 博客
Hexo-Tag-APlayer 项目教程-CSDN 博客
1 2 3 4 5 6 aplayer: meting: true asset_inject: false cdn: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js style_cdn: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css meting_cdn: https://cdn.jsdelivr.net/npm/meting/dist/Meting.min.js
项目首页 - hexo-tag-aplayer:Embed aplayer in Hexo posts/pages - GitCode
Hexo 添加全局吸底 Aplayer 音乐播放器教程_哔哩哔哩_bilibili
1 2 3 4 5 6 aplayer: meting: true asset_inject: false cdn: js: https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js css: https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css
1 2 3 4 5 plugins: aplayer: false custom_js: /js/activate-aplayer.js
废了,没用。
2025 年 5 月 30 日
往事随风 (alec-97.github.io)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <div class ="aplayer" data-id ="754708245" data-server ="netease" data-type ="playlist" data-fixed ="true" data-listfolded ="true" data-autoplay ="false" data-order ="list" data-volume ="0.5" data-theme ="#1da496" data-preload ="auto" > </div > <style > .aplayer .aplayer-fixed .aplayer-lrc , .aplayer .aplayer-fixed .aplayer-body { position : absolute !important ; z-index : 999 !important ; } </style >
1 2 3 4 5 6 7 font: font_size: 16px font_family: letter_spacing: 0. 02em code_font_size: 85 %
在 fluid 的主题配置文件中,提供了自定义 html 的位置,因此直接在主题配置文件中添加 html 代码
1 2 3 4 5 6 7 custom_html: ' <!--音乐--> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css"> <script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js"></script> <div id="player" class="aplayer aplayer-withlist aplayer-fixed" data-id="3025663508" data-server="netease" data-type="playlist" data-order="random" data-fixed="true" data-listfolded="true" data-theme="#2D8CF0"></div> '
在主题配置文件下添加这么个配置,主页直接插入了音乐播放器,就是样式有点糟糕,这不是我想要的。
或者选择用配置分别引入 js 和 css 依赖,实现的效果同上是一样的。
1 2 3 4 5 6 7 8 custom_js: - //cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js - //cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js custom_css: - //cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css
1 https:// deng-2022 .atomgit.net/blog/ assets/js/ APlayer.min.js
1 2 3 <% if { % > <% - js % > <% } % >
1 2 3 4 5 <% if { % > <% theme.custom_js.forEach { % > <script src="<%= url.startsWith('/') ? '/blog' + url : '/blog/assets/' + url %>" ></script> <% }); % > <% } % >
1 2 3 console .log (window .APlayer , window .Meting );VM11822 :1 ƒ e (t ){if (function (e,t ){if (!(e instanceof t))throw new TypeError ("Cannot call a class as a function" )}(this ,e),this .options =(0 ,s.default )(t),this .container =this .options .container ,this .paused =!0 ,this .pl … undefined undefined
一套流程总算解决了加载本地资源报错的问题,目前仅加载 cdn 资源路径。
第一步:彻底禁用主题的默认加载
在 _config.fluid.yml
中添加:
1 2 3 4 5 6 7 8 aplayer: enable: false asset_inject: false custom_js: - https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js - https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js
第二步:清理冗余请求
删除以下文件(如果存在):
1 2 source /assets/ js/APlayer.min.js themes/fluid/ source /assets/ js/APlayer.min.js
清除浏览器缓存后测试:
1 hexo clean && hexo g && hexo s
第三步:验证全局变量
在浏览器控制台输入:
1 2 console .log ("APlayer:" , window .APlayer , "Meting:" , window .Meting );
结果是同样的,现在需要解决 Meting.js 为何渲染失败。
1 npm uninstall hexo-tag-aplayer
1 npm install aplayer@1.10.1 meting@3 --save
1 2 3 4 5 6 <script> if (window .APlayer && !window .Meting ) { console .error ('MetingJS 未加载!正在重试...' ); document .write ('<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"><\/script>' ); } </script>
1 hexo clean && hexo g && hexo s
Markdown 标签语法 Markdown 内嵌 HTML 标签 对于 Markdown 涵盖范围之外的标签,都可以直接 - 掘金 (juejin.cn)
Plugins | Hexo
1 http:// localhost:4000 /blog/img /artical/m ountain0414.jpg
1 http:// localhost:4000 /blog/mu sic/OneDay.flac
1 (索引):321 Uncaught ReferenceError: APlayer is not defined
中午两点半,搞出来一个基本的音乐播放器,选择直接硬编码。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css" ><div id ="aplayer-sRJbrprR" > </div > <script src ="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js" > </script > <script > document .addEventListener ('DOMContentLoaded' , () => { new APlayer ({ element : document .getElementById ("aplayer-sRJbrprR" ), music : { title : "One Day" , author : "Mayrain" , url : "/blog/music/WindyHill.mp3" , pic : "/blog/img/artical/mountain0414.jpg" } }); }); </script >
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <% if (theme.aplayer .enable ){ %> <script defer > window .__aplayerQueue = window .__aplayerQueue || []; window .__aplayerQueue .push (function ( ){ new APlayer ({ }); }); function fireAplayer ( ) { window .__aplayerQueue .forEach (fn => fn ()); } document .addEventListener ('APlayerReady' , fireAplayer); </script > <% } %>
1 2 3 4 5 6 aplayer: enable: true asset_inject: false cdn: https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js style_cdn: https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css preload: true
这一招绝了,我直接手动提前加载,整体还是使用标签引入,不暴力手写代码引入。
1 2 <script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js" ></script> {% aplayer "One Day" "Mayrain" "/blog/music/WindyHill.mp3" "/blog/img/artical/mountain0414.jpg" %}
十六个小时连续不断地尝试,就连晚上睡觉做梦都在迷迷糊糊想办法,总算搞出来一个像样的文内音乐播放器。
下载插件。
1 npm install --save hexo-tag-aplayer
固定 Aplayer 以及 Meting 版本:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 "dependencies" : { "aplayer" : "^1.10.1" , "hexo" : "^5.0.0" , "hexo-deployer-git" : "^4.0.0" , "hexo-generator-archive" : "^1.0.0" , "hexo-generator-category" : "^1.0.0" , "hexo-generator-index-pin-top" : "^0.2.2" , "hexo-generator-tag" : "^1.0.0" , "hexo-renderer-ejs" : "^1.0.0" , "hexo-renderer-marked" : "^4.0.0" , "hexo-renderer-stylus" : "^2.0.0" , "hexo-server" : "^2.0.0" , "hexo-tag-aplayer" : "^3.0.4" , "hexo-theme-fluid" : "^1.9.4" , "hexo-theme-landscape" : "^0.0.3" , "meting" : "^2.0.1" }
展示下相关配置,主题配置:
1 2 3 aplayer: enable: false asset_inject: false
1 2 3 4 5 6 7 custom_html: ' <!--音乐--> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css"> <script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script> <div id="player" class="aplayer aplayer-withlist aplayer-fixed" data-id="3025663508" data-server="netease" data-type="playlist" data-order="random" data-fixed="true" data-listfolded="true" data-theme="#2D8CF0"></div> '
1 2 3 4 5 6 7 8 9 10 11 12 13 custom_js: - https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js - https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js custom_css: - //cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css
博客全局配置:
1 2 3 aplayer: meting: true asset_inject: false
接下来调整下单一歌曲音乐播放器的样式。
hexo-tag-aplayer/docs/README-zh_cn.md at master · MoePlayer/hexo-tag-aplayer · GitHub
Windy Hill-羽肿-mp3 免费在线下载播放-放屁网-全网音乐 MP3 高品质在线免费下载、在线免费播放 (fangpi.net)
他妈的这 meting 版本还限制挺低:
1 2 3 4 5 6 7 custom_html: ' <!--音乐--> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css"> <script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js"></script> <div id="player" class="aplayer aplayer-withlist aplayer-fixed" data-id="3025663508" data-server="netease" data-type="playlist" data-order="random" data-fixed="true" data-listfolded="true" data-theme="#2D8CF0"></div> '
搞定了。
以下是完整的音乐播放器代码,阴差阳错之间匹配成功。
1 2 <script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js" ></script> <script src ="https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js" > </script >
1 {% meting "60198" "netease" "playlist" "autoplay" "mutex:false" "listmaxheight:340px" "preload:none" "theme:#ad7a86 " %}
来个官网插件参数翻译。
实现一个简单的加载动画。
1 2 3 4 5 6 7 8 ## Favorite<div id ="loading" style ="text-align:center; padding:20px;" > 正在加载歌单,请稍候... <div class ="spinner" > </div > </div > <style > .spinner { border : 4px solid rgba (0 , 0 , 0 , 0.1 ); width : 36px ; height : 36px ; border-radius : 50% ; border-left-color : #31C27C ; animation : spin 1s linear infinite; margin : 10px auto; } @keyframes spin { 0% { transform : rotate (0deg ); } 100% { transform : rotate (360deg ); } } </style > <script > setTimeout (function ( ) { document .getElementById ('loading' ).style .display = 'none' ; }, 3000 ); </script >
Markdown 如何分页操作_markdown 分页符-CSDN 博客
保存下第一版音乐餐厅页面:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 <div class ="music-container" > <div class ="music-header" > <h1 > 我的音乐收藏</h1 > <p class ="intro-text" > 这里收藏了我精心挑选的两份歌单,包含不同风格的音乐作品。点击播放按钮即可开始欣赏,也可以将喜欢的歌曲加入你的收藏~ </p > </div > <div id ="loading" class ="loading-animation" > <div class ="spinner" > </div > <p > 正在加载音乐资源,请稍候...</p > </div > <div class ="playlist-card" > <div class ="playlist-info" > <h2 > 🎵 清新民谣精选</h2 > <p class ="playlist-desc" > 这个歌单收录了温暖治愈的民谣作品,适合午后小憩或夜晚放松时聆听。包含陈粒、房东的猫、赵雷等歌手的代表作。 </p > <div class ="stats" > <span > 📅 更新时间: 2025.5</span > <span > 🎶 歌曲数量: 506</span > </div > </div > </div > <script src ="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js" > </script > <script src ="https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js" > </script > {% meting "8647467106" "tencent" "playlist" "mutex:false" "listmaxheight:400px" "preload:none" "theme:#31C27C" %} <div style ="page-break-after: always;" > </div > ------ <div class ="playlist-card" > <div class ="playlist-info" > <h2 > 🎧 治愈纯音乐</h2 > <p class ="playlist-desc" > 充满未来感的电子音乐合集,适合工作专注、运动健身或派对场景。包含The Chainsmokers、Alan Walker等艺术家的热门曲目。 </p > <div class ="stats" > <span > 📅 更新时间: 2025.05</span > <span > 🎶 歌曲数量: 477</span > </div > </div > </div > <script src ="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js" > </script > <script src ="https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js" > </script > {% meting "8181427733" "tencent" "playlist" "mutex:false" "listmaxheight:400px" "preload:none" "theme:#2D8CF0" %} <div class ="music-footer" > <p class ="feedback" > 有什么建议或想听的音乐类型?<a href ="#" > 告诉我</a > </p > </div > </div > <style > .music-container { max-width : 900px ; margin : 0 auto; padding : 20px ; font-family : "Helvetica Neue" , Arial, sans-serif; color : #333 ; } .music-header { text-align : center; margin-bottom : 30px ; } .music-header h1 { color : #31c27c ; font-size : 2.2em ; margin-bottom : 10px ; } .intro-text { color : #666 ; line-height : 1.6 ; max-width : 700px ; margin : 0 auto; } .playlist-card { display : flex; background : white; border-radius : 10px ; box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.08 ); margin-bottom : 30px ; overflow : hidden; } .playlist-info { flex : 1 ; padding : 25px ; min-width : 250px ; } .player-wrapper { flex : 1 ; min-width : 300px ; } .playlist-card h2 { color : #444 ; margin-top : 0 ; margin-bottom : 15px ; font-size : 1.5em ; } .playlist-desc { color : #666 ; line-height : 1.6 ; margin-bottom : 20px ; } .stats { display : flex; flex-wrap : wrap; gap : 15px ; color : #888 ; font-size : 0.9em ; } .loading-animation { text-align : center; padding : 30px ; margin : 20px 0 ; } .spinner { border : 4px solid rgba (0 , 0 , 0 , 0.1 ); width : 36px ; height : 36px ; border-radius : 50% ; border-left-color : #31c27c ; animation : spin 1s linear infinite; margin : 0 auto 15px ; } @keyframes spin { 0% { transform : rotate (0deg ); } 100% { transform : rotate (360deg ); } } .music-footer { text-align : center; margin-top : 40px ; padding-top : 20px ; border-top : 1px solid #eee ; } .social-share { display : flex; justify-content : center; gap : 10px ; margin : 15px 0 ; } .share-btn { background : #f0f0f0 ; border : none; padding : 8px 15px ; border-radius : 20px ; cursor : pointer; transition : background 0.2s ; } .share-btn :hover { background : #e0e0e0 ; } .feedback { color : #999 ; font-size : 0.9em ; } .feedback a { color : #31c27c ; text-decoration : none; } @media (max-width : 768px ) { .playlist-card { flex-direction : column; } .player-wrapper { min-width : 100% ; } } </style > <script > function hideLoader ( ) { document .getElementById ("loading" ).style .display = "none" ; } setTimeout (hideLoader, 3000 ); function checkPlayers ( ) { const players = document .querySelectorAll (".aplayer" ); if (players.length === 2 ) { hideLoader (); } else { setTimeout (checkPlayers, 100 ); } } checkPlayers (); </script >
不论怎么优化都不大好看。。
简约些。
友情链接
2025 年 5 月 31 日
昨天晚上八点钟前,花了一个多小时总算搞定了音乐餐厅的最终页面,花了整整二十四小时才总算交稿,真不算容易。
重新更换了首页导航栏的一部分封面大图,看起来更加美观大气了,上周收集下载的精美壁纸总算派上了用场,不过现在文章顺序被打乱了。
插入音乐 | 🔥 一个比较特别的 Hexo 主题 (nexmoe.com)
文章页
2025 年 6 月 1 日
1 一个人至少拥有一个梦想,有一个理由去坚强。心若没有栖息的地方,到哪里都是在流浪。
1 每一片落叶都承载着岁月的痕迹,而飘落的瞬间,也是新生的开始。
1 每一次跌倒都是成长的垫脚石,让我们站得更高,看得更远。
1 人生如逆旅,我亦是行人,但心中有爱,便不觉孤单。
1 梦想,是心灵的灯塔,照亮我们前行的道路,让我们在黑暗中也能找到方向。
1 真正的富有,不在于物质的堆砌,而在于精神的富足与内心的宁静。
1 每一次的回首,都是对过往的温柔告别,也是对未来勇敢前行的期许。
1 梦想是心灵的指南针,无论身处何方,都能指引我们找到回家的路。
1 人生如诗,不在于辞藻的华丽,而在于情感的真挚与深邃,每一行都是心灵的独白。
1 每一次的选择,都是对未来的期许,让我们在不确定中寻找到属于自己的方向。
1 每一颗心都是一座孤岛,但爱能搭建桥梁,让我们彼此相连,共同抵御风雨。
1 在这纷扰的世界里,愿你的心如一片宁静的湖泊,波澜不惊,温柔以待每一个晨曦与黄昏。
1 每一次的离别,都是为了更好的重逢,让我们珍惜每一次的相聚时光,铭记于心。
1 人生就像一场舞台剧,我们都是自己的导演与演员,用心演绎每一个角色,活出自己的精彩。
1 让我们以一颗平和的心,去面对生活的起起伏伏,因为内心的宁静才是最大的力量。
1 岁月悠悠,带走了青春的容颜,却留下了更加成熟与深邃的灵魂。
1 就像花朵需要阳光和雨露,你的心也需要被爱和关怀滋养,才能绽放出最灿烂的笑容。
1 生活的每一个瞬间都是独一无二的,让我们用心去感受,去珍惜。
1 当你感到迷茫时,不妨放慢脚步,听听内心的声音,它会指引你找到属于自己的方向。
1 无论遇到多大的困难,都请相信,时间会带走一切伤痛,留下的是更加坚韧和成熟的自己。
1 就像大海包容每一滴水珠,愿你的胸怀也能如此宽广,接纳世间万物,包括那些不完美的自己。
1 每一次呼吸都是宇宙间最温柔的拥抱,提醒我们,无论身处何方,都不孤单。
1 就像春天的花朵,无论经历了多少寒冬的洗礼,都会在春风的吹拂下绽放出最灿烂的笑容。
1 每一个夜晚的降临,都是为了让心灵得到休息,让明天的你更加充满活力和希望。
1 给自己一些温柔的时光,去聆听内心的声音,去感受那份宁静与平和。
1 当你感到疲惫时,记得抬头看看星空,那无尽的宇宙正温柔地告诉你:你比想象中更加坚强和美丽。
1 真正的勇气,不是不感到害怕,而是即便害怕也选择前行。
1 人生如戏,我们都是自己故事的主角,用心演绎,精彩纷呈。
1 真正的智慧,在于认识到自己的无知,并持续学习,不断进步。
1 真正的智慧,在于认识到自己的无知,并持续学习,不断进步。
1 生命的旅程就像一场冒险,每一步都充满了未知与惊喜。
1 每一次告别都是为了更好的重逢,让我们学会珍惜,也学会放手。
1 每一个梦想都值得我们去追逐,无论多远,都要坚持到底。
1 心怀善念,世界将回馈以温暖;心怀感恩,生活将充满阳光。
1 每一场旅程都是一次自我超越,让我们不断前行,不断探索。
1 心若向阳,无谓悲伤,微笑面对,生活自会报以温暖。
1 岁月漫长,然而值得期待,因为美好总在不经意间到来。
1 每一个黎明都带来新的希望,让我们满怀信心地迎接每一个新的开始。
1 无论风雨,无论晴天,愿你我都能以一颗平和的心,走过人生的四季。
1 每一次的相遇都是久别重逢,珍惜身边人,因为缘分不易。
1 每个人的心中都有一片未被发现的海洋,勇敢地去探索吧。
1 每次归程,都是为了更好出发;每次停歇,都是为了积攒力量
1 人生如戏,我们都是自己故事的主角,用心演绎,精彩纷呈。
1 每一次的选择,都塑造了今天的自己,未来的路,因选择而不同。
1 生命中的每一次相遇,都是命运的安排,珍惜每一次的邂逅,因为那可能是你生命中的贵人。
1 人生就像一场马拉松,重要的不是瞬间的爆发,而是途中的坚持与信念。
1 心态决定命运,用积极的心态去面对生活,生活也会以同样的方式回应你。
1 真正的幸福,不是拥有多少财富和地位,而是内心的充实与满足,以及身边人的陪伴与关爱。
1 真正的幸福,不在于外界的评价和物质的丰富,而在于内心的平和与满足。
1 梦想再大也不嫌大,追梦的人再小也不嫌小,因为心中有梦,就有无限可能。
1 生活不在于拥有多少,而在于感知多少,用心去感受,幸福其实就在身边。
1 无论未来的路有多么漫长和艰难,只要心中有光,就能照亮前行的每一步。
1 人生就像一杯茶,初尝或许苦涩,但细细品味,便能感受到其中的甘甜与清香。
1 梦想如同夜空中最亮的星,虽远必达,引领我们穿越黑暗,找寻心中的光明。
1 每个人的生命故事中,都有那么几个章节,让人难以忘怀,成为永恒的回忆。
1 岁月可以带走青春的容颜,但带不走内心的热忱与对生活的热爱。
1 每一天醒来,都是宇宙给予的新礼物,让我们带着感恩的心,去拥抱每一个可能
1 生活的美好,往往藏在细微之处,一颗感恩的心,足以让平凡变得非凡。
1 每一次呼吸,都是与世界的温柔对话,提醒我们要珍惜这份生命的奇迹。
1 每一个夜晚的结束,都是新希望的开始,让我们带着梦想,迎接每一个黎明。
1 人生如戏,我们都是自己故事的主角,用心演绎,才能收获属于自己的精彩。
1 每一次的放手,都是为了更好的拥有,让我们学会放下,迎接更加美好的未来。
1 岁月或许会改变我们的容颜,但那份对生活的热爱与追求,却会愈发坚定。
1 梦想是心灵的指南针,无论身处何方,都能指引我们找到回家的路。
1 真正的朋友,是在你需要时伸出援手,无需多言,一个眼神便能读懂彼此的心。
1 有时候,放慢脚步,才能更好地欣赏沿途的风景,感受生活的真谛。
1 心灵是一片广袤的田野,播种善良与希望,便能收获幸福与喜悦。
1 真正的强大,不是从不跌倒,而是在每次跌倒后都能勇敢地站起来,继续前行。
1 漫漫征途,岁月因青春慨然以赴而更加静好,世间因少年挺身向前而更加瑰丽。
1 人生就像一场旅行,重要的不是目的地,而是沿途的风景以及看风景的心情。
1 岁月是一本厚重的书,记录着我们的成长与变迁,也教会我们珍惜与感恩。
晚八点钟前,总算整理完毕,文章页面封面图,去掉插图及心灵寄语。
微图册
2025 年 6 月 5 日
免费制作电子图册-相册分享展示平台-微图册 (wtuce.com)
像这样的云服务还是挺多的,部分小程序也提供这样的功能,不过就拿这个网站来说,免费额度仅有 200MB,要花钱的服务还是不太值当的。
Memos
2025 年 6 月 28 日
自建 Memos 服务:碎片化笔记 + 博客说说栏,一栈双用 Memos 是一款轻量的自托管的备忘录中心。你可以把它当作个 - 掘金 (juejin.cn)
17.8k Star!开源且支持私有化部署的碎片化知识卡片管理工具-Memos 应用简览 主要特性 开源且永久免费:Mem - 掘金 (juejin.cn)
心猿意马 - 雨月空间站 (mintimate.cn)
用一张照片来代表今天。
2025 年 6 月 30 日
Blog - Memos (usememos.com)
Memos
部署
2025 年 6 月 30 日
1 2 ICP备案(互联网内容提供商备案)详解 ICP备案(Internet Content Provider备案)是中国大陆对网站或互联网服务进行合法化管理的重要制度,由国家工业和信息化部(MIIT)监管,所有在中国大陆境内提供服务的网站或服务器必须完成备案,否则可能被关停或屏蔽访问。
今天上午十点半,购买了新的云服务器,提交域名备案初审。
备案短信核验_备案(Filing Service)-阿里云帮助中心 (aliyun.com)
安装 Docker - 云服务器 ECS - 阿里云 (alibabacloud.com)
按这个方法安装 Docker。
安装 Docker。
安装 Docker,执行以下命令安装 Docker 社区版本,通过查看 Docker 版本命令,验证 Docker 是否安装成功。
1 2 3 4 5 6 7 8 9 10 11 sudo wget -O /etc/yum.repos.d/docker-ce.repo http://mirrors.cloud.aliyuncs.com/docker-ce/linux/centos/docker-ce.repo sudo sed -i 's|https://mirrors.aliyun.com|http://mirrors.cloud.aliyuncs.com|g' /etc/yum.repos.d/docker-ce.repo sudo dnf -y install dnf-plugin-releasever-adapter --repo alinux3-plus sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo systemctl start docker sudo systemctl enable docker
创建简单 Web 程序镜像,构建 Web 程序镜像,启动 Web 程序镜像的容器,并且命名容器名称为hello-world
。
1 2 3 4 5 6 7 8 9 sudo docker pull nginx:latest sudo tee Dockerfile <<-'EOF' FROM nginx:latest RUN echo 'Hello World!' > /usr/share/nginx/html/index.html EOF sudo docker build . -t hello-world:latest
不过这里第一步拉取 Nginx 镜像就失败了,得配置 Docker 镜像加速器。
登录阿里云控制台,进入 容器镜像服务 > 镜像加速器 ,获取专属加速地址(如 https://<your-id>.mirror.aliyuncs.com
)。
容器镜像服务 ACR 控制台 (aliyun.com)
1 https:// 0 i6jgqxx.mirror.aliyuncs.com
修改 Docker 配置。
1 2 3 4 5 6 7 8 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors" : ["https://0i6jgqxx.mirror.aliyuncs.com" ] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
镜像源修改成功,直接拉取 Nginx 镜像,一切顺利。
1 2 3 4 5 6 7 8 9 10 11 [root@iZ2zehqnajgv7sc3i778n0Z ~] latest: Pulling from library/nginx a2abf6c4d29d: Pull complete a9edb18cadd1: Pull complete 589b7251471a: Pull complete 186b1aaa4aa6: Pull complete b4df32aa5a72: Pull complete a0bcbecc962e: Pull complete Digest: sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31 Status: Downloaded newer image for nginx:latest docker.io/library/nginx:latest
我记得今年年初也有过解决 Docker 拉取镜像失败的问题,同样是修改镜像源,操作基本相同,参考以下文章。
Docker 修改国内镜像源_docker 更换国内镜像源-CSDN 博客
这篇写得很详细了:docker 切换国内镜像源_mob64ca12f10f72 的技术博客_51CTO 博客
继续之前的操作,构建 Web 程序镜像。
1 2 3 4 5 6 7 8 9 # 拉取Nginx镜像 sudo docker pull nginx:latest# 创建Dockerfile设置Nginx作为基础镜像,并在Web服务器的根目录创建一个显示Hello World!的index.html文件。 sudo tee Dockerfile <<-'EOF' FROM nginx:latest RUN echo 'Hello World!' > /usr/share/nginx/html/index.html EOF# 构建镜像,镜像名称为hello-world sudo docker build . -t hello-world:latest
启动 Web 程序镜像的容器,并且命名容器名称为hello-world
。
1 sudo docker run -d -p 80:80 --name hello-world hello-world:latest
执行curl http://localhost
命令,验证 Web 程序是否正确显示Hello World!
。
1 2 [root@iZ2zehqnajgv7sc3i778n0Z ~] Hello World!
安装 Docker Compose
如果您参考以上方式安装 Docker,那么 Compose 插件将默认安装到您的实例中。您可以通过如下命令查看。
1 sudo docker compose version
1 2 [root@iZ2zehqnajgv7sc3i778n0Z ~] Docker Compose version v2.27.0
预期输出(vN.N.N 代表 Compose 的版本):Docker Compose version vN.N.N
。
如果您的 Compose 插件未成功安装或您需要使用 Compose 独立版(docker-compose
)可参考下面内容。
安装 Docker - 云服务器 ECS - 阿里云 (alibabacloud.com)
这些内容参考官方文档就可以了,最后还是要使用查看 Compose 版本命令,验证 Compose 是否安装成功。
使用 Docker Compose 部署应用
以下是创建基于 WordPress 镜像的 Web 程序。
创建 Compose 编排文件并启动 WordPress 服务。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 sudo tee docker-compose.yaml <<-'EOF' version: '3.1' services: wordpress: image: wordpress restart: always ports: - "80:80" environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: 123456 WORDPRESS_DB_NAME: wordpress volumes: - wordpress:/var/www/html db: image: mysql:5.7 restart: always ports: - "3306:3306" environment: MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: 123456 MYSQL_RANDOM_ROOT_PASSWORD: '1' volumes: - db:/var/lib/mysql volumes: wordpress: db: EOF sudo env "PATH=$PATH " docker compose up -d
这里启动服务器竟然有报错了,估计是服务端口冲突了,刚才在 80 端口启动了 Hello World 测试服务。
1 2 3 4 5 [root@iZ2zehqnajgv7sc3i778n0Z ~] CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e9f71f7b68d5 wordpress "docker-entrypoint.s…" About a minute ago Created root-wordpress-1 8c0aee8f6006 mysql:5.7 "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp root-db-1 e1b3d3f9f718 hello-world:latest "/docker-entrypoint.…" 11 minutes ago Up 11 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp hello-world
1 [root@iZ2zehqnajgv7sc3i778n0Z ~]
1 [root@iZ2zehqnajgv7sc3i778n0Z ~]
Memory’s Blog – 又一个 WordPress 站点
成功部署了 WordPress 个人博客站点,提供了很多热门的免费主题,直接下载安装完成后即可使用,这个博客确实方便,还配备了专门的后台管理系统。
Memos 镜像
1 2 sudo docker pull usememos/memos:latest
1 2 3 4 5 6 7 8 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors" : ["https://0i6jgqxx.mirror.aliyuncs.com" ] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
一直显示拉取失败,阿里云镜像仓库没有同步 Memos 镜像吗。
1 2 [root@iZ2zehqnajgv7sc3i778n0Z docker] Error response from daemon: Get "https://registry-1.docker.io/v2/" : context deadline exceeded
使用终极解决方案: 直接使用 GitHub 源码构建(终极方案) ,如果镜像源均不可用,可自行构建。
1 2 3 4 5 6 7 8 9 git clone https://github.com/usememos/memos.gitcd memos docker build -t memos:latest . docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos memos:latest
在这之前,得先安装 git,执行安装,并验证安装。
1 2 3 完毕! [root@iZ2zehqnajgv7sc3i778n0Z docker] git version 2.43.5
。。。
1 2 3 [root@iZ2zehqnajgv7sc3i778n0Z docker] 正克隆到 'memos' ... 致命错误:无法访问 'https://github.com/usememos/memos.git/' :Failed to connect to github.com port 443: 连接超时
usememos/memos: A modern, open-source, self-hosted knowledge management and note-taking platform designed for privacy-conscious users and organizations. (github.com)
刚刚使用 SSH 协议替代 HTTPS 协议,在云服务器生成了密钥,并将公钥添加到了 GitHub,登录 GitHub → Settings → SSH and GPG keys → 添加公钥。
1 2 ssh-keygen -t ed25519 -C "your_email@example.com" cat ~/.ssh/id_ed25519.pub
但最终测试链接还是超时失败了。
1 2 [root@iZ2zehqnajgv7sc3i778n0Z docker] ssh: connect to host github.com port 22: Connection timed out
索性在 Github Fork Memos 镜像仓库,再导入 Gitee 仓库,最后在 Gitee 添加服务器公钥实现认证,总该能成功拉取官方镜像源吧。
拉取 Gitee 镜像代码仓库。
1 git clone git@gitee.com:deng-2022/memos.git
1 2 3 4 5 6 7 8 9 10 11 12 13 [root@iZ2zehqnajgv7sc3i778n0Z docker] 正克隆到 'memos' ... The authenticity of host 'gitee.com (180.76.199.13)' can't be established. ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc. Are you sure you want to continue connecting (yes/no/[fingerprint])? y Please type ' yes ', ' no' or the fingerprint: yes Warning: Permanently added ' gitee.com,180.76.199.13' (ECDSA) to the list of known hosts. remote: Enumerating objects: 42879, done. remote: Counting objects: 100% (42879/42879), done. remote: Compressing objects: 100% (9910/9910), done. remote: Total 42879 (delta 31416), reused 42879 (delta 31416), pack-reused 0 (from 0) 接收对象中: 100% (42879/42879), 35.67 MiB | 9.95 MiB/s, 完成. 处理 delta 中: 100% (31416/31416), 完成.
继续未完成的操作,克隆源码成功后,自行构建镜像。
1 2 3 4 5 6 7 8 9 git clone git@gitee.com:deng-2022/memos.gitcd memos/scripts docker build -t memos:latest . docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos memos:latest
1 2 sudo systemctl daemon-reload sudo systemctl restart docker
白忙活一场,到头来还是需要拉取基础镜像,镜像源修改还是没有生效,拉个镜像就连接超时。
1 2 docker pull alpine:latest docker pull golang:1.24-alpine
1 => [internal] load metadata for docker.io/library/golang:1 .24 -alpine
问题还偏偏出现在这个破镜像上,手动下载吧。
第八阶段【DBA 自动化】06:CentOS 安装 go 环境_golang 1.24.2 下载-CSDN 博客
1 wget https://g olang.google.cn/dl/g o1.24.2 .linux-amd64.tar.gz
1 2 3 4 5 6 7 8 9 sudo tar -C /usr/local -xzf go1.24.2.linux-amd64.tar.gzecho 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrcsource ~/.bashrc go version
1 2 3 4 5 [root@iZ2zehqnajgv7sc3i778n0Z scripts] [root@iZ2zehqnajgv7sc3i778n0Z scripts] [root@iZ2zehqnajgv7sc3i778n0Z scripts] [root@iZ2zehqnajgv7sc3i778n0Z scripts] go version go1.24.2 linux/amd64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 FROM golang:1.24-alpine AS backend WORKDIR /backend-build COPY go.mod go.sum ./ RUN go mod download COPY . . RUN --mount=type =cache,target=/go/pkg/mod \ --mount=type =cache,target=/root/.cache/go-build \ go build -ldflags="-s -w" -o memos ./bin/memos/main.go FROM alpine:latest AS monolithic WORKDIR /usr/local/memos RUN apk add --no-cache tzdata ENV TZ="UTC" COPY --from=backend /backend-build/memos /usr/local/memos/ COPY ./scripts/entrypoint.sh /usr/local/memos/ EXPOSE 5230 RUN mkdir -p /var/opt/memos VOLUME /var/opt/memos ENV MEMOS_MODE="prod" ENV MEMOS_PORT="5230" ENTRYPOINT ["./entrypoint.sh" , "./memos" ]
1 ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 5e8c89a3-1927-49ae-bf7e-1543f565993f::reae01uls78mmnhox88ewtmd5: "/scripts/entrypoint.sh" : not found
不过是徒劳。
1 2 3 4 5 6 7 8 FROM alpine AS backend WORKDIR /backend-build RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories RUN apk add --no-cache go gcc musl-dev COPY ./go.mod ./go.sum ./ RUN go mod download COPY . .
还是解决镜像源问题吧,一劳永逸,浪费了两小时时间,没有丝毫进展。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [root@iZ2zehqnajgv7sc3i778n0Z docker] ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2025-06-30 13:36:11 CST; 36s ago Docs: https://docs.docker.com Process: 476829 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 476829 (code=exited, status=1/FAILURE) 6月 30 13:36:09 iZ2zehqnajgv7sc3i778n0Z systemd[1]: Failed to start Docker Application Container Engine. 6月 30 13:36:11 iZ2zehqnajgv7sc3i778n0Z systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart. 6月 30 13:36:11 iZ2zehqnajgv7sc3i778n0Z systemd[1]: docker.service: Scheduled restart job, restart counter is at 3. 6月 30 13:36:11 iZ2zehqnajgv7sc3i778n0Z systemd[1]: Stopped Docker Application Container Engine. 6月 30 13:36:11 iZ2zehqnajgv7sc3i778n0Z systemd[1]: docker.service: Start request repeated too quickly. 6月 30 13:36:11 iZ2zehqnajgv7sc3i778n0Z systemd[1]: docker.service: Failed with result 'exit-code' . 6月 30 13:36:11 iZ2zehqnajgv7sc3i778n0Z systemd[1]: Failed to start Docker Application Container Engine. 6月 30 13:36:39 iZ2zehqnajgv7sc3i778n0Z systemd[1]: docker.service: Start request repeated too quickly. 6月 30 13:36:39 iZ2zehqnajgv7sc3i778n0Z systemd[1]: docker.service: Failed with result 'exit-code' .
docker 服务都垮了。
1 2 3 4 { "registry-mirrors" : ["https://<你的ID>.mirror.aliyuncs.com" ], "registry-mirrors-only" : true // 强制只从镜像加速器拉取 }
混账 AI 糊弄我,这文件就不能这么写。
Docker 安装及镜像源修改-阿里云开发者社区 (aliyun.com)
1 2 sudo systemctl daemon-reload sudo systemctl restart docker
docker 换国内镜像源,docker 换源-阿里云开发者社区 (aliyun.com)
折腾了一上午,快到中午两点整总算弄好了。
换镜像源就得按照这篇文章里写的,把以下国内镜像源挨个配置上去,这样直接执行拉取镜像就成功了。
1 2 3 4 5 6 7 8 9 10 11 12 echo >/etc/docker/daemon.jsoncat >/etc/docker/daemon.json <<END { "registry-mirrors": [ "https://hub-mirror.c.163.com", "https://ustc-edu-cn.mirror.aliyuncs.com", "https://ghcr.io", "https://mirror.baidubce.com" ] } END systemctl restart docker
1 docker pull usememos/memos
1 2 3 4 5 6 7 8 9 10 11 12 [root@iZ2zehqnajgv7sc3i778n0Z ~] Using default tag: latest latest: Pulling from usememos/memos 1f3e46996e29: Pull complete 3c6dabcaff14: Pull complete 066876855edf: Pull complete 12e6e904a51b: Pull complete acc8f9c158a7: Pull complete 0ecac9b063ba: Pull complete Digest: sha256:4723d86e6797fd629f1f2ff7afd4e37e669df7318f00de31c7ff9acf1fe9db7f Status: Downloaded newer image for usememos/memos:latest docker.io/usememos/memos:latest
自建 Memos 服务:碎片化笔记 + 博客说说栏,一栈双用 Memos 是一款轻量的自托管的备忘录中心。你可以把它当作个 - 掘金 (juejin.cn)
直接用 docker compose 启动。
1 2 3 4 5 6 mkdir -p /dockerData/memoscd /dockerData/memostouch docker-compose.yml
我的 docker-compose.yml 文件如下:
1 2 3 4 5 6 7 8 9 10 11 12 services: memos: image: usememos/memos:latest container_name: memos restart: unless-stopped ports: - "5230:5230" volumes: - /dockerData/memos/data:/var/opt/memos environment: - MEMOS_MODE=prod - MEMOS_PORT=5230
最后,启动 memos:
1 2 3 4 docker compose pull docker compose up -d
现在,访问 Memos (http://47.93.135.62:5230/) 即可,注册登录,就可以发表留言了,这个备忘录很好用。
融入 Hexo
2025 年 6 月 30 日
Mintimate/memos-bb-time: A Hexo plugin that integrates Memos’ API to add a Twitter-like ‘moments’ (shuoshuo) feature to your Hexo blog (github.com)
1 2 3 4 5 6 7 8 <script type ="text/javascript" > var bbMemos = { memos : 'http://47.93.135.62:5230/' , //修改为自己部署 Memos 的网址,末尾有 / 斜杠 limit : '10' ,//默认每次显示 10 条 creatorId:'1' ,//早期默认为 101 用户,新安装是 1; https://demo.usememos.com/u/101 domId: '#bber' ,//默认为 bber } </script>
1 - { key : "说说" , link : "/Memos/" , icon: "iconfont icon-comment " }
iconfont-阿里巴巴矢量图标库
在 Hexo 博客中创建一个独立页面,通过 Memos API 展示说说内容。
功能说明
创建独立说说页面,不依赖插件
通过 Memos API 获取最新内容
响应式设计,适配各种设备
创建新页面:
下载 source
目录,将内部的文件全部复制到 Hexo 博客的 source
目录下。
编辑生成的 source/Memos/index.md
文件:
1 2 3 4 5 6 var bbMemos = { memos : '',//修改为自己部署 Memos 的网址,末尾有 / 斜杠 limit : '10',//默认每次显示 10 条 creatorId:'1' ,//早期默认为 101 用户,新安装是 1; https://demo.usememos.com/u/101 domId: '#bber',//默认为 bber }
编辑主题配置文件:
编辑主题配置文件,添加导航内容。以 fluid 主题为例,编辑_config.fluid.yml
内menu
部分:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 menu: - { key: "home" , link: "/" , icon: "iconfont icon-home-fill" } - { key: "archive" , link: "/archives/" , icon: "iconfont icon-archive-fill" } - { key: "category" , link: "/categories/" , icon: "iconfont icon-category-fill" , } - { key: "tag" , link: "/tags/" , icon: "iconfont icon-tags-fill" } - { key: "links" , link: "/links/" , icon: "iconfont icon-link-fill" } - { key: "about" , link: "/about/" , icon: "iconfont icon-user-fill" } - { key: "意马" , link: "/Memos/" , icon: "iconfont iconbg-chat" } - { key: "发现" , icon: "iconfont iconnaicha" , submenu: [ { key: "哔哩哔哩" , link: "https://space.bilibili.com/355567627" , icon: "iconfont iconbilibili" , }, { key: "Youtube" , link: "https://www.youtube.com/@mintimate" , icon: "iconfont iconyoutube" , }, { key: "Github" , link: "https://github.com/Mintimate" , icon: "iconfont icongit" , }, ], }
重启 Hexo 服务,访问 http://localhost:4000/Memos/
即可查看效果。
1 2 3 4 5 6 7 8 9 10 11 12 --- 音乐: banner_img: /img/newBG/girl20250517.jpg banner_img_height: 100 banner_mask_alpha: 0.3
1 2 3 4 5 6 7 8 9 10 11 12 --- 说说: banner_img: /img/newBG/bus20250517.jpg banner_img_height: 100 banner_mask_alpha: 0.3
1 2 - { key: "音乐" , link: "/playlist/" , icon: "iconfont icon-music" }- { key: "说说" , link: "/memos/" , icon: "iconfont icon-comment " }
这样自定义页面完成以后,个人博客“说说”栏目页新增完毕。
成功将 Memos 备忘录功能融入 Hexo。
Memos
文章分类
2025 年 7 月 6 日
今晚彻底翻新下文章分类,现在的文章所属分类就像标签一样,本不应该搞得这么杂乱,优化完毕后将来检索某领域下的文章会更高效。
分类:
代码锋芒,部署之道,架构探微,工善其事,算法物语,项目志录。
人间片刻,旧梦轻拾,灵感工坊,职路星火。
晚十一点半,总算完工了博客文章分类。
图床 搭建图床 几个月前搞伙伴匹配系统轮播图,想用自己的图片来做这个轮播图 (2023/12/02 早)
那我搭建一个自己的图床呗 拿个图片老方便了 学一学怎么搭建图床 说干就干
搭建过程就不多说了 收藏了好几个 CSDN 博客教程
最重要的是在 PicGo 里下一个插件 搭建一个 Gitee 图床 (不用 GitHub 图床是因为这玩意儿 BUG 太多了 尤其是网络原因)
两个图床的配置都放下面了 我用了 Gitee 图床
上传到图床的图片可以随意使用了
在 Typora -> 偏好设置 -> 图像 里配置好上传服务和 PicGo 路径后 Typora 里使用到的图片都会自动上传到图床上去
最后展示一下我刚上传到图床里的图片吧
操他妈的上个厕所就能显示了
总之 图床可以正常使用了 现在把浏览器收藏夹整理一下先 (2023/05/23 晚)
今天距伙伴匹配系统从零开发 整整俩个月了 简单纪念一下 但是今天不想编码了 干点儿别的吧 (2023/05/24 晚)
好用的图床
2024 年 6 月 10 日
推荐阅读:分享 8 个免费的图床,帮助你轻松在 Power BI 报告中使用图片注册 支持_https (sohu.com)
最近尝试在云服务器上搭建个人博客,顺便学习了基础的 Linux 命令操作、Nginx 安装配置、Node 安装配置和 Git 安装配置。
我已经把 Gitee 图床上的图片上传至七牛云中,之后等域名备案完成之后,直接批量修改个人博客中引用到的图片路径就行了。
七牛云也提供免费的对象存储服务,一个月免费十个 G 的额度,够用了。
Hello 图床 :https://www.helloimg.com/
什么情况,这个免费的图床这么好用。
我就尝试了这一个,剩下的点开主页看了看,展示一下吧(普通人使用免费图床的门槛也低了很多,确实挺方便 ):
PicGo:https://www.picgo.net/
路过图床 :https://imgse.com/
sm.ms :https://sm.ms
薄荷图床 :https://riyugo.com/
风筝图床:https://www.imgbed.link/
ImgURL 图床 :https://www.imgurl.org/
Z4A 图床 :https://z4a.net/
七牛云
2024 年 7 月 8 日
设置自定义源站域名使用指南 对象存储 - 七牛开发者中心 (qiniu.com)
七牛云新建对象存储空间后,会自动生成一个域名,一个月后自动失效。
这个临时域名实际上是配置了域名转发,将资源地址转发到真实的域名下,真实服务器的域名跟对象存储桶的存储区域相关:
比方说这个存储区域下的服务器域名就是:iovip-z1.qiniuio.com
临时域名失效后,就需要配置自定义域名就能生成存储空间的图片外链,才能够在浏览器中正常访问到图片。
我的域名上个月提交备案后,十天左右就备案通过了,添加 CNAME 即解析记录:
这里需要着重注意两点:记录值(目标服务器)和主机记录(映射域名) ,当然记录类型 要为 CNAME ,配置完成即可:
七牛云这边就可以自定义源站域名,并成功绑定:
阿里云有个挺不错的网络拨测工具,查看域名能否访问到,检测网络是否连通:
PicGo 配置七牛云图床:
baidu.com/link?url=23pidhpNvNJLrDF64nSHp7b2lJVZnS8nGw5-Oxb61tPJYDqWZ_R-O9ujTnZGvKX2mSpQYNl93Rh4JE9xbuMuwujstgFg7gRELrkF4NkDlqW&wd=&eqid=b2f86f280031714e00000003668bdc85
配置完成后上传成功,浏览器也能正常显示,可 Typero 上显示不出来。
妈的,写了个 http 协议前缀就正常访问了,真诡异。
七牛云图床设置改成这样就行了,问题解决:
2024 年 7 月 9 日
浏览器还是不显示,正在解决中。。
解决了,也不算解决了,只是发现问题所在了:Hexo 图片插入无法显示的问题 - 知乎 (zhihu.com)
2024 年 7 月 11 日
2025 年 1 月 13 日
七牛云收费标准:
对象存储容量收费:用户需要为存储在七牛云存储中的对象分配相应的存储空间,每个对象的大小不同,因此会产生不同的费用,七牛云存储提供了多种存储空间套餐,用户可以根据自己的需求选择合适的套餐。
流量收费:用户在使用七牛云存储的过程中,会产生数据的读写操作,从而产生流量费用,七牛云存储提供了按量付费和包年包月两种流量计费方式,用户可以根据自己的需求选择合适的计费方式。
请求次数收费:用户在使用七牛云存储的过程中,会产生各种 API 请求,如上传、下载、删除等,每次请求都会消耗一定的请求次数,七牛云存储提供了按量付费和包年包月两种请求次数计费方式,用户可以根据自己的需求选择合适的计费方式。
我开设的这个存储空间,本来每个月都有免费 30 GB 免费存储额度的,但上传下载需要额外计费,按量计费。
踩坑记录 node 版本过高
注意,在使用 VuePress 生成文档站点的最后一步:在本地启动文档站点服务时,我出现了这样的问题:
这就是此时的 node 版本过高,导致的兼容性问题(此时我用的是 v18.16.1),转换 node 为低版本 v16.19.0 后,问题解决
这里也能比较出 VuePress 站点生成器相较于 VitePress,是有点落后了,推荐使用 VitePress 站点生成器
成功在本地开启 VuePress 文档站点服务!效果如下:
这个问题其实是 VuePress 站点生成器的共同问题,不兼容较新的 node.js 环境,我在配置使用 vuepress-theme-vdoing 主题时,也出现了这个问题
遇到这种问题,要么降低 node 版本去兼容,要么舍弃这种程序服务
比如用 VitePress 替代 VuePress,用 vuepress-theme-hope 主题替代 vuepress-theme-vdoing 主题
具体怎么应对,各求所需,因人而异
node 版本过低
我在安装配置 VitePress 文档站点主题时,报错了:
很显然,node 版本过低,于是我修改 node 版本为 18.16.1,问题成功解决
有关 node 版本的修改可以在《配置指南-掌握 Node.js 配置》一文中详细了解
成功安装 hope 主题,开启文档站点服务,效果如下:(2023/07/04 晚)
模板文件格式不规范
今天部署博客时,出现了这样的错误:(2023/08/07 早)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 FATAL { err: Template render error: (unknown path) Error: expected end of comment, got end of file at Object._prettifyError (D:\blog\blog\node_modules\nunjucks\src\lib.js:36:11) ... 17 lines matching cause stack trace ... at process.processImmediate (node:internal/timers:476:21) { cause: Template render error: (unknown path) Error: expected end of comment, got end of file at Object._prettifyError (D:\blog\blog\node_modules\nunjucks\src\lib.js:36:11) at Template.render (D:\blog\blog\node_modules\nunjucks\src\environment.js:538:21) at Environment.renderString (D:\blog\blog\node_modules\nunjucks\src\environment.js:380:17) at D:\blog\blog\node_modules\hexo\lib\extend\tag.js:236:16 at tryCatcher (D:\blog\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise.fromNode.Promise.fromCallback (D:\blog\blog\node_modules\bluebird\js\release\promise.js:209:30) at Tag.render (D:\blog\blog\node_modules\hexo\lib\extend\tag.js:235:20) at Object.onRenderEnd (D:\blog\blog\node_modules\hexo\lib\hexo\post.js:297:22) at D:\blog\blog\node_modules\hexo\lib\hexo\render.js:79:21 at tryCatcher (D:\blog\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\blog\blog\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (D:\blog\blog\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (D:\blog\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (D:\blog\blog\node_modules\bluebird\js\release\promise.js:729:18) at _drainQueueStep (D:\blog\blog\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (D:\blog\blog\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (D:\blog\blog\node_modules\bluebird\js\release\async.js:102:5) at Async.drainQueues (D:\blog\blog\node_modules\bluebird\js\relea
出现这样的很正常,检查一下哪篇.md 文章里的格式出错了:
如果无法准确定位到是哪篇文章出问题了,可以这样执行命令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 03:10:55.161 DEBUG Rendering post: D:\blog\blog\source \_posts\解决前端框架使用中的常见问题.md 03:10:55.185 FATAL { err: Template render error: (unknown path) Error: expected end of comment, got end of file at Object._prettifyError (D:\blog\blog\node_modules\nunjucks\src\lib.js:36:11) ... 17 lines matching cause stack trace ... at process.processImmediate (node:internal/timers:476:21) { cause: Template render error: (unknown path) Error: expected end of comment, got end of file at Object._prettifyError (D:\blog\blog\node_modules\nunjucks\src\lib.js:36:11) at Template.render (D:\blog\blog\node_modules\nunjucks\src\environment.js:538:21) at Environment.renderString (D:\blog\blog\node_modules\nunjucks\src\environment.js:380:17) at D:\blog\blog\node_modules\hexo\lib\extend\tag.js:236:16 at tryCatcher (D:\blog\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise.fromNode.Promise.fromCallback (D:\blog\blog\node_modules\bluebird\js\release\promise.js:209:30) at Tag.render (D:\blog\blog\node_modules\hexo\lib\extend\tag.js:235:20) at Object.onRenderEnd (D:\blog\blog\node_modules\hexo\lib\hexo\post.js:297:22) at D:\blog\blog\node_modules\hexo\lib\hexo\render.js:79:21 at tryCatcher (D:\blog\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\blog\blog\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (D:\blog\blog\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (D:\blog\blog\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (D:\blog\blog\node_modules\bluebird\js\release\promise.js:729:18) at _drainQueueStep (D:\blog\blog\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (D:\blog\blog\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (D:\blog\blog\node_modules\bluebird\js\r
超链接出现 # 特殊符号了,导致编译失败,删除就行了(2023/08/07 早)
友链 item 格式错误
今天更新了下个人博客的友链列表,竟然这样也能出错:
如上,把哪个明显的缩进取消了就行了(2023/10/01 晚)
图片违规
好好好,我删了就是了,正好没有文章引用这张图(2023/10/02 午)
title 格式错误
奶奶的,就这里的问号后面没有空格,眼瞅着它报了一个月的错:(2023/12/01 晚)
密钥
2025 年 6 月 5 日
今天部署博客出现了问题,这应该是前段时间在本机重新生成 .ssh 密钥对后没有及时在部署平台做对应修改,现在权限识别错误。
1 2 3 4 5 6 7 8 9 10 11 Please make sure you have the correct access rights and the repository exists. FATAL { err: Error: Spawn failed at ChildProcess.<anonymous> (D:\Blog\blog\node_modules\hexo-util\lib\spawn.js:51:21) at ChildProcess.emit (node:events:513:28) at cp.emit (D:\Blog\blog\node_modules\cross-spawn\lib\enoent.js:34:29) at ChildProcess._handle.onexit (node:internal/child_process:291:12) { code: 128 } } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
我的工作台-AtomGit
总结
2023 年 5 月 27 日
至此,快速搭建博客站点和快速生成文档站点已经完毕。
在接下来的内容中,我们会继续分享如何使用 Gitee/GitHub 的 Page 服务来托管静态网站,详见《大道至简:快速搭建博客与文档站点的终极指南 2.0》。
有关博客/文档站点的详细配置,包括主题配置、目录结构等,我们会在《大道至简:快速搭建博客与文档站点的终极指南 3.0》一文中详细讲解。