post_meta: page: date_type: both # created or updated or both 主页文章日期是创建日或者更新日或都显示 date_format: relative # date/relative 显示日期还是相对日期 categories: true # true or false 主页是否显示分类 tags: true # true or false 主页是否显示标签 label: true # true or false 显示描述性文字 post: date_type: both # created or updated or both 文章页日期是创建日或者更新日或都显示 date_format: relative # date/relative 显示日期还是相对日期 categories: true # true or false 文章页是否显示分类 tags: true # true or false 文章页是否显示标签 label: true # true or false 显示描述性文字
主页文章节选(自动节选和文章页description)
因为主题UI的关係,主页文章节选只支持自动节选和文章页description。
在butterfly里,有四种可供选择
description: 只显示description
both: 优先选择``,如果没有配置description,则显示自动节选的内容
auto_excerpt:只显示自动节选
false: 不显示文章内容
修改 主题配置文件
1 2 3
index_post_content: method: 3 length: 500 # if you set method to 2 or 3, the length need to config
# anchor # when you scroll in post , the url will update according to header id. anchor: button: enable: false always_show: false icon: # the unicode value of Font Awesome icon, such as '\3423' auto_update: false # when you scroll in post, the URL will update according to header id.
复制相关配置
可配置网站是否可以复制、复制的内容是否添加版权信息
1 2 3 4 5 6 7
# copy settings # copyright: Add the copyright information after copied content (复制的内容后面加上版权信息) copy: enable: true # 是否开启网站复制权限 copyright: #复制的内容后面加上版权信息 enable: true # 是否开启复制版权信息添加 limit_count: 50 #字数限制,当复制文字大于这个字数限制时,将在复制的内容后面加上版权信息
# Displays outdated notice for a post (文章过期提醒) noticeOutdate: enable: true style: flat # style: simple/flat limit_day: 365 # When will it be shown position: top # position: top/bottom message_prev: It has been message_next: days since the last update, the content of the article may be outdated.
limit_day: 距离更新时间多少天才显示文章过期提醒
message_prev : 天数之前的文字
message_next:天数之后的文字
文章分页按钮
当文章封面设置为 false 时,或者没有获取到封面配置,分页背景将会显示主题色。
可设置分页的逻辑,也可以关闭分页显示
1 2 3 4 5 6
# post_pagination (分页) # value: 1 || 2 || false # 1: The 'next post' will link to old post # 2: The 'next post' will link to new post # false: disable pagination post_pagination: false
aside: enable: true hide: false button: true mobile: true # display on mobile position: right # left or right display: archive: true tag: true category: true card_author: enable: true description: button: enable: true icon: fab fa-github text: Follow Me link: https://github.com/xxxxxx card_announcement: enable: true content: This is my Blog card_recent_post: enable: true limit: 5 # if set 0 will show all sort: date # date or updated sort_order: # Don't modify the setting unless you know how it works card_categories: enable: true limit: 8 # if set 0 will show all expand: none # none/true/false sort_order: # Don't modify the setting unless you know how it works card_tags: enable: true limit: 40 # if set 0 will show all color: false orderby: random # Order of tags, random/name/length order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending sort_order: # Don't modify the setting unless you know how it works card_archives: enable: true type: monthly # yearly or monthly format: MMMM YYYY # eg: YYYY年MM月 order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending limit: 8 # if set 0 will show all sort_order: # Don't modify the setting unless you know how it works card_webinfo: enable: true post_count: true last_push_date: true sort_order: # Don't modify the setting unless you know how it works
由于 API 有 访问次数限制,为了避免调用太多,主题默认存取期限为 10 分钟。也就是説,调用后资料会存在 localStorage 里,10分钟内刷新网站只会去 localStorage 读取资料。 10 分钟期限一过,刷新页面时才会去调取 API 读取新的数据。( 3.6.0 新增了 storage 配置,可自行配置缓存时间)
在侧边栏显示最新评论板块
修改 主题配置文件
1 2 3 4 5 6 7
# Aside widget - Newest Comments newest_comments: enable: true sort_order: # Don't modify the setting unless you know how it works limit: 6 #显示的数量 storage: 10 # unit: mins, save data to localStorage 设置缓存时间,单位 分钟 avatar: true # 是否显示头像
閲读模式
閲读模式下会去掉除文章外的内容,避免干扰閲读。
只会出现在文章页面,右下角会有閲读模式按钮。
1
readmode: true
夜间模式
右下角会有夜间模式按钮
1 2 3 4 5 6 7 8 9
# dark mode darkmode: enable: true # dark mode和 light mode切换按钮 button: true # 是否在右下角显示日夜模式切换按钮 autoChangeMode: false # Set the light mode time. The value is between 0 and 24. If not set, the default value is 6 and 18 start: # 8 end: # 22
滚动状态百分比
1 2
# show scroll percent in scroll-to-top button rightside_scroll_percent: true
按钮排序
1 2 3 4 5 6 7
# Don't modify the following settings unless you know how they work (非必要请不要修改 ) # Choose: readmode,translate,darkmode,hideAside,toc,chat,comment # Don't repeat 不要重复 rightside_item_order: enable: false hide: # readmode,translate,darkmode,hideAside show: # toc,chat,comment