Skip to content

Commit 162143b

Browse files
committed
Add affiliate links notice to blog posts
1 parent 8f8725c commit 162143b

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="affiliate-disclosure" style="font-size: 0.85rem; font-style: italic; margin: 20px 0; opacity: 0.7; display: flex; align-items: center; gap: 8px;">
2+
<i class="fas fa-info-circle"></i>
3+
<span>Dieser Beitrag kann Affiliate-Links enthalten. Wenn du auf einen solchen Link klickst und etwas kaufst, erhalte ich eventuell eine kleine Provision – ohne zusätzliche Kosten für dich.</span>
4+
</div>
5+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="affiliate-disclosure" style="font-size: 0.85rem; font-style: italic; margin: 20px 0; opacity: 0.7; display: flex; align-items: center; gap: 8px;">
2+
<i class="fas fa-info-circle"></i>
3+
<span>This post may contain affiliate links. If you click and make a purchase, I may receive a small commission at no extra cost to you.</span>
4+
</div>

layouts/posts/single.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ <h2 class="single-subtitle">{{ . }}</h2>
8787
</div>
8888
{{- end -}}
8989

90+
{{- /* Affiliate Disclosure */ -}}
91+
{{- if ne .Params.affiliate false -}}
92+
<div class="post-affiliate-custom">
93+
{{- $footerPath := printf "custom/affiliate-%s.html" .Lang -}}
94+
{{- if templates.Exists (printf "_partials/%s" $footerPath) -}}
95+
{{- partial $footerPath . -}}
96+
{{- else -}}
97+
{{- /* Fallback auf Deutsch, falls die Sprachdatei fehlt */ -}}
98+
{{- partial "custom/affiliate-de.html" . -}}
99+
{{- end -}}
100+
</div>
101+
{{- end -}}
102+
90103
{{- /* Content */ -}}
91104
<div class="content" id="content">
92105
{{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}

0 commit comments

Comments
 (0)