owasp-td-jekyll 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaa2627f56350e83ea403e4ce637cb61f78a9d682b2181272c769fb508798bdd
4
- data.tar.gz: f6771a9a5442bd06155df82a85832465530a6a04d59da7eb9d9d4622095fbf03
3
+ metadata.gz: 19c0fef769132abf22f35ad4296887aca85a18a5e454e14b66fceca9454dc607
4
+ data.tar.gz: d7cd9df305b7ef0f41e0748244d39165f4c3821bd62056240ae02d485e85b20c
5
5
  SHA512:
6
- metadata.gz: 2abc1bdcb4a866d1b9f2a94ec4eea6ae726c13535273d95430080f79cd11231a680ca2b37feb0faefb198dd0e570689ea7c02dbe63050dbba57fc198b1e53f1b
7
- data.tar.gz: 668457d44ea9a108b7400ae5f1372a6c6220f229ae29e530a6c16ca9bc6071f5b8d06e3ccff551e908762a00b54485fe7e94f6bb9d325b6b02967fefa132e87d
6
+ metadata.gz: 0bde05ea8ff59490c7e445be73a2f915b01a93a5fbe168d27b74f6bcfd0b6ecef59c97f59a2d8eabfe46ba53fd44bf842d831a98cab341f192fbf0398437f899
7
+ data.tar.gz: 90f9eba6e5af1bb2c603c6d9031fa97124c62183cb714e59317d9a1949bc56d00132f78eadaf9b61cfa4213ef2e2c23fe2569230049b353a88e7886b8df69698
data/_includes/head.html CHANGED
@@ -3,9 +3,12 @@
3
3
  <title>{{ page.title }}</title>
4
4
 
5
5
  <meta charset="utf-8" />
6
+ <meta name="color-scheme" content="light dark" />
6
7
  <link rel="shortcut icon" href="{{ site.faviconUrl | relative_url }}" type="image/x-icon">
7
8
  <link rel="icon" href="{{ site.faviconUrl | relative_url }}" type="image/x-icon">
9
+ <script src="{{ '/assets/js/theme.js' | relative_url }}"></script>
8
10
  <link rel="stylesheet" href="{{ '/assets/css/bootstrap.css' | relative_url }}">
11
+ <link rel="stylesheet" href="{{ '/assets/css/vendor/rouge-friendly.css' | relative_url }}">
9
12
  <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
10
13
  <link rel="stylesheet" href="{{ '/assets/css/fontawesome.min.css' | relative_url }}">
11
14
  </head>
@@ -28,6 +28,13 @@
28
28
  {%- endfor -%}
29
29
  </div>
30
30
  </li>
31
+ <li class="nav-item">
32
+ <button class="nav-link theme-toggle" type="button" data-theme-toggle aria-label="Switch to dark mode" title="Switch to dark mode">
33
+ <i class="fas fa-moon theme-toggle-icon" aria-hidden="true"></i>
34
+ <span class="theme-toggle-text" data-theme-toggle-text>Dark mode</span>
35
+ <span class="visually-hidden" data-theme-toggle-label>Switch to dark mode</span>
36
+ </button>
37
+ </li>
31
38
  </ul>
32
39
  </div>
33
40
  </nav>
data/assets/css/style.css CHANGED
@@ -2,8 +2,23 @@
2
2
  --td-orange: #e95420;
3
3
  --td-dark-orange: #97310e;
4
4
  --td-gray: #aea79f;
5
+ --td-light-gray: #f1f3f5;
6
+ --td-code-block-bg: #f0f0f0;
7
+ --td-code-bg: #ece7e1;
8
+ --td-code-border: #d3cbc1;
9
+ --td-inline-code-color: #b02267;
5
10
  --td-white: #ffffff;
6
11
  --td-black: #333333;
12
+ --td-text-color: var(--td-black);
13
+ --td-surface-bg: #ffffff;
14
+ --td-surface-alt-bg: #f4f6f8;
15
+ --td-nav-bg: var(--td-orange);
16
+ --td-breadcrumb-bg: #e9ecef;
17
+ --td-jumbotron-bg: #e9ecef;
18
+ --td-navbar-link-color: rgba(255, 255, 255, 0.7);
19
+ --td-navbar-link-hover-color: var(--td-white);
20
+ --td-navbar-toggler-border: rgba(255, 255, 255, 0.1);
21
+ --td-theme-toggle-hover-bg: rgba(255, 255, 255, 0.12);
7
22
  --bs-primary: var(--td-orange);
