1. 效果预览

2. 教程
第一步:在路径BlogRoot\themes\butterfly\layout\includes\post下重写文件post-copyright.pug
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
| if theme.post_copyright.enable && page.copyright !== false - let author = page.copyright_author ? page.copyright_author : config.author - let url = page.copyright_url ? page.copyright_url : page.permalink .post-copyright .post-copyright__title span.post-copyright-info h #[=page.title] .post-copyright__type span.post-copyright-info a(href=url_for(url))= theme.post_copyright.decode ? decodeURI(url) : url .post-copyright-m .post-copyright-m-info .post-copyright-a(style="display: inline-block;width: 120px") h 作者 .post-copyright-cc-info h=author .post-copyright-c(style="display: inline-block;width: 120px") h 发布于 .post-copyright-cc-info h=date(page.date, config.date_format) .post-copyright-u(style="display: inline-block;width: 120px") h 更新于 .post-copyright-cc-info h=date(page.updated, config.date_format) .post-copyright-c(style="display: inline-block;width: 120px") h 许可协议 .post-copyright-cc-info a.icon(rel='noopener' target='_blank' title='Creative Commons' href='https://creativecommons.org/') i.fab.fa-creative-commons a(rel='noopener' target='_blank' title='CC BY 4.0' href='https://creativecommons.org/licenses/by/4.0/deed.zh') CC BY 4.0
|
第二步:在路径BlogRoot\themes\butterfly\source\css_layout下,修改post.styl文件
修改范围:.post-copyright 至 .post-outdate-notice
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
| .post-copyright position: relative margin: 2rem 0 .5rem padding: .5rem .8rem border: 1px solid var(--light-grey) transition: box-shadow .3s ease-in-out overflow: hidden border-radius: 12px!important background-color: rgb(239 241 243)
&:before background var(--heo-post-blockquote-bg) position absolute right -26px top -120px content '\f25e' font-size 200px font-family 'Font Awesome 5 Brands' opacity .2
&:hover box-shadow: 0 0 8px 0 rgba(232, 237, 250, .6), 0 2px 4px 0 rgba(232, 237, 250, .5)
.post-copyright &-meta color: $light-blue font-weight: bold
&-info padding-left: .3rem
a text-decoration: none word-break: break-word
&:hover text-decoration: none
.post-copyright-cc-info color: $theme-color;
.post-outdate-notice position: relative margin: 0 0 20px padding: .5em 1.2em border-radius: 3px background-color: $noticeOutdate-bg color: $noticeOutdate-color
|
第三步:在路径BlogRoot\source\css下添加文件copyright.css,输入以下内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| [data-theme="dark"] #post .post-copyright { background-color: rgb(7 8 10); text-shadow: #bfbeb8 1px 0 4px; } [data-theme="dark"] #post .post-copyright { border: 1px solid rgb(19 18 18 / 35%); } [data-theme="dark"] .post-copyright-info { color: #e0e0e4; } #post .post-copyright__title{ font-size:22px; } #post .post-copyright__notice{ font-size:15px; }
|
3. 参考链接