
Hexo | 修改 Gallery 全流程记录

为便于自己对本博客的维护和更新,将 Gallery 页面的大幅改动记录在此,为以后的内容提供参考。
主要改动内容:
-
修改 page-template.ejs 的内容,为 Gallery 页面单独去除圆角背景板
-
修改 photo-album.ejs 的内容,为 Gallery 页面添加标题、副标题
-
通过 css 注入,修改页面排版、图片放大效果等细节内容
-
修改字体加载逻辑,优化字体显示速度(详见文章《Hexo | 博客网站字体加载缓慢问题解决方案》)
修改 page-template.ejs
page-template.ejs 位置:
1 | node_modules\hexo-theme-keep\layout\_template\page-template.ejs |
在 line 19 添加
1 | if (current_page_data) { keep_container = '' } |
使得 keep_container 为空,进而不渲染圆角背景板。
修改 photo-album.ejs
photo-album.ejs 位置:
1 | node_modules\hexo-theme-keep\layout\_template\photo-album.ejs |
在代码开头前添加
1 | <div class="photo-album-header"> |
从而显示标题和副标题内容。
修改 css 内容
添加一个 gallery.css,在 hexo 的主题 yml 配置文件中,找到 inject 栏,填入 gallery.css
1 | inject: |
在 gallery.css 文件中添加各种详细内容:
1 |
|
Comments
Comment plugin failed to load
Loading comment plugin