8
23
  --bs-primary-rgb: 233, 84, 32;
9
24
  --bs-secondary: var(--td-gray);
@@ -12,18 +27,64 @@
12
27
  --bs-dark-rgb: 52, 58, 64;
13
28
  --bs-body-bg: var(--td-white);
14
29
  --bs-body-bg-rgb: 255, 255, 255;
15
- --bs-body-color: var(--td-black);
30
+ --bs-body-color: var(--td-text-color);
16
31
  --bs-body-color-rgb: 51, 51, 51;
17
32
  --bs-font-sans-serif: "Ubuntu", Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
18
33
  --bs-link-color: var(--td-orange);
19
34
  --bs-link-color-rgb: 233, 84, 32;
20
35
  --bs-link-hover-color: var(--td-dark-orange);
21
36
  --bs-link-hover-color-rgb: 151, 49, 14;
37
+ --bs-emphasis-color: #212529;
38
+ --bs-emphasis-color-rgb: 33, 37, 41;
39
+ --bs-secondary-bg: var(--td-surface-alt-bg);
40
+ --bs-tertiary-bg: #e9ecef;
41
+ --bs-border-color: #d7dde3;
42
+ --bs-border-color-translucent: rgba(51, 51, 51, 0.12);
22
43
  --bs-border-radius: 0.25rem;
23
44
  --bs-border-radius-sm: 0.2rem;
24
45
  --bs-border-radius-lg: 0.3rem;
25
46
  }
26
47
 
48
+ :root[data-theme="dark"] {
49
+ --td-orange: #d87248;
50
+ --td-dark-orange: #9c4728;
51
+ --td-gray: #8f8a84;
52
+ --td-light-gray: #181d22;
53
+ --td-code-block-bg: #14181d;
54
+ --td-code-bg: #2b221d;
55
+ --td-code-border: #4a3b33;
56
+ --td-inline-code-color: #ffb38e;
57
+ --td-white: #f5f1ea;
58
+ --td-text-color: #e6dfd6;
59
+ --td-surface-bg: #1a1f25;
60
+ --td-surface-alt-bg: #222931;
61
+ --td-nav-bg: #7b341b;
62
+ --td-breadcrumb-bg: #1b2229;
63
+ --td-jumbotron-bg: #1b2229;
64
+ --td-navbar-link-color: rgba(245, 241, 234, 0.72);
65
+ --td-navbar-link-hover-color: #ffffff;
66
+ --td-navbar-toggler-border: rgba(245, 241, 234, 0.2);
67
+ --td-theme-toggle-hover-bg: rgba(216, 114, 72, 0.2);
68
+ --bs-primary: var(--td-orange);
69
+ --bs-primary-rgb: 216, 114, 72;
70
+ --bs-secondary: var(--td-gray);
71
+ --bs-secondary-rgb: 143, 138, 132;
72
+ --bs-body-bg: #111418;
73
+ --bs-body-bg-rgb: 17, 20, 24;
74
+ --bs-body-color: #e6dfd6;
75
+ --bs-body-color-rgb: 230, 223, 214;
76
+ --bs-link-color: #ff9d74;
77
+ --bs-link-color-rgb: 255, 157, 116;
78
+ --bs-link-hover-color: #ffc4aa;
79
+ --bs-link-hover-color-rgb: 255, 196, 170;
80
+ --bs-emphasis-color: #f5f1ea;
81
+ --bs-emphasis-color-rgb: 245, 241, 234;
82
+ --bs-secondary-bg: var(--td-surface-alt-bg);
83
+ --bs-tertiary-bg: #2a313a;
84
+ --bs-border-color: #39424c;
85
+ --bs-border-color-translucent: rgba(245, 241, 234, 0.12);
86
+ }
87
+
27
88
  a {
28
89
  text-decoration: none;
29
90
  }
