第一步
我们找到\butterfly\source\css\_global
下的function.styl
文件,任意位置添加代码
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
|
.github-badge { margin-left: 5px; display: inline-block; border-radius: 4px; text-shadow: none; color: #fff; line-height: 15px; background-color: #abbac3; margin-bottom: 5px; font-size: 12px; }
.github-badge .badge-subject { display: inline-block; background-color: #4d4d4d; padding: 4px 4px 4px 6px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.github-badge .badge-value { display: inline-block; padding: 4px 6px 4px 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.github-badge .bg-blue { background-color: #007ec6; }
.github-badge .bg-brightgreen { background-color: #4dc820; }
.github-badge .bg-orange { background-color: orange; }
.github-badge .bg-gradient { background: linear-gradient(to right,#3ca5f6,#a86af9); }
.github-badge .bg-blueviolet { background-color: #8833d7; }
|
第二步
找到butterfly\layout\includes
下的footer.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 31 32 33 34
| if theme.footer.custom_text .footer_custom_text!=`${theme.footer.custom_text}` ------------------------------------------------------------------- .github-badge a(style='color:#fff', rel='external nofollow noopener noreferrer', href='https://hexo.io/', target='_blank', title='由 Hexo 强力驱动', data-pjax-state='') span.badge-subject Powered span.badge-value.bg-blue Hexo .github-badge a(style='color:#fff', rel='external nofollow noopener noreferrer', href='https://github.com/', target='_blank', title='静态网页托管于 GitHub Pages 和 Coding Pages', data-pjax-state='') span.badge-subject Hosted span.badge-value.bg-brightgreen GitHub & Coding .github-badge a(style='color:#fff', rel='external nofollow noopener noreferrer', href='https://www.jsdelivr.com/', target='_blank', title='jsDelivr 提供 CDN 加速服务', data-pjax-state='') span.badge-subject CDN span.badge-value.bg-orange jsDelivr .github-badge a(style='color:#fff', rel='external nofollow noopener noreferrer', href='http://creativecommons.org/licenses/by-nc-sa/4.0/', target='_blank', title='本站点采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可', data-pjax-state='') span.badge-subject i.fa.fa-copyright span.badge-value.bg-gradient BY-NC-SA 4.0
.github-badge a(style='color:#fff', rel='external nofollow noopener noreferrer', href='https://github.com/jerryc127/hexo-theme-butterfly', target='_blank', title='主题', data-pjax-state='') span.badge-subject Theme span.badge-value.bg-blueviolet Butterfly -------------------------------------------------------------------------- if theme.footer.ICP.enable .icp a(href=theme.footer.ICP.url) if theme.footer.ICP.icon img.icp-icon(src=url_for(theme.footer.ICP.icon)) span=theme.footer.ICP.text
|