owasp-td-jekyll 2.0.0 → 2.0.2

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: '0914aaf5b4dbb7a23f0be25fbb2068cbe2649fd5de2ad508ef525e44b6d423dc'
4
+ data.tar.gz: 34eee45f0f4bcc3484b478e5b0f7c50a6e93e099a055fda24b40849f1ac849d2
5
5
  SHA512:
6
- metadata.gz: 2abc1bdcb4a866d1b9f2a94ec4eea6ae726c13535273d95430080f79cd11231a680ca2b37feb0faefb198dd0e570689ea7c02dbe63050dbba57fc198b1e53f1b
7
- data.tar.gz: 668457d44ea9a108b7400ae5f1372a6c6220f229ae29e530a6c16ca9bc6071f5b8d06e3ccff551e908762a00b54485fe7e94f6bb9d325b6b02967fefa132e87d
6
+ metadata.gz: 1cadd56fd457d5c9d2944d5e920e1fbed3e3f5cc6555df6fe21fb3daf0c2d46dfd46c215233e4d693e8c6a6cf7f03be97cf36e0cf9c1b94a11e025e02417c440
7
+ data.tar.gz: 0f4f621cb17438ac780a1b785c03c4a39fff97b95d367077c5953a2e2caabf37534bbcae40763c26829b60118570b3a8ba8d804b6897f101e8b24b985820a9ec
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/_layouts/home.html CHANGED
@@ -7,7 +7,7 @@ layout: default
7
7
  <div class="row">
8
8
  {%- if site.logo_src -%}
9
9
  <div class="col col-md-3 text-end">
10
- <img src="{{ site.logo_src }}" style="width:100%" />
10
+ <img class="home-logo" src="{{ site.logo_src }}" style="width:100%" />
11
11
  </div>
12
12
  {%- endif -%}
13
13
  <div class="col col-md-9 text-start">
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,74 @@
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
+
88
+ .home-logo {
89
+ display: block;
90
+ width: 100%;
91
+ height: auto;
92
+ }
93
+
94
+ :root[data-theme="dark"] .home-logo {
95
+ filter: invert(76%) grayscale(100%) brightness(92%);
96
+ }
97
+
27
98
  a {
28
99
  text-decoration: none;
29
100
  }
@@ -32,8 +103,8 @@ a:hover {
32
103
  text-decoration: underline;
33
104
  }
34
105
 