@@ -32,8 +93,8 @@ a:hover {
32
93
  text-decoration: underline;
33
94
  }
34
95
 
35
- nav {
36
- background-color: var(--td-orange);
96
+ .navbar.bg-primary {
97
+ background-color: var(--td-nav-bg) !important;
37
98
  }
38
99
 
39
100
  .navbar {
@@ -50,12 +111,12 @@ nav {
50
111
  }
51
112
 
52
113
  .navbar-dark .navbar-nav .nav-link {
53
- color: rgba(255, 255, 255, 0.5);
114
+ color: var(--td-navbar-link-color);
54
115
  }
55
116
 
56
117
  .navbar-dark .navbar-nav .nav-link:hover,
57
118
  .navbar-dark .navbar-nav .nav-link:focus {
58
- color: rgba(255, 255, 255, 0.75);
119
+ color: var(--td-navbar-link-hover-color);
59
120
  }
60
121
 
61
122
  .navbar-dark .navbar-nav .nav-link.disabled {
@@ -71,7 +132,54 @@ nav {
71
132
 
72
133
  .navbar-dark .navbar-toggler {
73
134
  color: rgba(255, 255, 255, 0.5);
74
- border-color: rgba(255, 255, 255, 0.1);
135
+ border-color: var(--td-navbar-toggler-border);
136
+ }
137
+
138
+ .navbar-dark .navbar-nav .nav-link.theme-toggle {
139
+ color: var(--td-white);
140
+ }
141
+
142
+ .navbar-dark .theme-toggle:hover,
143
+ .navbar-dark .theme-toggle:focus,
144
+ .navbar-dark .theme-toggle:focus-visible {
145
+ color: var(--td-navbar-link-hover-color);
146
+ }
147
+
148
+ .theme-toggle {
149
+ display: inline-flex;
150
+ align-items: center;
151
+ justify-content: center;
152
+ gap: 0.45rem;
153
+ min-height: 100%;
154
+ background: transparent;
155
+ border: 0;
156
+ border-radius: 0.35rem;
157
+ transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
158
+ }
159
+
160
+ .theme-toggle:hover,
161
+ .theme-toggle:focus {
162
+ text-decoration: none;
163
+ }
164
+
165
+ .theme-toggle:hover,
166
+ .theme-toggle:focus-visible {
167
+ background-color: var(--td-theme-toggle-hover-bg);
168
+ }
169
+
170
+ .theme-toggle:focus-visible {
171
+ outline: 0;
172
+ box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.35);
173
+ }
174
+
175
+ .theme-toggle-icon {
176
+ width: 1rem;
177
+ text-align: center;
178
+ }
179
+
180
+ .theme-toggle-text {
181
+ font-size: 0.9rem;
182
+ line-height: 1;
75
183
  }
76
184
 
77
185
  #navbarToggler a {
@@ -181,7 +289,8 @@ nav {
181
289
  .breadcrumb {
182
290
  padding: 0.75rem 1rem;
183
291
  margin-bottom: 1rem;
184
- background-color: #e9ecef;
292
+ background-color: var(--td-breadcrumb-bg);
293
+ border: 1px solid var(--bs-border-color);
185
294
  border-radius: 0.25rem;
186
295
  }
187
296
 
@@ -190,7 +299,8 @@ body {
190
299
  font-size: 0.9rem;
191
300
  font-weight: 400;
192
301
  line-height: 1.5;
193
- color: var(--td-black);
302
+ color: var(--td-text-color);
303
+ background-color: var(--bs-body-bg);
194
304
  text-align: left;
195
305
  }
196
306
 
@@ -198,11 +308,133 @@ body {
198
308
  color: var(--td-white) !important;
199
309
  }
200
310
 
311
+ /* Improve readability of fenced code blocks and inline code. */
312
+ .highlighter-rouge .highlight,
313
+ pre.highlight {
314
+ background-color: var(--td-code-block-bg);
315
+ border: 1px solid var(--td-code-border);
316
+ border-radius: var(--bs-border-radius);
317
+ }
318
+
319
+ .highlighter-rouge .highlight pre,
320
+ pre.highlight {
321
+ margin: 0;
322
+ padding: 1rem;
323
+ overflow-x: auto;
324
+ color: var(--td-text-color);
325
+ background-color: transparent;
326
+ }
327
+
328
+ .highlighter-rouge .highlight pre code,
329
+ pre.highlight code {
330
+ color: var(--td-text-color);
331
+ background-color: transparent;
332
+ }
333
+
334
+ p code,
335
+ li code,
336
+ td code,
337
+ th code {
338
+ padding: 0.1rem 0.3rem;
339
+ color: var(--td-inline-code-color);
340
+ background-color: var(--td-code-bg);
341
+ font-size: 0.95em;
342
+ font-weight: 500;
343
+ line-height: 1.3;
344
+ border-radius: 0.2rem;
345
+ }
346
+
347
+ :root[data-theme="dark"] .highlight,
348
+ :root[data-theme="dark"] .highlight .hll {
349
+ background-color: var(--td-code-block-bg);
350
+ }
351
+
352
+ :root[data-theme="dark"] .highlight .c,
353
+ :root[data-theme="dark"] .highlight .ch,
354
+ :root[data-theme="dark"] .highlight .cm,
355
+ :root[data-theme="dark"] .highlight .c1,
356
+ :root[data-theme="dark"] .highlight .cpf,
357
+ :root[data-theme="dark"] .highlight .cs {
358
+ color: #88aeb8;
359
+ }
360
+
361
+ :root[data-theme="dark"] .highlight .cs {
362
+ background-color: transparent;
363
+ }
364
+
365
+ :root[data-theme="dark"] .highlight .cp,
366
+ :root[data-theme="dark"] .highlight .k,
367
+ :root[data-theme="dark"] .highlight .kc,
368
+ :root[data-theme="dark"] .highlight .kd,
369
+ :root[data-theme="dark"] .highlight .kn,
370
+ :root[data-theme="dark"] .highlight .kr,
371
+ :root[data-theme="dark"] .highlight .ow,
372
+ :root[data-theme="dark"] .highlight .bp,
373
+ :root[data-theme="dark"] .highlight .nb,
374
+ :root[data-theme="dark"] .highlight .ne {
375
+ color: #ffb86c;
376
+ }
377
+
378
+ :root[data-theme="dark"] .highlight .kt,
379
+ :root[data-theme="dark"] .highlight .nc,
380
+ :root[data-theme="dark"] .highlight .nn,
381
+ :root[data-theme="dark"] .highlight .nf,
382
+ :root[data-theme="dark"] .highlight .fm {
383
+ color: #7dcfff;
384
+ }
385
+
386
+ :root[data-theme="dark"] .highlight .s,
387
+ :root[data-theme="dark"] .highlight .sa,
388
+ :root[data-theme="dark"] .highlight .sb,
389
+ :root[data-theme="dark"] .highlight .sc,
390
+ :root[data-theme="dark"] .highlight .dl,
391
+ :root[data-theme="dark"] .highlight .sd,
392
+ :root[data-theme="dark"] .highlight .s1,
393
+ :root[data-theme="dark"] .highlight .s2,
394
+ :root[data-theme="dark"] .highlight .sh,
395
+ :root[data-theme="dark"] .highlight .sx {
396
+ color: #98d982;
397
+ }
398
+
399
+ :root[data-theme="dark"] .highlight .m,
400
+ :root[data-theme="dark"] .highlight .mb,
401
+ :root[data-theme="dark"] .highlight .mf,
402
+ :root[data-theme="dark"] .highlight .mh,
403
+ :root[data-theme="dark"] .highlight .mi,
404
+ :root[data-theme="dark"] .highlight .mo,
405
+ :root[data-theme="dark"] .highlight .il,
406
+ :root[data-theme="dark"] .highlight .no {
407
+ color: #f6c177;
408
+ }
409
+
410
+ :root[data-theme="dark"] .highlight .na,
411
+ :root[data-theme="dark"] .highlight .nt,
412
+ :root[data-theme="dark"] .highlight .nd {
413
+ color: #ff9d74;
414
+ }
415
+
416
+ :root[data-theme="dark"] .highlight .o,
417
+ :root[data-theme="dark"] .highlight .go,
418
+ :root[data-theme="dark"] .highlight .w {
419
+ color: #a8b3bf;
420
+ }
421
+
422
+ :root[data-theme="dark"] .highlight .gp,
423
+ :root[data-theme="dark"] .highlight .gt {
424
+ color: #f0a6ca;
425
+ }
426
+
427
+ :root[data-theme="dark"] .highlight .err {
428
+ color: #ff8b8b;
429
+ border-color: #ff8b8b;
430
+ }
431
+
201
432
  /* Bootstrap 4 compatibility helpers used by site content/layouts. */
202
433
  .jumbotron {
203
434
  padding: 2rem 1rem;
204
435
  margin-bottom: 2rem;
205
- background-color: #e9ecef;
436
+ background-color: var(--td-jumbotron-bg);
437
+ border: 1px solid var(--bs-border-color);
206
438
  border-radius: 0.3rem;
207
439
  }
208
440
 
@@ -218,6 +450,69 @@ body {
218
450
  border-radius: 0;
219
451
  }
220
452
 
453
+ /* Default all tables to Bootstrap's .table + .table-striped styling. */
454
+ table {
455
+ --bs-table-color-type: initial;
456
+ --bs-table-bg-type: initial;
457
+ --bs-table-color-state: initial;
458
+ --bs-table-bg-state: initial;
459
+ --bs-table-color: var(--bs-emphasis-color);
460
+ --bs-table-bg: var(--bs-body-bg);
461
+ --bs-table-border-color: var(--bs-border-color);
462
+ --bs-table-accent-bg: transparent;
463
+ --bs-table-striped-color: var(--bs-emphasis-color);
464
+ --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
465
+ width: 100%;
466
+ margin-bottom: 1rem;
467
+ vertical-align: top;
468
+ border-color: var(--bs-table-border-color);
469
+ }
470
+
471
+ table > thead > tr > * {
472
+ --bs-table-bg: var(--td-surface-alt-bg);
473
+ }
474
+
475
+ table > :not(caption) > * > * {
476
+ padding: 0.5rem 0.5rem;
477
+ color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));
478
+ background-color: var(--bs-table-bg);
479
+ border-bottom-width: var(--bs-border-width);
480
+ box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
481
+ }
482
+
483
+ table > tbody {
484
+ vertical-align: inherit;
485
+ }
486
+
487
+ table > thead {
488
+ vertical-align: bottom;
489
+ }
490
+
491
+ table > tbody > tr:nth-of-type(odd) > * {
492
+ --bs-table-color-type: var(--bs-table-striped-color);
493
+ --bs-table-bg-type: var(--bs-table-striped-bg);
494
+ }
495
+
496
+ :root[data-theme="dark"] table {
497
+ --bs-table-striped-bg: rgba(245, 241, 234, 0.06);
498
+ }
499
+
500
+ :root[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
501
+ color: rgba(245, 241, 234, 0.55);
502
+ }
503
+
504
+ :root[data-theme="dark"] .dropdown-menu {
505
+ --bs-dropdown-bg: #1b2229;
506
+ --bs-dropdown-color: var(--bs-body-color);
507
+ --bs-dropdown-border-color: var(--bs-border-color);
508
+ --bs-dropdown-link-color: var(--bs-body-color);
509
+ --bs-dropdown-link-hover-color: #ffffff;
510
+ --bs-dropdown-link-hover-bg: #2a313a;
511
+ --bs-dropdown-link-active-color: #ffffff;
512
+ --bs-dropdown-link-active-bg: var(--td-dark-orange);
513
+ --bs-dropdown-header-color: var(--bs-secondary-color);
514
+ }
515
+
221
516
  .text-left {
222
517
  text-align: left !important;
223
518
  }
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org>
@@ -0,0 +1,70 @@
1
+ /* Vendored from richleland/pygments-css (friendly.css), UNLICENSE. */
2
+ .highlight .hll { background-color: #ffffcc }
3
+ .highlight { background: #f0f0f0; }
4
+ .highlight .c { color: #60a0b0; font-style: italic } /* Comment */
5
+ .highlight .err { border: 1px solid #FF0000 } /* Error */
6
+ .highlight .k { color: #007020; font-weight: bold } /* Keyword */
7
+ .highlight .o { color: #666666 } /* Operator */
8
+ .highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */
9
+ .highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
10
+ .highlight .cp { color: #007020 } /* Comment.Preproc */
11
+ .highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */
12
+ .highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
13
+ .highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
14
+ .highlight .gd { color: #A00000 } /* Generic.Deleted */
15
+ .highlight .ge { font-style: italic } /* Generic.Emph */
16
+ .highlight .gr { color: #FF0000 } /* Generic.Error */
17
+ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
18
+ .highlight .gi { color: #00A000 } /* Generic.Inserted */
19
+ .highlight .go { color: #888888 } /* Generic.Output */
20
+ .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
21
+ .highlight .gs { font-weight: bold } /* Generic.Strong */
22
+ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
23
+ .highlight .gt { color: #0044DD } /* Generic.Traceback */
24
+ .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
25
+ .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
26
+ .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
27
+ .highlight .kp { color: #007020 } /* Keyword.Pseudo */
28
+ .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
29
+ .highlight .kt { color: #902000 } /* Keyword.Type */
30
+ .highlight .m { color: #40a070 } /* Literal.Number */
31
+ .highlight .s { color: #4070a0 } /* Literal.String */
32
+ .highlight .na { color: #4070a0 } /* Name.Attribute */
33
+ .highlight .nb { color: #007020 } /* Name.Builtin */
34
+ .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
35
+ .highlight .no { color: #60add5 } /* Name.Constant */
36
+ .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
37
+ .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
38
+ .highlight .ne { color: #007020 } /* Name.Exception */
39
+ .highlight .nf { color: #06287e } /* Name.Function */
40
+ .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
41
+ .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
42
+ .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
43
+ .highlight .nv { color: #bb60d5 } /* Name.Variable */
44
+ .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
45
+ .highlight .w { color: #bbbbbb } /* Text.Whitespace */
46
+ .highlight .mb { color: #40a070 } /* Literal.Number.Bin */
47
+ .highlight .mf { color: #40a070 } /* Literal.Number.Float */
48
+ .highlight .mh { color: #40a070 } /* Literal.Number.Hex */
49
+ .highlight .mi { color: #40a070 } /* Literal.Number.Integer */
50
+ .highlight .mo { color: #40a070 } /* Literal.Number.Oct */
51
+ .highlight .sa { color: #4070a0 } /* Literal.String.Affix */
52
+ .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
53
+ .highlight .sc { color: #4070a0 } /* Literal.String.Char */
54
+ .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
55
+ .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
56
+ .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
57
+ .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
58
+ .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
59
+ .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
60
+ .highlight .sx { color: #c65d09 } /* Literal.String.Other */
61
+ .highlight .sr { color: #235388 } /* Literal.String.Regex */
62
+ .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
63
+ .highlight .ss { color: #517918 } /* Literal.String.Symbol */
64
+ .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
65
+ .highlight .fm { color: #06287e } /* Name.Function.Magic */
66
+ .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
67
+ .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
68
+ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
69
+ .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
70
+ .highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
@@ -0,0 +1,99 @@
1
+ const THEME_STORAGE_KEY = 'td-theme';
2
+ const LIGHT_THEME = 'light';
3
+ const DARK_THEME = 'dark';
4
+ const themeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
5
+
6
+ function getStoredTheme() {
7
+ try {
8
+ const theme = window.localStorage.getItem(THEME_STORAGE_KEY);
9
+ if (theme === LIGHT_THEME || theme === DARK_THEME) {
10
+ return theme;
11
+ }
12
+ } catch (error) {
13
+ // Ignore storage access issues and fall back to the system preference.
14
+ }
15
+
16
+ return null;
17
+ }
18
+
19
+ function getPreferredTheme() {
20
+ return getStoredTheme() || (themeMediaQuery.matches ? DARK_THEME : LIGHT_THEME);
21
+ }
22
+
23
+ function applyTheme(theme) {
24
+ const rootElement = document.documentElement;
25
+ rootElement.setAttribute('data-theme', theme);
26
+ rootElement.setAttribute('data-bs-theme', theme);
27
+ rootElement.style.colorScheme = theme;
28
+ }
29
+
30
+ function updateThemeToggle(theme) {
31
+ document.querySelectorAll('[data-theme-toggle]').forEach((toggleButton) => {
32
+ const nextTheme = theme === DARK_THEME ? LIGHT_THEME : DARK_THEME;
33
+ const nextThemeLabel = nextTheme === DARK_THEME ? 'dark' : 'light';
34
+ const nextThemeText = nextTheme === DARK_THEME ? 'Dark mode' : 'Light mode';
35
+ const iconElement = toggleButton.querySelector('.theme-toggle-icon');
36
+ const labelElement = toggleButton.querySelector('[data-theme-toggle-label]');
37
+ const textElement = toggleButton.querySelector('[data-theme-toggle-text]');
38
+
39
+ toggleButton.setAttribute('aria-pressed', String(theme === DARK_THEME));
40
+ toggleButton.setAttribute('aria-label', `Switch to ${nextThemeLabel} mode`);
41
+ toggleButton.setAttribute('title', `Switch to ${nextThemeLabel} mode`);
42
+
43
+ if (labelElement) {
44
+ labelElement.textContent = `Switch to ${nextThemeLabel} mode`;
45
+ }
46
+
47
+ if (textElement) {
48
+ textElement.textContent = nextThemeText;
49
+ }
50
+
51
+ if (iconElement) {
52
+ iconElement.classList.toggle('fa-moon', theme !== DARK_THEME);
53
+ iconElement.classList.toggle('fa-sun', theme === DARK_THEME);
54
+ }
55
+ });
56
+ }
57
+
58
+ function setTheme(theme, persistThemePreference) {
59
+ applyTheme(theme);
60
+ updateThemeToggle(theme);
61
+
62
+ if (persistThemePreference) {
63
+ try {
64
+ window.localStorage.setItem(THEME_STORAGE_KEY, theme);
65
+ } catch (error) {
66
+ // Ignore storage access issues and continue with the applied theme.
67
+ }
68
+ }
69
+ }
70
+
71
+ applyTheme(getPreferredTheme());
72
+
73
+ document.addEventListener('DOMContentLoaded', () => {
74
+ updateThemeToggle(getPreferredTheme());
75
+
76
+ document.querySelectorAll('[data-theme-toggle]').forEach((toggleButton) => {
77
+ toggleButton.addEventListener('click', () => {
78
+ const currentTheme = document.documentElement.getAttribute('data-theme') === DARK_THEME ? DARK_THEME : LIGHT_THEME;
79
+ const nextTheme = currentTheme === DARK_THEME ? LIGHT_THEME : DARK_THEME;
80
+ setTheme(nextTheme, true);
81
+ });
82
+ });
83
+ });
84
+
85
+ function handleSystemThemeChange(event) {
86
+ if (getStoredTheme()) {
87
+ return;
88
+ }
89
+
90
+ const nextTheme = event.matches ? DARK_THEME : LIGHT_THEME;
91
+ applyTheme(nextTheme);
92
+ updateThemeToggle(nextTheme);
93
+ }
94
+
95
+ if (typeof themeMediaQuery.addEventListener === 'function') {
96
+ themeMediaQuery.addEventListener('change', handleSystemThemeChange);
97
+ } else if (typeof themeMediaQuery.addListener === 'function') {
98
+ themeMediaQuery.addListener(handleSystemThemeChange);
99
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owasp-td-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leo Reading
@@ -48,11 +48,14 @@ files:
48
48
  - assets/css/bootstrap.min.css.map
49
49
  - assets/css/fontawesome.min.css
50
50
  - assets/css/style.css
51
+ - assets/css/vendor/rouge-friendly.UNLICENSE.txt
52
+ - assets/css/vendor/rouge-friendly.css
51
53
  - assets/images/favicon.ico
52
54
  - assets/images/threatdragon_logo_image.svg
53
55
  - assets/js/bootstrap.bundle.min.js
54
56
  - assets/js/bootstrap.bundle.min.js.map
55
57
  - assets/js/sidebar.js
58
+ - assets/js/theme.js
56
59
  - assets/webfonts/fa-brands-400.eot
57
60
  - assets/webfonts/fa-brands-400.svg
58
61
  - assets/webfonts/fa-brands-400.ttf