洪哥的外挂网站卡片

试验失败(大概是css冲突 有空再慢慢排查)

如果不出问应该没有这个折叠框
1
{% link 获取网站的Favicon图标并显示在你的网页上,owen0o0,https://blog.zhheo.com/ % }

原教程:

### 效果:

并且还要在项目文件中添加js文件 路径:

warning themes/butterfly/scripts/tag/link.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function link(args) {
args = args.join(' ').split(',');
let title = args[0];
let sitename = args[1];
let link = args[2];

// 获取网页favicon
let urlNoProtocol = link.replace(/^https?\:\/\//i, "");
let imgUrl = "https://api.iowen.cn/favicon/" + urlNoProtocol + ".png";

return `<a class="tag-Link" target="_blank" href="${link}">
<div class="tag-link-tips">引用站外地址</div>
<div class="tag-link-bottom">
<div class="tag-link-left" style="background-image: url(${imgUrl});"></div>
<div class="tag-link-right">
<div class="tag-link-title">${title}</div>
<div class="tag-link-sitename">${sitename}</div>
</div>
<i class="fa-solid fa-angle-right"></i>
</div>
</a>`
}

hexo.extend.tag.register('link',link, { ends: false })