Acrylic主题自定义三:修改部分功能
Acrylic主题自定义三:修改部分功能
修改页脚
主题默认页脚功能和个人需求有些差异,小改一下
修改页脚导航
页脚的导航功能不太需要,但不写内容也会占空间,不太好看,修改一下结构,需要使用才显示
修改主题配置文件
1
2
3
4
5
6
7# 页脚
footer:
group:
# 是否显示
enable: false
# 导航列表
list:修改代码
需要修改的代码位置
themes/Acrylic/layout/partial/footer.ejs
,根据id="heo-footer"
找到代码位置,进行替换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<div id="heo-footer" style="display: <%= theme.footer.group.enable ? 'block' : 'none' %>;">
<% for(const x in theme.footer.group.list){ %>
<div class="footer-group">
<h3 class="footer-title"><%= x %></h3>
<div class="footer-links">
<% for(const y in theme.footer.group.list[x]){ %>
<a class="footer-item" href="<%= url_for(theme.footer.group.list[x][y]) %>" title="<%= y %>" rel="noopener external nofollow noreferrer"><%= y %></a>
<% } %>
</div>
</div>
<% } %>
<%# 以下为友链内容无需修改 %>
<% if(theme.footer.randomlink){ %>
<div class="footer-group">
<div class="footer-title-group">
<h3 class="footer-title">友链</h3>
<a class="random-friends-btn" href="javascript:randomLinksList();" rel="external nofollow">
<i class="fa-solid fa-arrow-rotate-right"></i>
</a>
</div>
<div class="footer-links" id="friend-links-in-footer">
</div>
</div>
<% } %>
</div>
修改页脚链接
有些社区使用链接不太方便,于是乎修改成左边使用链接,右边使用账号或码
修改主题配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17# 页脚
footer:
information:
left:
Github:
icon: fa-brands fa-github
url: https://github.com/Dream-ruins
Mail:
icon: fa-solid fa-envelope
url: mailto:thedreamruins@163.com
right:
QQ:
icon: fa-brands fa-qq
code: 2548116435
Steam:
icon: fa-brands fa-steam
code: 896813506修改代码
修改 Logo 悬浮效果
个人感觉 Logo 悬浮效果有些僵硬,小改一下
需要修改的代码位置 themes/Acrylic/source/css/main.css
,替换成下列代码
1 | #nav #site-name:after { |
👇下面是网站名称文字的缩放效果
需要修改的代码位置 themes/Acrylic/source/css/custom.css
,替换成下列代码
1 | .heoicon { |
修改 ICP
添加 ICP 图标
ICP 图标:
将 ICP 图片添加到 themes/Acrylic/source/img
需要修改的代码位置 themes/Acrylic/layout/partial/footer.ejs
,根据 theme.site.icp
找到代码位置,进行替换
1 | <% if(theme.site.icp){ %> |
需要修改的代码位置 themes/Acrylic/source/css/main.css
,新增下列代码
1 | .icp { |
修改主题组件文件夹名称
发现主题的组件文件夹名称拼写错误,纠正一下
文件夹路径 themes/Acrylic/layout/partial/compoment
将 compoment 改成 component,可以使用 IDE 全局替换
修改关闭音乐模块模块遗存
我发现关闭主题音乐模块,还有部分 HTML 遗留
通过全局搜索 /third-party/music
定位代码位置 themes/Acrylic/layout/layout.ejs
将
1 | <%- partial('partial/component/third-party/music', {cache: true}) %> |
替换成
1 | <% if(theme.thirdparty.aplayer.enable){ %> |
复用侧边栏标签模块
查看代码时发现
themes/Acrylic/layout/partial/sidebar.ejs
中的标签模块和themes/Acrylic/layout/partial/component/aside/asideTag.ejs
的代码是一样的,所以决定直接进行复用
将 themes/Acrylic/layout/partial/sidebar.ejs
中的
1 | <div class="card-tag-cloud"> |
替换成
1 | <%- partial('partial/component/aside/asideTag', {cache: true}) %> |
该文章会根据是否发现问题来决定是否更新
-
感谢你赐予我前进的力量