Skip to content

Commit 359986c

Browse files
authored
chore(sponsor-banner): add link to sustainability article (#456)
1 parent 6f7ac9c commit 359986c

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

src/components/SponsorsBanner.astro

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ function formatCurrency(value: number): string {
1515
maximumFractionDigits: 0,
1616
}).format(value);
1717
}
18+
19+
// Check if we're on the sustainability page
20+
const currentPath = Astro.url.pathname;
21+
const isOnSustainabilityPage = currentPath === '/blog/sustainability-for-ddev/' || currentPath === '/blog/sustainability-for-ddev';
1822
---
1923

2024
<style>
@@ -122,8 +126,28 @@ function formatCurrency(value: number): string {
122126
text-decoration: none;
123127
}
124128

125-
.ddev-sponsor-banner__cta {
129+
.ddev-sponsor-banner__cta a,
130+
.ddev-sponsor-banner__cta span {
126131
font-weight: bold;
132+
text-decoration: none;
133+
color: #ffffff;
134+
}
135+
136+
.ddev-sponsor-banner__cta a:hover {
137+
color: #0298cf;
138+
}
139+
140+
.ddev-sponsor-banner__cta a::after {
141+
content: '';
142+
display: inline-block;
143+
width: 0.9em;
144+
height: 0.9em;
145+
margin-left: 0.25em;
146+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25'/%3E%3C/svg%3E");
147+
background-size: contain;
148+
background-repeat: no-repeat;
149+
background-position: center;
150+
vertical-align: baseline;
127151
}
128152

129153
@media (max-width: 700px) {
@@ -159,7 +183,13 @@ function formatCurrency(value: number): string {
159183
<div class="ddev-sponsor-banner__progress-section">
160184
<div class="ddev-sponsor-banner__progress-header">
161185
<span id="percent-desktop">{percentage}% of monthly goal</span>
162-
<span class="ddev-sponsor-banner__cta">Help us cross the finish line!</span>
186+
<span class="ddev-sponsor-banner__cta">
187+
{isOnSustainabilityPage ? (
188+
<span>Securing DDEV's future!</span>
189+
) : (
190+
<a href="/blog/sustainability-for-ddev/">Help us cross the finish line!</a>
191+
)}
192+
</span>
163193
</div>
164194
<div class="ddev-sponsor-banner__progress-bar">
165195
<div class="ddev-sponsor-banner__progress-fill" id="progress-desktop" style={{ width: `${percentage}%` }}></div>
@@ -179,12 +209,18 @@ function formatCurrency(value: number): string {
179209
</div>
180210
<div class="ddev-sponsor-banner__meta-row">
181211
<span id="percent-mobile">{percentage}% of monthly goal</span>
182-
<span class="ddev-sponsor-banner__cta">Help us cross the finish line!</span>
212+
<span class="ddev-sponsor-banner__cta">
213+
{isOnSustainabilityPage ? (
214+
<span>Securing DDEV's future!</span>
215+
) : (
216+
<a href="/blog/sustainability-for-ddev/">Help us cross the finish line!</a>
217+
)}
218+
</span>
183219
</div>
184220
</div>
185221
</div>
186222

187-
<a class="ddev-sponsor-banner__button" href="https://github.com/sponsors/ddev" target="_blank">
223+
<a class="ddev-sponsor-banner__button" href="https://github.com/sponsors/ddev">
188224
Sponsor DDEV
189225
</a>
190226
</div>

0 commit comments

Comments
 (0)