给博客挂广告以参与 NodeSupport 免费服务器赞助计划

给博客挂广告以参与 NodeSupport 免费服务器赞助计划

活动概况

NodeSeekYxVM 合作推出 免费服务器赞助计划,针对开发者及网站运营者,可以申请免费服务器。网站运营者需要在网站或博客上挂载活动指定的广告。由于很多人的博客是基于 hexo 的静态网页,挂载广告不能用常规 html 方式。下面教大家如何在 anzhiyu 主题上挂载广告。

开始修改

首先感谢:CM TG 群友 NotPeppa 提供的原始代码

首先找到 \themes\anzhiyu\layout\includes\widget\card_webinfo.pug 文件

打开它,在文件的最后面加上以下代码(20250406 更新):

1
2
3
4
5
6
7
8
9
.sponsor-iframe-sidebar-container(
style="margin: 15px 0 -40px 0; width: 100%; height: 260px; box-sizing: border-box; overflow: hidden;"
)
iframe(
src="https://support.nodeget.com/page/promotion?id=89"
style="transform: scale(0.9); transform-origin: top left; width: 111%; height: 100%; border: none;"
scrolling="no"
loading="lazy"
)

注意缩进

显示效果

显示效果

#广告 #建站