Skip to content

Commit 48b7a3f

Browse files
committed
Add BuySellAds ad zones with 80/20 BSA/legacy sponsor split
- Replace mobilesponsor with BSA topsponsor, bottomsponsor, and sidebar zones - Add BSA tracking slots (crawler, pageviews, fixedfooter) - Update sponsor.js to dual-provider: 4/5 BSA, 1/5 legacy sponsor - Add BSA zone CSS styles and min-heights - Remove redundant inline BSA script from head (now loaded by sponsor.js)
1 parent 6cc00e9 commit 48b7a3f

3 files changed

Lines changed: 425 additions & 81 deletions

File tree

theme/index.hbs

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,7 @@
5959
</script>
6060
<!-- Start loading toc.js asap -->
6161
<script src="{{ path_to_root }}toc.js"></script>
62-
<script type="text/javascript">
63-
(function () {
64-
var bsa_optimize = document.createElement('script');
65-
bsa_optimize.type = 'text/javascript';
66-
bsa_optimize.async = true;
67-
bsa_optimize.src = 'https://cdn4.buysellads.net/pub/hacktricks.js?' + (new Date() - new Date() % 600000);
68-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bsa_optimize);
69-
})();
70-
</script>
62+
7163
</head>
7264
<body>
7365
<div id="body-container">
@@ -303,18 +295,32 @@
303295

304296
<div id="content" class="content">
305297
<main>
306-
<div class="mobilesponsor-wrapper">
307-
308-
<a class="mobilesponsor" href="" target="_blank">
309-
<img src="" alt="" srcset="">
310-
<div class="mobilesponsor-title">
311-
</div>
312-
<div class="mobilesponsor-description">
313-
</div>
314-
<div class="mobilesponsor-cta"></div>
315-
</a>
298+
<div class="topsponsor-bsa" aria-hidden="true">
299+
<div id="bsa-zone_1773736844679-9_123456"></div>
316300
</div>
317301
{{{ content }}}
302+
<div class="bottomsponsor-wrapper">
303+
<a class="bottomsponsor" href="" target="_blank" rel="noopener noreferrer">
304+
<img src="" alt="" srcset="">
305+
<div class="bottomsponsor-title">
306+
</div>
307+
<div class="bottomsponsor-description">
308+
</div>
309+
<div class="bottomsponsor-cta"></div>
310+
</a>
311+
<div class="bottomsponsor-bsa" aria-hidden="true">
312+
<div id="bsa-zone_1773736987437-6_123456"></div>
313+
</div>
314+
</div>
315+
<div class="bsa-crawler-slot" aria-hidden="true">
316+
<div id="bsa-zone_1773065859037-5_123456"></div>
317+
</div>
318+
<div class="bsa-pageviews-slot" aria-hidden="true">
319+
<div id="bsa-zone_1770368463-7_123456"></div>
320+
</div>
321+
<div class="bsa-fixedfooter-slot" aria-hidden="true">
322+
<div id="bsa-zone_1770367111944-8_123456"></div>
323+
</div>
318324
</main>
319325

320326
<nav class="nav-wrapper" aria-label="Page navigation">
@@ -355,14 +361,17 @@
355361
</button>
356362
<div id="sidetoc-wrapper" class="sidetoc-wrapper">
357363
<nav class="pagetoc"></nav>
358-
<a class="sidesponsor" href="" target="_blank">
364+
<a class="sidesponsor" href="" target="_blank" rel="noopener noreferrer">
359365
<img src="" alt="" srcset="">
360366
<div class="sponsor-title">
361367
</div>
362368
<div class="sponsor-description">
363369
</div>
364370
<div class="sponsor-cta"></div>
365371
</a>
372+
<div class="sidesponsor-bsa" aria-hidden="true">
373+
<div id="bsa-zone_1773737041447-5_123456"></div>
374+
</div>
366375
</div>
367376
</div>
368377
</div>

theme/pagetoc.css