35
- nav {
36
- background-color: var(--td-orange);
106
+ .navbar.bg-primary {
107
+ background-color: var(--td-nav-bg) !important;
37
108
  }
38
109
 
39
110
  .navbar {
@@ -50,12 +121,12 @@ nav {
50
121
  }
51
122
 
52
123
  .navbar-dark .navbar-nav .nav-link {
53
- color: rgba(255, 255, 255, 0.5);
124
+ color: var(--td-navbar-link-color);
54
125
  }
55
126
 
56
127
  .navbar-dark .navbar-nav .nav-link:hover,
57
128
  .navbar-dark .navbar-nav .nav-link:focus {
58
- color: rgba(255, 255, 255, 0.75);
129
+ color: var(--td-navbar-link-hover-color);
59
130
  }
60
131
 
61
132
  .navbar-dark .navbar-nav .nav-link.disabled {
@@ -71,7 +142,54 @@ nav {
71
142
 
72
143
  .navbar-dark .navbar-toggler {
73
144
  color: rgba(255, 255, 255, 0.5);
74
- border-color: rgba(255, 255, 255, 0.1);
145
+ border-color: var(--td-navbar-toggler-border);
146
+ }
147
+
148
+ .navbar-dark .navbar-nav .nav-link.theme-toggle {
149
+ color: var(--td-white);
150
+ }
151
+
152
+ .navbar-dark .theme-toggle:hover,
153
+ .navbar-dark .theme-toggle:focus,
154
+ .navbar-dark .theme-toggle:focus-visible {
155
+ color: var(--td-navbar-link-hover-color);
156
+ }
157
+
158
+ .theme-toggle {
159
+ display: inline-flex;
160
+ align-items: center;
161
+ justify-content: center;
162
+ gap: 0.45rem;
163
+ min-height: 100%;
164
+ background: transparent;
165
+ border: 0;
166
+ border-radius: 0.35rem;
167
+ transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
168
+ }
169
+
170
+ .theme-toggle:hover,
171
+ .theme-toggle:focus {
172
+ text-decoration: none;
173
+ }
174
+
175
+ .theme-toggle:hover,
176
+ .theme-toggle:focus-visible {
177
+ background-color: var(--td-theme-toggle-hover-bg);
178
+ }
179
+
180
+ .theme-toggle:focus-visible {
181
+ outline: 0;
182
+ box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.35);
183
+ }
184
+
185
+ .theme-toggle-icon {
186
+ width: 1rem;
187
+ text-align: center;
188
+ }
189
+
190
+ .theme-toggle-text {
191
+ font-size: 0.9rem;
192
+ line-height: 1;
75
193
  }
76
194
 
77
195
  #navbarToggler a {
@@ -181,7 +299,8 @@ nav {
181
299
  .breadcrumb {
182
300
  padding: 0.75rem 1rem;
183
301
  margin-bottom: 1rem;
184
- background-color: #e9ecef;
302
+ background-color: var(--td-breadcrumb-bg);
303
+ border: 1px solid var(--bs-border-color);
185
304
  border-radius: 0.25rem;
186
305
  }
187
306
 
@@ -190,7 +309,8 @@ body {
190
309
  font-size: 0.9rem;
191
310
  font-weight: 400;
192
311
  line-height: 1.5;
193
- color: var(--td-black);
312
+ color: var(--td-text-color);
313
+ background-color: var(--bs-body-bg);
194
314
  text-align: left;
195
315
  }
196
316
 
@@ -198,11 +318,133 @@ body {
198
318
  color: var(--td-white) !important;
199
319
  }
200
320
 
321
+ /* Improve readability of fenced code blocks and inline code. */
322
+ .highlighter-rouge .highlight,
323
+ pre.highlight {
324
+ background-color: var(--td-code-block-bg);
325
+ border: 1px solid var(--td-code-border);
326
+ border-radius: var(--bs-border-radius);
327
+ }
328
+
329
+ .highlighter-rouge .highlight pre,
330
+ pre.highlight {
331
+ margin: 0;
332
+ padding: 1rem;
333
+ overflow-x: auto;
334
+ color: var(--td-text-color);
335
+ background-color: transparent;
336
+ }
337
+
338
+ .highlighter-rouge .highlight pre code,
339
+ pre.highlight code {
340
+ color: var(--td-text-color);
341
+ background-color: transparent;
342
+ }
343
+
344
+ p code,
345
+ li code,
346
+ td code,
347
+ th code {
348
+ padding: 0.1rem 0.3rem;
349
+ color: var(--td-inline-code-color);
350
+ background-color: var(--td-code-bg);
351
+ font-size: 0.95em;
352
+ font-weight: 500;
353
+ line-height: 1.3;
354
+ border-radius: 0.2rem;
355
+ }
356
+
357
+ :root[data-theme="dark"] .highlight,
358
+ :root[data-theme="dark"] .highlight .hll {
359
+ background-color: var(--td-code-block-bg);
360
+ }
361
+
362
+ :root[data-theme="dark"] .highlight .c,
363
+ :root[data-theme="dark"] .highlight .ch,
364
+ :root[data-theme="dark"] .highlight .cm,
365
+ :root[data-theme="dark"] .highlight .c1,
366
+ :root[data-theme="dark"] .highlight .cpf,
367
+ :root[data-theme="dark"] .highlight .cs {
368
+ color: #88aeb8;
369
+ }
370
+
371
+ :root[data-theme="dark"] .highlight .cs {
372
+ background-color: transparent;
373
+ }
374
+
375
+ :root[data-theme="dark"] .highlight .cp,
376
+ :root[data-theme="dark"] .highlight .k,
377
+ :root[data-theme="dark"] .highlight .kc,
378
+ :root[data-theme="dark"] .highlight .kd,
379
+ :root[data-theme="dark"] .highlight .kn,
380
+ :root[data-theme="dark"] .highlight .kr,
381
+ :root[data-theme="dark"] .highlight .ow,
382
+ :root[data-theme="dark"] .highlight .bp,
383
+ :root[data-theme="dark"] .highlight .nb,
384
+ :root[data-theme="dark"] .highlight .ne {
385
+ color: #ffb86c;
386
+ }
387
+
388
+ :root[data-theme="dark"] .highlight .kt,
389
+ :root[data-theme="dark"] .highlight .nc,
390
+ :root[data-theme="dark"] .highlight .nn,
391
+ :root[data-theme="dark"] .highlight .nf,
392
+ :root[data-theme="dark"] .highlight .fm {
393
+ color: #7dcfff;
394
+ }
395
+
396
+ :root[data-theme="dark"] .highlight .s,
397
+ :root[data-theme="dark"] .highlight .sa,
398
+ :root[data-theme="dark"] .highlight .sb,
399
+ :root[data-theme="dark"] .highlight .sc,
400
+ :root[data-theme="dark"] .highlight .dl,
401
+ :root[data-theme="dark"] .highlight .sd,
402
+ :root[data-theme="dark"] .highlight .s1,
403
+ :root[data-theme="dark"] .highlight .s2,
404
+ :root[data-theme="dark"] .highlight .sh,
405
+ :root[data-theme="dark"] .highlight .sx {
406
+ color: #98d982;
407
+ }
408
+
409
+ :root[data-theme="dark"] .highlight .m,
410
+ :root[data-theme="dark"] .highlight .mb,
411
+ :root[data-theme="dark"] .highlight .mf,
412
+ :root[data-theme="dark"] .highlight .mh,
413
+ :root[data-theme="dark"] .highlight .mi,
414
+ :root[data-theme="dark"] .highlight .mo,
415
+ :root[data-theme="dark"] .highlight .il,
416
+ :root[data-theme="dark"] .highlight .no {
417
+ color: #f6c177;
418
+ }
419
+
420
+ :root[data-theme="dark"] .highlight .na,
421
+ :root[data-theme="dark"] .highlight .nt,
422
+ :root[data-theme="dark"] .highlight .nd {
423
+ color: #ff9d74;
424
+ }
425
+
426
+ :root[data-theme="dark"] .highlight .o,
427
+ :root[data-theme="dark"] .highlight .go,
428
+ :root[data-theme="dark"] .highlight .w {
429
+ color: #a8b3bf;
430
+ }
431
+
432
+ :root[data-theme="dark"] .highlight .gp,
433
+ :root[data-theme="dark"] .highlight .gt {
434
+ color: #f0a6ca;
435
+ }
436
+
437
+ :root[data-theme="dark"] .highlight .err {
438
+ color: #ff8b8b;
439
+ border-color: #ff8b8b;
440
+ }
441
+
201
442
  /* Bootstrap 4 compatibility helpers used by site content/layouts. */
202
443
  .jumbotron {
203
444
  padding: 2rem 1rem;
204
445
  margin-bottom: 2rem;
205
- background-color: #e9ecef;
446
+ background-color: var(--td-jumbotron-bg);
447
+ border: 1px solid var(--bs-border-color);
206
448
  border-radius: 0.3rem;
207
449
  }
208
450
 
@@ -218,6 +460,69 @@ body {
218
460
  border-radius: 0;
219
461
  }
220
462
 
463
+ /* Default all tables to Bootstrap's .table + .table-striped styling. */
464
+ table {
465
+ --bs-table-color-type: initial;
466
+ --bs-table-bg-type: initial;
467
+ --bs-table-color-state: initial;
468
+ --bs-table-bg-state: initial;
469
+ --bs-table-color: var(--bs-emphasis-color);
470
+ --bs-table-bg: var(--bs-body-bg);
471
+ --bs-table-border-color: var(--bs-border-color);
472
+ --bs-table-accent-bg: transparent;
473
+ --bs-table-striped-color: var(--bs-emphasis-color);
474
+ --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
475
+ width: 100%;
476
+ margin-bottom: 1rem;
477
+ vertical-align: top;
478
+ border-color: var(--bs-table-border-color);
479
+ }
480
+
481
+ table > thead > tr > * {
482
+ --bs-table-bg: var(--td-surface-alt-bg);
483
+ }
484
+
485
+ table > :not(caption) > * > * {
486
+ padding: 0.5rem 0.5rem;
487
+ color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));
488
+ background-color: var(--bs-table-bg);
489
+ border-bottom-width: var(--bs-border-width);
490
+ box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
491
+ }
492
+
493
+ table > tbody {
494
+ vertical-align: inherit;
495
+ }
496
+
497
+ table > thead {
498
+ vertical-align: bottom;
499
+ }
500
+
501
+ table > tbody > tr:nth-of-type(odd) > * {
502
+ --bs-table-color-type: var(--bs-table-striped-color);
503
+ --bs-table-bg-type: var(--bs-table-striped-bg);
504
+ }
505
+
506
+ :root[data-theme="dark"] table {
507
+ --bs-table-striped-bg: rgba(245, 241, 234, 0.06);
508
+ }
509
+
510
+ :root[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
511
+ color: rgba(245, 241, 234, 0.55);
512
+ }
513
+
514
+ :root[data-theme="dark"] .dropdown-menu {
515
+ --bs-dropdown-bg: #1b2229;
516
+ --bs-dropdown-color: var(--bs-body-color);
517
+ --bs-dropdown-border-color: var(--bs-border-color);
518
+ --bs-dropdown-link-color: var(--bs-body-color);
519
+ --bs-dropdown-link-hover-color: #ffffff;
520
+ --bs-dropdown-link-hover-bg: #2a313a;
521
+ --bs-dropdown-link-active-color: #ffffff;
522
+ --bs-dropdown-link-active-bg: var(--td-dark-orange);
523
+ --bs-dropdown-header-color: var(--bs-secondary-color);
524
+ }
525
+
221
526
  .text-left {
222
527
  text-align: left !important;
223
528
  }
@@ -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.2
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