1
+ < script >
2
+ const ads = [
3
+ {
4
+ img : 'patreon.png' ,
5
+ href : 'https://patreon.com/structurizr' ,
6
+ expiry : new Date ( '2025-12-31' )
7
+ } ,
8
+ {
9
+ img : 'j-on-the-beach.png' ,
10
+ href : 'https://www.jonthebeach.com/workshops/visualising-software-architecture-with-the-C4-model/' ,
11
+ expiry : new Date ( '2025-05-13' )
12
+ } ,
13
+ {
14
+ img : 'trifork-nl.png' ,
15
+ href : 'https://trifork.nl/academy/our-courses/software-architecture-for-developers/' ,
16
+ expiry : new Date ( '2025-05-20' )
17
+ } ,
18
+ {
19
+ img : 'ddd-europe.png' ,
20
+ href : 'https://ddd.academy/visualising-software-architecture/' ,
21
+ expiry : new Date ( '2025-06-02' )
22
+ } ,
23
+ {
24
+ img : 'yow-melbourne.png' ,
25
+ href : 'https://yowcon.com/melbourne-2025/masterclasses/541/visualising-software-architecture-with-the-c4-model' ,
26
+ expiry : new Date ( '2025-12-02' )
27
+ } ,
28
+ {
29
+ img : 'yow-sydney.png' ,
30
+ href : 'https://yowcon.com/sydney-2025/masterclasses/542/visualising-software-architecture-with-the-c4-model' ,
31
+ expiry : new Date ( '2025-12-09' )
32
+ }
33
+ ] ;
34
+
35
+ function showAd ( id ) {
36
+ try {
37
+ var ad ;
38
+ while ( ad === undefined || ad . expiry < new Date ( ) ) {
39
+ const randomNumber = Math . floor ( Math . random ( ) * ads . length ) ;
40
+ ad = ads [ randomNumber ] ;
41
+ }
42
+
43
+ const img = document . createElement ( 'img' ) ;
44
+ img . src = '/assets/ads/' + ad . img ;
45
+ img . style . width = '728px' ;
46
+ img . style . height = '90px' ;
47
+ img . style . borderRadius = '5px' ;
48
+ img . style . border = 'solid 1px black' ;
49
+
50
+ const a = document . createElement ( 'a' ) ;
51
+ a . href = ad . href ;
52
+ a . target = '_blank' ;
53
+ a . append ( img ) ;
54
+
55
+ const mainContentElement = document . getElementById ( id ) ;
56
+ mainContentElement . insertBefore ( a , mainContentElement . firstChild ) ;
57
+ } catch ( e ) {
58
+ log . warn ( e ) ;
59
+ }
60
+ }
61
+
62
+ showAd ( 'main-content' ) ;
63
+ </ script >
0 commit comments