简单记录一下优化 NexT 主题过程中的一些细节。
There is a negligible beginning in all great action and thought.
圆角设置
此优化仅对 Pisces 和 Gemini 主题适用。
(以 Pisces 为例)修改文件 \themes\next\source\css\_variables\Pisces.styl
将 Borders 下对应位置的 initial 改为
1 | $border-radius-inner = 15px 15px 15px 15px; |
背景色更换
修改文件 themes\next\source\css\_custom\custom.styl ,添加:
1 | body { |
去除顶部细线
修改文件 themes\next\source\css\_custom\custom.styl
添加代码 .headband {display:none;}
页面宽度位置设置
修改文件 themes\next\source\css\_custom\custom.styl ,添加:
1 | .content-wrap { |
其实想要修改页面形态效果,直接在对应的网页 Styles上修改,然后复制到 custom.styl 即可。
Sidebar 头像链接主页
修改文件 themes\next\layout\_macro\sidebar.swig,找到对应位置:
1 | <a href="/"> |
找到中间三行,添加第一行 <a href="/"> 和最后一行 </a> 即可,中间部分不用修改。
Sidebar posts 链接修复
修改文件 themes/next/layout/_macro/sidebar.swing ,找到对应位置:
1 | {% if config.archive_dir != '/' and site.posts.length > 0 %} |
删掉判断部分,保留 else 的内容,即:
1 | {% if config.archive_dir != '/' and site.posts.length > 0 %} |
Sidebar Social 开关
修改文件 themes/next/_config.yml ,搜索 social,打开你想要的开关。
貌似一些 Social 开关是隐藏的,比如 QQ , Wechat 或 Weibo ,仿照格式写就可以。
如果想只显示图标(如本站),打开 social_icons 下的 icons_only 开关即可。
Sidebar 显示进度条和返回
修改文件 themes/next/_config.yml ,搜索关键字 b2t ,把这两个选项改为 true :
1 | # Back to top in sidebar |
pdf 文件显示
折叠展开功能
修改文章 Tag 图标
修改文件 /themes/next/layout/_macro/post.swing
搜索 rel="tag"># 将 # 替换为 <i class="fa fa-envira"></i>,即可显示 fa-tag 图标。
To be continued…