Files
web_huangguo2_h5/app/template/base/ads.html
T
2026-09-29 15:30:33 +07:00

16 lines
779 B
HTML

{{define "ads"}}
{{/* 入参为 advitise.detailbannerList 的切片,字段与接口一致:images / link / title
类名避免 ads/ad-slot:夸克等浏览器内置广告拦截会隐藏这类选择器 */}}
{{if .}}
<link rel="stylesheet" href="/static/css/promo.css?v=1">
<section class="promo-rail" aria-label="推荐">
{{range .}}
<a class="promo-card" href="{{if .Link}}{{.Link}}{{else}}#{{end}}"{{if .Link}} target="_blank" rel="sponsored nofollow noopener"{{end}}>
<img decoding="async" loading="eager" class="lazy" src="/static/images/placeholder.png?v=2" data-src="{{.Images}}" data-lazy-eager="1" alt="{{if .Title}}{{.Title}}{{else}}推荐{{end}}">
<span class="tag tag--dark promo-card__tag">广告</span>
</a>
{{end}}
</section>
{{end}}
{{end}}