Skip to content

Commit cfe8a9e

Browse files
committed
fix: HTML-default docs negotiation, footer separators, clickable CTA-less banner
1 parent 818cff0 commit cfe8a9e

3 files changed

Lines changed: 44 additions & 6 deletions

File tree

documentation/.vuepress/components/copyright.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,36 @@ export default {}
55
<style scoped>
66
.footer {
77
display: flex;
8+
flex-wrap: wrap;
89
width: 100%;
910
justify-content: center;
1011
align-items: center;
12+
gap: .3em .6em;
1113
padding: 1em;
1214
font-size: .8em;
1315
opacity: .8;
1416
}
1517
18+
.entry {
19+
white-space: nowrap;
20+
}
21+
22+
.sep {
23+
margin-right: .5em;
24+
opacity: .6;
25+
}
26+
1627
a {
1728
color: inherit;
1829
font-weight: normal;
19-
margin-left: 5px;
2030
}
2131
</style>
2232

2333
<template>
2434
<div class="footer">
25-
©2026 Needle Tools GmbH
26-
&nbsp;– <a class="no-external-link-icon" target="_blank" href="https://needle.tools/contact">About</a>
27-
&nbsp;– <a class="no-external-link-icon" target="_blank" href="https://needle.tools/contact#privacy-policy">Privacy Policy</a>
28-
&nbsp;– <a class="no-external-link-icon" target="_blank" href="./sitemap.xml">Sitemap</a>
35+
<span class="entry">©2026 Needle Tools GmbH</span>
36+
<span class="entry"><span class="sep">–</span><a class="no-external-link-icon" target="_blank" href="https://needle.tools/contact">About</a></span>
37+
<span class="entry"><span class="sep">–</span><a class="no-external-link-icon" target="_blank" href="https://needle.tools/contact#privacy-policy">Privacy Policy</a></span>
38+
<span class="entry"><span class="sep">–</span><a class="no-external-link-icon" target="_blank" href="./sitemap.xml">Sitemap</a></span>
2939
</div>
3040
</template>

documentation/.vuepress/components/discountbanner.vue

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ if (typeof window !== "undefined") {
147147
</script>
148148

149149
<template>
150-
<div v-if="discount" ref="bannerEl" class="discount_banner" :style="style"
150+
<div v-if="discount" ref="bannerEl" class="discount_banner"
151+
:class="{ clickable: discount.url && !discount.banner.cta }" :style="style"
151152
@pointerenter="onPointerEnter" @pointerleave="onPointerLeave">
153+
<!-- No CTA but a link present: make the whole banner clickable.
154+
Uses the feed `url` (the /r/ click redirect) so clicks still count server-side. -->
155+
<a v-if="discount.url && !discount.banner.cta" class="stretched_link" :href="discount.url"
156+
target="_blank" :aria-label="discount.banner.title"></a>
152157
<div class="content">
153158
<h2 class="main_text">{{ discount.banner.title }}</h2>
154159
<div class="text">{{ discount.banner.subtitle }}</div>
@@ -170,7 +175,22 @@ if (typeof window !== "undefined") {
170175
margin: 1rem 0;
171176
}
172177
178+
/* Whole-banner click target used when the feed item has a link but no CTA. */
179+
.discount_banner.clickable {
180+
cursor: pointer;
181+
}
182+
183+
.stretched_link {
184+
position: absolute;
185+
inset: 0;
186+
z-index: 1;
187+
/* The link itself is invisible; the banner content shows through. */
188+
text-decoration: none;
189+
border: none;
190+
}
191+
173192
.discount_banner {
193+
position: relative;
174194
margin: 1rem 0;
175195
176196
border-radius: 12px;

documentation/.vuepress/public/.htaccess

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,12 @@ Header set Cache-Control "public, max-age=120, must-revalidate"
1414
Header set Content-Type "text/markdown; charset=UTF-8"
1515
</FilesMatch>
1616

17+
</IfModule>
18+
19+
# Content negotiation: prefer HTML by default for extensionless URLs.
20+
# Markdown is a fallback variant (low source quality), so browsers get .html
21+
# and only clients explicitly requesting text/markdown receive the .md variant.
22+
<IfModule mod_mime.c>
23+
AddType text/html .html
24+
AddType "text/markdown;qs=0.4" .md
1725
</IfModule>

0 commit comments

Comments
 (0)