首页文章卡片左上角添加标签

原作者文章

我们先找到
themes\butterfly\layout\includes\mixins\post-ui.pug文件,在文件的约 21 行的位置添加如下内容

if article.cardtag
  .card-tag= article.cardtag  
if post_cover && theme.cover.index_enable

打开你的文章,添加 cardtag: 魔改

创建一个css,或者写入你自己的css中

/* 文章标签*/
#recent-posts .recent-post-item .card-tag {
  left: 0;
  border-bottom-right-radius: 12px;
  position: absolute;
  top: 0;
  padding: 3px 8px;
  background: linear-gradient(90deg,#e5b085,#d48f16);
  color: #fff;
  font-size: .85em;
  z-index: 1;
}

如果是新创建的css,记得引入到你的站点。