Lines changed: 188 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,44 @@
22
.sidetoc {
33
display: none !important;
44
}
5-
.mobilesponsor {
5+
.topsponsor-bsa {
6+
margin-top: 25px;
7+
margin-bottom: 25px;
8+
background-color: var(--bg);
9+
border: 1px solid var(--table-border-color);
10+
border-radius: 8px;
11+
padding: 5px;
12+
display: none; /*changed via JS once ad is loaded*/
13+
overflow: hidden;
14+
}
15+
.bottomsponsor-wrapper {
16+
margin-top: 25px;
17+
}
18+
.bottomsponsor,
19+
.bottomsponsor-bsa {
620
margin-top: 25px;
7-
max-height: 40%;
8-
height: 40%;
921
background-color: var(--bg);
1022
border: 1px solid var(--table-border-color);
1123
border-radius: 8px;
1224
padding: 5px;
1325
display: none; /*changed via JS once ad is loaded*/
14-
flex-direction: column;
1526
text-decoration: none !important;
1627
}
17-
.mobilesponsor img {
28+
.bottomsponsor {
29+
flex-direction: column;
30+
}
31+
.bottomsponsor-bsa {
32+
overflow: hidden;
33+
}
34+
.bottomsponsor img {
1835
height: auto;
1936
width: 40%;
2037
padding: 10px;
2138
transition-property: all;
2239
transition-timing-function: cubic-bezier(.4,0,.2,1);
2340
transition-duration: .3s;
2441
}
25-
/* .mobilesponsor:hover img{
26-
width: 30%;
27-
} */
28-
.mobilesponsor .mobilesponsor-title{
42+
.bottomsponsor .bottomsponsor-title{
2943
margin-top: 5px;
3044
margin-bottom: 5px;
3145
margin-left: 15px;
@@ -34,7 +48,7 @@
3448
font-size: 2rem;
3549
color: var(--sponsor-fg);
3650
}
37-
.mobilesponsor .mobilesponsor-description{
51+
.bottomsponsor .bottomsponsor-description{
3852
display:block;
3953
margin-top: 5px;
4054
margin-bottom: 15px;
@@ -45,10 +59,7 @@
4559
transition-timing-function: cubic-bezier(.4,0,.2,1);
4660
transition-duration: .3s;
4761
}
48-
/* .mobilesponsor:hover .mobilesponsor-description{
49-
display:block;
50-
} */
51-
.mobilesponsor .mobilesponsor-cta{
62+
.bottomsponsor .bottomsponsor-cta{
5263
margin-top: auto;
5364
margin-bottom: 10px;
5465
margin-left: 20px;
@@ -149,8 +160,88 @@
149160
background-color: var(--fg);
150161
color: var(--bg);
151162
}
152-
.mobilesponsor-wrapper {
153-
display: none !important;
163+
.sidesponsor-bsa {
164+
max-height: 40%;
165+
height: 40%;
166+
background-color: transparent;
167+
border: 1px solid color-mix(in srgb, var(--table-border-color) 70%, transparent);
168+
border-radius: 8px;
169+
padding: 5px;
170+
display: none; /*changed via JS once ad is loaded*/
171+
overflow: hidden;
172+
backdrop-filter: blur(6px);
173+
}
174+
.topsponsor-bsa {
175+
margin: 0 auto 32px;
176+
width: min(100%, 760px);
177+
background-color: transparent;
178+
border: 1px solid color-mix(in srgb, var(--table-border-color) 70%, transparent);
179+
border-radius: 8px;
180+
padding: 12px;
181+
display: none; /*changed via JS once ad is loaded*/
182+
overflow: hidden;
183+
backdrop-filter: blur(6px);
184+
}
185+
.bottomsponsor-wrapper {
186+
margin-top: 32px;
187+
}
188+
.bottomsponsor,
189+
.bottomsponsor-bsa {
190+
margin: 0 auto;
191+
width: min(100%, 760px);
192+
background-color: transparent;
193+
border: 1px solid color-mix(in srgb, var(--table-border-color) 70%, transparent);
194+
border-radius: 8px;
195+
padding: 12px;
196+
display: none; /*changed via JS once ad is loaded*/
197+
text-decoration: none !important;
198+
backdrop-filter: blur(6px);
199+
}
200+
.bottomsponsor {
201+
flex-direction: column;
202+
}
203+
.bottomsponsor-bsa {
204+
overflow: hidden;
205+
}
206+
.bottomsponsor img {
207+
height: auto;
208+
width: 40%;
209+
max-width: 240px;
210+
padding: 10px;
211+
transition-property: all;
212+
transition-timing-function: cubic-bezier(.4,0,.2,1);
213+
transition-duration: .3s;
214+
}
215+
.bottomsponsor .bottomsponsor-title {
216+
margin-top: 5px;
217+
margin-bottom: 5px;
218+
margin-left: 15px;
219+
margin-right: 15px;
220+
font-weight: 800;
221+
font-size: 2rem;
222+
color: var(--sponsor-fg);
223+
}
224+
.bottomsponsor .bottomsponsor-description {
225+
display: block;
226+
margin-top: 5px;
227+
margin-bottom: 15px;
228+
margin-left: 15px;
229+
margin-right: 15px;
230+
color: var(--sponsor-fg);
231+
transition-property: all;
232+
transition-timing-function: cubic-bezier(.4,0,.2,1);
233+
transition-duration: .3s;
234+
}
235+
.bottomsponsor .bottomsponsor-cta {
236+
margin-top: auto;
237+
margin-bottom: 10px;
238+
margin-left: 20px;
239+
margin-right: 20px;
240+
text-align: center;
241+
padding: 7px;
242+
border-radius: 8px;
243+
background-color: var(--fg);
244+
color: var(--bg);
154245
}
155246

156247
.sidetoc-toggle {
@@ -238,3 +329,84 @@
238329
display: none;
239330
}
240331
}
332+
333+
.bsa-crawler-slot {
334+
position: absolute;
335+
width: 1px;
336+
height: 1px;
337+
overflow: hidden;
338+
opacity: 0;
339+
pointer-events: none;
340+
}
341+
342+
.bsa-pageviews-slot {
343+
position: absolute;
344+
width: 1px;
345+
height: 1px;
346+
overflow: hidden;
347+
opacity: 0;
348+
pointer-events: none;
349+
}
350+
351+
.bsa-fixedfooter-slot {
352+
position: absolute;
353+
width: 1px;
354+
height: 1px;
355+
overflow: hidden;
356+
opacity: 0;
357+
pointer-events: none;
358+
}
359+
360+
@media only screen and (min-width: 0px) and (min-height: 0px) {
361+
#bsa-zone_1773736844679-9_123456 {
362+
min-height: 100px;
363+
}
364+
365+
#bsa-zone_1773736987437-6_123456 {
366+
min-height: 100px;
367+
}
368+
369+
#bsa-zone_1773065859037-5_123456 {
370+
min-height: 1px;
371+
}
372+
373+
#bsa-zone_1770368463-7_123456 {
374+
min-height: 1px;
375+
}
376+
377+
#bsa-zone_1770367111944-8_123456 {
378+
min-height: 1px;
379+
}
380+
381+
#bsa-zone_1773737041447-5_123456 {
382+
min-height: 0px;
383+
}
384+
}
385+
386+
@media only screen and (min-width: 770px) and (min-height: 0px) {
387+
#bsa-zone_1773736844679-9_123456 {
388+
min-height: 90px;
389+
}
390+
391+
#bsa-zone_1773736987437-6_123456 {
392+
min-height: 280px;
393+
}
394+
395+
#bsa-zone_1773065859037-5_123456 {
396+
min-height: 1px;
397+
}
398+
399+
#bsa-zone_1770368463-7_123456 {
400+
min-height: 1px;
401+
}
402+
403+
#bsa-zone_1770367111944-8_123456 {
404+
min-height: 1px;
405+
}
406+
}
407+
408+
@media only screen and (min-width: 880px) and (min-height: 0px) {
409+
#bsa-zone_1773737041447-5_123456 {
410+
min-height: 250px;
411+
}
412+
}

0 commit comments

Comments
 (0)