-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththemes.html
More file actions
1101 lines (1073 loc) · 40.2 KB
/
Copy paththemes.html
File metadata and controls
1101 lines (1073 loc) · 40.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en" data-theme="light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Themes - Degoog docs</title>
<script>
(function () {
try {
var t = localStorage.getItem("ade:theme");
if (t !== "light" && t !== "dark") {
t = window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "light";
}
document.documentElement.setAttribute("data-theme", t);
} catch (e) {}
})();
</script>
<link
rel="icon"
href="https://github.com/fccview/degoog/raw/main/src/public/images/degoog-logo.png"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
/>
<link rel="stylesheet" href="style.css?cache=burstthefucker" />
</head>
<body>
<div class="degoog-docs-layout">
<header class="degoog-docs-mobile-header">
<button id="degoog-docs-burger" type="button" class="degoog-docs-btn degoog-docs-btn-burger">
<i class="fa-solid fa-bars"></i>
</button>
<span class="degoog-docs-mobile-title">Degoog Docs</span>
</header>
<div class="degoog-docs-content">
<aside class="degoog-docs-sidebar">
<div class="degoog-docs-sidebar-brand">
<img
src="https://github.com/fccview/degoog/raw/main/src/public/images/degoog-logo.png"
alt="degoog logo"
class="degoog-docs-brand-img"
onerror="this.style.display = 'none'"
/>
<a href="index.html" class="degoog-docs-brand-name">Degoog Docs</a>
</div>
<div class="degoog-docs-sidebar-search">
<div class="doc-search-wrap">
<input
type="search"
id="doc-search-input"
class="degoog-docs-input doc-search"
placeholder="Search docs..."
autocomplete="off"
/>
<button
type="button"
class="doc-search-clear degoog-docs-btn"
aria-label="Clear search"
style="display: none"
>
Clear
</button>
<span class="doc-search-count"></span>
</div>
</div>
<nav class="degoog-docs-nav" aria-label="Documentation">
<a href="index.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-book-open fa-lg"></i></i
><span class="degoog-docs-nav-item-name">Overview</span></a
>
<a href="plugins.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-puzzle-piece fa-lg"></i
><span class="degoog-docs-nav-item-name"> Plugins</span></a
>
<a href="shortcuts.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-arrow-down-a-z fa-lg"></i></i
><span class="degoog-docs-nav-item-name"> Shortcuts</span></a
>
<a href="themes.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-palette fa-lg"></i
><span class="degoog-docs-nav-item-name"> Themes</span></a
>
<a href="engines.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-bolt fa-lg"></i
><span class="degoog-docs-nav-item-name"> Search engines</span></a
>
<a href="autocomplete.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-keyboard fa-lg"></i
><span class="degoog-docs-nav-item-name"> Autocomplete</span></a
>
<a href="transports.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-network-wired fa-lg"></i
><span class="degoog-docs-nav-item-name"> Transports</span></a
>
<a href="store.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-store fa-lg"></i
><span class="degoog-docs-nav-item-name"> Store</span></a
>
<a href="aliases.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-link fa-lg"></i
><span class="degoog-docs-nav-item-name"> Aliases</span></a
>
<a href="env.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-lock fa-lg"></i></i
><span class="degoog-docs-nav-item-name">ENV Variables</span></a
>
<a href="styling.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-swatchbook fa-lg"></i></i
><span class="degoog-docs-nav-item-name"> Styling</span></a
>
<a href="translations.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-language fa-lg"></i
><span class="degoog-docs-nav-item-name"> Translations</span></a
>
<a href="api.html" class="degoog-docs-nav-item"
><i class="fa-solid fa-code fa-lg"></i
><span class="degoog-docs-nav-item-name"> API</span></a
>
</nav>
<div class="degoog-docs-sidebar-actions">
<button
id="doc-theme-toggle"
type="button"
class="degoog-docs-btn"
aria-label="Toggle theme"
>
<i class="fa-solid fa-circle-half-stroke"></i>
</button>
</div>
</aside>
<main class="degoog-docs-main">
<div class="doc-page-header">
<h1><a href="index.html">Degoog</a> Themes</h1>
<p class="doc-page-desc">
Override the look, layout, and result markup.
</p>
</div>
<div class="doc-cli-banner">
<i class="fa-solid fa-terminal"></i>
<p>
<strong>degoog-cli is now available.</strong>
Scaffold theme boilerplate directly from your terminal - no copy-pasting, no guessing the folder structure.
Install with <code>curl -fsSL https://raw.githubusercontent.com/degoog-org/cli/main/install.sh | sh</code>
or grab it from <a href="https://github.com/degoog-org/cli" target="_blank" rel="noopener">github.com/degoog-org/cli</a>.
</p>
</div>
<h2 id="default-theme">Default theme reference</h2>
<p>
The default theme lives at
<a
href="https://github.com/degoog-org/degoog/tree/main/src/public/themes/degoog-theme"
><code>src/public/themes/degoog-theme/</code></a
>. You should use it as your starting point.
</p>
<h2>Getting started</h2>
<p>
Create a folder inside <code>data/themes/</code> or whatever you set
<code>DEGOOG_THEMES_DIR</code> to. The folder name will be your
theme ID. Add a <code>theme.json</code> file with at least a
<code>name</code> property.
</p>
<table>
<thead>
<tr>
<th>Tier</th>
<th>What you provide</th>
<th>What you control</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>CSS only</strong></td>
<td><code>theme.json</code> plus your stylesheet</td>
<td>Colors, fonts, and spacing using CSS variables</td>
</tr>
<tr>
<td><strong>CSS and templates</strong></td>
<td>
<code>theme.json</code> plus your stylesheet and template
files
</td>
<td>Everything above plus the HTML structure of any section</td>
</tr>
<tr>
<td><strong>Layout override</strong></td>
<td>
<code>theme.json</code> plus your stylesheet and a custom
<code>layout.html</code>
</td>
<td>
Everything above plus the page title, meta tags, favicons, and
scripts
</td>
</tr>
<tr>
<td><strong>Full HTML override</strong></td>
<td>
<code>theme.json</code> plus your stylesheet and a custom
<code>index.html</code> or <code>search.html</code>
</td>
<td>Total control that bypasses the layout entirely</td>
</tr>
</tbody>
</table>
<p>
Only include the templates you actually want to change because
everything else will naturally fall back to the
<a href="#default-theme">default theme</a>. You can apply your new
theme by navigating to Settings and then Themes.
</p>
<h3>Layout override</h3>
<p>
To customize the page title, meta description, favicons, or anything
inside the <code><head></code>, provide a
<code>layout.html</code> in your theme and reference it under
<code>html.layout</code>. You can copy the
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/layout.html"
>default layout</a
>
and edit it. You <strong>must</strong> keep these exact
placeholders:
</p>
<ul>
<li>
<code>__PAGE_CONTENT__</code> is where the skeleton HTML gets
inserted
</li>
<li><code>__BODY_CLASS__</code> is the body class attribute</li>
<li>
<code>__THEME_TEMPLATES__</code> is where your templates are
injected
</li>
<li>
<code>__THEME_CSS__</code>, <code>__PLUGIN_ASSETS__</code>,
<code>__CUSTOM_CSS__</code>, and <code>__APP_VERSION__</code>
</li>
</ul>
<h2>Page architecture</h2>
<p>Every page is built with three layers:</p>
<ol>
<li>
<strong>Layout</strong>
(<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/layout.html"
><code>layout.html</code></a
>) is the shared HTML shell. Change this at your own risk.
</li>
<li>
<strong>Skeleton</strong>
(<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/index.html"
><code>index.html</code></a
>
or
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search.html"
><code>search.html</code></a
>) provides empty <code><div></code> elements with required
IDs that our JavaScript relies on.
</li>
<li>
<strong>Templates</strong> are individual HTML files rendered
directly into the skeleton. These are what your themes will
override.
</li>
</ol>
<h2>theme.json</h2>
<p>
Check out the
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/theme.json"
>default theme.json</a
>
for a complete working example.
</p>
<table>
<thead>
<tr>
<th>Key</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>yes</td>
<td>The display name shown in Settings then Themes</td>
</tr>
<tr>
<td>
<code>author</code>, <code>description</code>,
<code>version</code>
</td>
<td>no</td>
<td>Details shown on the theme card</td>
</tr>
<tr>
<td><code>css</code></td>
<td>no</td>
<td>
Your stylesheet path which also supports
<code>.scss</code> files. It is served at
<code>/theme/style.css</code>
</td>
</tr>
<tr>
<td><code>templates</code></td>
<td>no</td>
<td>
An object mapping your template keys to their file paths.
These are injected automatically as
<code><template></code> elements
</td>
</tr>
<tr>
<td><code>html</code></td>
<td>no</td>
<td>
An object containing <code>layout</code>, <code>index</code>,
and <code>search</code>. Fragments are composed into the
layout while full HTML documents starting with
<code><!doctype></code> bypass the layout entirely
</td>
</tr>
<tr>
<td><code>settingsSchema</code></td>
<td>no</td>
<td>
Exposes a Configure button directly on the theme card. These
values are stored under <code>theme-<id></code>
</td>
</tr>
</tbody>
</table>
<p>
Your custom HTML can utilize these placeholders:
<code>__THEME_CSS__</code>, <code>__THEME_ATTRS__</code>,
<code>__PLUGIN_ASSETS__</code>, <code>__CUSTOM_CSS__</code>,
<code>__APP_VERSION__</code>, <code>__THEME_TEMPLATES__</code>,
<code>__PAGE_CONTENT__</code>, and <code>__BODY_CLASS__</code>.
</p>
<h2>Static assets</h2>
<p>
Any file placed inside your theme folder is served securely at
<code>/themes/<theme-id>/<path></code>. We support JS,
CSS, HTML, JSON, SVG, PNG, JPG, GIF, WebP, TTF, WOFF, and WOFF2
files.
</p>
<p>
When installed from the store, the theme folder is named
<code><author>-<repo>-<theme-name></code>. Never
hardcode that path - use <strong>relative URLs</strong> in CSS and
<strong><code>__THEME_PATH__</code></strong> in HTML templates
instead. Degoog rewrites both at serve time to the correct installed
path automatically.
</p>
<p>In CSS, use relative URLs:</p>
<pre><code>@font-face {
font-family: "My Font";
src: url("fonts/my-font.woff2") format("woff2");
font-display: swap;
}</code></pre>
<p>In HTML templates, use <code>__THEME_PATH__</code>:</p>
<pre><code><img src="__THEME_PATH__/images/logo.png" /></code></pre>
<p>
Note that <code>theme.json</code> is never served to the client.
</p>
<h3>Example</h3>
<pre><code>{
"name": "My Theme",
"css": "style.css",
"templates": {
"result": "templates/result.html"
}
}</code></pre>
<h2 id="templates">Templates</h2>
<p>
Templates control the HTML structure of every page section. You list
them under
<code>templates</code> inside your <code>theme.json</code> file. The
keys are automatically prefixed with <code>degoog-</code> to form
the element ID. The last template with a specific ID wins, meaning
your overrides will always take priority over the defaults.
</p>
<h3>Search page templates</h3>
<table>
<thead>
<tr>
<th>Key</th>
<th>Description</th>
<th>Source</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>search-header</code></td>
<td>Logo plus search bar plus settings gear</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/header.html"
>header.html</a
>
</td>
</tr>
<tr>
<td><code>search-tabs</code></td>
<td>Tab bar plus options dropdown</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/tabs.html"
>tabs.html</a
>
</td>
</tr>
<tr>
<td><code>search-media-preview</code></td>
<td>Image and video preview panel</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/media-preview.html"
>media-preview.html</a
>
</td>
</tr>
<tr>
<td><code>search-lightbox</code></td>
<td>Full screen image lightbox</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/lightbox.html"
>lightbox.html</a
>
</td>
</tr>
<tr>
<td><code>result</code></td>
<td>Web and news result items</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/result.html"
>result.html</a
>
</td>
</tr>
<tr>
<td><code>image-card</code></td>
<td>Image grid cards</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/image-card.html"
>image-card.html</a
>
</td>
</tr>
<tr>
<td><code>video-card</code></td>
<td>Video grid cards</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/video-card.html"
>video-card.html</a
>
</td>
</tr>
<tr>
<td><code>at-a-glance</code></td>
<td>At a glance content box</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/search-templates/at-a-glance.html"
>at-a-glance.html</a
>
</td>
</tr>
</tbody>
</table>
<h3>Home page templates</h3>
<table>
<thead>
<tr>
<th>Key</th>
<th>Description</th>
<th>Source</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>home-header</code></td>
<td>Top header navigation bar</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/index-templates/header.html"
>header.html</a
>
</td>
</tr>
<tr>
<td><code>home-logo</code></td>
<td>Main logo and branding</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/index-templates/logo.html"
>logo.html</a
>
</td>
</tr>
<tr>
<td><code>home-search</code></td>
<td>The primary search form</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/index-templates/search.html"
>search.html</a
>
</td>
</tr>
<tr>
<td><code>home-footer</code></td>
<td>Page footer</td>
<td>
<a
href="https://github.com/degoog-org/degoog/blob/main/src/public/themes/degoog-theme/index-templates/footer.html"
>footer.html</a
>
</td>
</tr>
</tbody>
</table>
<h2>Skeleton IDs</h2>
<p>
Skeleton elements are simply empty <code><div></code> tags
that only contain an <code>id</code>. Our JavaScript injects the
templates right into them.
<strong>Please do not remove or rename these IDs.</strong>
</p>
<h3>Home page</h3>
<table>
<thead>
<tr>
<th>ID</th>
<th>Receives</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>header</code></td>
<td><code>degoog-home-header</code></td>
</tr>
<tr>
<td><code>main-home</code></td>
<td>Main content area where plugins might inject</td>
</tr>
<tr>
<td><code>home-logo</code></td>
<td><code>degoog-home-logo</code></td>
</tr>
<tr>
<td><code>home-search</code></td>
<td><code>degoog-home-search</code></td>
</tr>
<tr>
<td><code>home-footer</code></td>
<td><code>degoog-home-footer</code></td>
</tr>
</tbody>
</table>
<h3>Search page</h3>
<table>
<thead>
<tr>
<th>ID</th>
<th>Receives</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>results-page</code></td>
<td>Top level page wrapper</td>
</tr>
<tr>
<td><code>results-header</code></td>
<td><code>degoog-search-header</code></td>
</tr>
<tr>
<td><code>results-tabs</code></td>
<td><code>degoog-search-tabs</code></td>
</tr>
<tr>
<td><code>results-meta</code></td>
<td>Engine timing and stats display</td>
</tr>
<tr>
<td><code>results-layout</code></td>
<td>Layout wrapper covering main, sidebar, and previews</td>
</tr>
<tr>
<td><code>results-main</code></td>
<td>Main results column</td>
</tr>
<tr>
<td><code>at-a-glance</code></td>
<td><code>degoog-at-a-glance</code></td>
</tr>
<tr>
<td><code>results-list</code></td>
<td>The actual search results</td>
</tr>
<tr>
<td><code>pagination</code></td>
<td>Page navigation controls</td>
</tr>
<tr>
<td><code>sidebar-col</code></td>
<td>Sidebar column container</td>
</tr>
<tr>
<td><code>results-sidebar</code></td>
<td>Sidebar content area</td>
</tr>
<tr>
<td><code>media-preview-panel</code></td>
<td><code>degoog-search-media-preview</code></td>
</tr>
<tr>
<td><code>img-lightbox</code></td>
<td><code>degoog-search-lightbox</code></td>
</tr>
<tr>
<td><code>slot-above-results</code></td>
<td>Plugin slot area</td>
</tr>
<tr>
<td><code>slot-below-results</code></td>
<td>Plugin slot area</td>
</tr>
<tr>
<td><code>slot-above-sidebar</code></td>
<td>Plugin slot area</td>
</tr>
<tr>
<td><code>slot-below-sidebar</code></td>
<td>Plugin slot area</td>
</tr>
</tbody>
</table>
<h2>Required IDs inside templates</h2>
<p>
Some templates contain inner elements that our JavaScript hooks into
directly. Keep these IDs intact when you override files otherwise
the feature will break. Any templates not listed here like
<code>degoog-home-header</code>, <code>degoog-home-logo</code>,
<code>degoog-home-footer</code>, <code>degoog-image-card</code>,
<code>degoog-video-card</code>, and
<code>degoog-at-a-glance</code> can be restructured freely.
</p>
<h4><code>degoog-home-search</code></h4>
<ul>
<li><code>search-input</code> handles the text input</li>
<li>
<code>ac-dropdown-home</code> handles the autocomplete dropdown
</li>
<li>
<code>search-bar-actions-home</code> handles the action buttons
</li>
<li>
<code>btn-lucky</code> and <code>lucky-slot-inner</code> handle
the lucky animation
</li>
</ul>
<h4><code>degoog-search-header</code></h4>
<ul>
<li><code>results-search-input</code> handles the search input</li>
<li><code>results-search-btn</code> handles the submit button</li>
<li>
<code>ac-dropdown-results</code> handles the autocomplete dropdown
</li>
<li>
<code>search-bar-actions-results</code> handles the action buttons
</li>
<li>
<code>.results-logo</code> is the required class for the logo link
</li>
</ul>
<h4><code>degoog-search-tabs</code></h4>
<ul>
<li>
<code>.results-tab[data-type]</code> is the class and attribute
for the tab buttons
</li>
<li><code>tools-bar</code> is the options wrapper</li>
<li><code>tools-toggle</code> is the dropdown toggle</li>
<li><code>tools-dropdown</code> is the dropdown menu</li>
<li>
<code>tools-submenu-time</code> and
<code>tools-submenu-lang</code> handle the filter submenus
</li>
<li>
<code>tools-time-val</code> and <code>tools-lang-val</code> handle
the active filter labels
</li>
<li>
<code>tools-lang-filter</code> and
<code>tools-lang-list</code> handle the language filter
</li>
<li>
<code>tools-date-from</code>, <code>tools-date-to</code>, and
<code>tools-date-apply</code> handle the custom date range
</li>
</ul>
<h4><code>degoog-result</code></h4>
<p>
The IDs inside this template are suffixed with the
<code>{{ index }}</code> placeholder. This represents the starting
position of the result from zero and ensures IDs stay unique across
the page. Make sure to keep the prefix intact when you override
this.
</p>
<ul>
<li>
<code>result-favicon-{N}</code> is the favicon image. It must also
carry <code>data-favicon-host="{{ favicon_host }}"</code> so
JavaScript can attach the fallback chain. During the final
fallback phase the <code><img></code> is smoothly replaced
with a
<code><span class="result-favicon-fallback"></code> element.
</li>
<li>
<code>result-actions-{N}</code> is the wrapper for per result
actions like block, replace, and score. This only renders when
<code>show_actions</code> is true.
</li>
<li>
<code>result-actions-toggle-{N}</code> is the button that opens
the menu. Its <code>aria-expanded</code> state is toggled by
JavaScript.
</li>
<li>
<code>result-actions-menu-{N}</code> is the popover containing the
action buttons. It is toggled using the
<code>hidden</code> attribute.
</li>
<li>
<code>result-action-block-{N}</code>,
<code>result-action-replace-{N}</code>, and
<code>result-action-score-{N}</code> are the individual menu
buttons. Each one only shows up if its matching
<code>action_block</code>, <code>action_replace</code>, or
<code>action_score</code> placeholder is active.
</li>
</ul>
<h4><code>degoog-search-media-preview</code></h4>
<ul>
<li>
<code>media-preview-close</code>, <code>media-preview-prev</code>,
and <code>media-preview-next</code> are the navigation buttons
</li>
<li><code>media-preview-img</code> is the main preview image</li>
<li><code>media-preview-info</code> is the sidebar info panel</li>
</ul>
<h4><code>degoog-search-lightbox</code></h4>
<ul>
<li><code>img-lightbox-bg</code> is the dark backdrop</li>
<li><code>img-lightbox-close</code> is the close button</li>
<li>
<code>img-lightbox-wrap</code> is the container for the image
</li>
<li>
<code>img-lightbox-img</code> is the full size image element
</li>
</ul>
<h2>Placeholder syntax</h2>
<p>
Inside your templates you can use double curly braces for dynamic
values. Every value gets HTML escaped automatically for security.
</p>
<table>
<thead>
<tr>
<th>Syntax</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>{{ name }}</code></td>
<td>Outputs a value</td>
</tr>
<tr>
<td><code>{{#if name}} content {{/if name}}</code></td>
<td>Conditional block that renders when the value is truthy</td>
</tr>
<tr>
<td><code>{{#each name}} content {{/each name}}</code></td>
<td>
Looping block where <code>{{ . }}</code> is the item and
<code>{{ @index }}</code> is the index
</td>
</tr>
</tbody>
</table>
<p>
Your <code>{{#if}}</code> blocks must contain balanced HTML.
Placeholders work perfectly in regular text and quoted attribute
values like <code>href="{{ url }}"</code>
but you cannot use them as HTML tag names.
</p>
<h3>Placeholders per template</h3>
<h4><code>degoog-result</code></h4>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>index</code></td>
<td>number</td>
<td>
The index starting at zero for this result. This is used to
suffix the required IDs in the template.
</td>
</tr>
<tr>
<td><code>title</code></td>
<td>string</td>
<td>The result title</td>
</tr>
<tr>
<td><code>url</code></td>
<td>string</td>
<td>The result URL</td>
</tr>
<tr>
<td><code>cite_url</code></td>
<td>string</td>
<td>The display URL showing the hostname and path</td>
</tr>
<tr>
<td><code>snippet</code></td>
<td>string</td>
<td>The text description</td>
</tr>
<tr>
<td><code>favicon_url</code></td>
<td>string</td>
<td>
The proxied favicon. This is just the first candidate before
the fallback chain runs in JavaScript.
</td>
</tr>
<tr>
<td><code>favicon_host</code></td>
<td>string</td>
<td>The hostname used by the favicon fallback chain</td>
</tr>
<tr>
<td><code>thumbnail_url</code></td>
<td>string</td>
<td>The proxied thumbnail which is empty if none exists</td>
</tr>
<tr>
<td><code>sources</code></td>
<td>array</td>
<td>The engine names</td>
</tr>
<tr>
<td><code>duration</code></td>
<td>string</td>
<td>The video duration which is empty for non video results</td>
</tr>
<tr>
<td><code>link_target</code></td>
<td>string</td>
<td>Either <code>_blank</code> or <code>_self</code></td>
</tr>
<tr>
<td><code>link_rel</code></td>
<td>string</td>
<td>Either <code>noopener</code> or completely empty</td>
</tr>
<tr>
<td><code>show_actions</code></td>
<td>boolean</td>
<td>
Returns true when the per result block, replace, or score menu
should render. This requires being authenticated on a private
instance with at least one action enabled in settings.
</td>
</tr>
<tr>
<td><code>action_block</code></td>
<td>boolean</td>
<td>Shows the block domain menu item</td>
</tr>
<tr>
<td><code>action_replace</code></td>
<td>boolean</td>
<td>Shows the replace domain menu item</td>
</tr>
<tr>
<td><code>action_score</code></td>
<td>boolean</td>
<td>Shows the score domain menu item</td>
</tr>
</tbody>
</table>
<h4><code>degoog-image-card</code></h4>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>title</code></td>
<td>string</td>
<td>The alt text</td>
</tr>
<tr>
<td><code>url</code></td>
<td>string</td>
<td>The source page URL</td>
</tr>
<tr>
<td><code>thumbnail_url</code></td>
<td>string</td>
<td>The proxied thumbnail</td>
</tr>
<tr>
<td><code>hostname</code></td>
<td>string</td>
<td>The source hostname</td>
</tr>
<tr>
<td><code>sources</code></td>
<td>array</td>
<td>The engine names</td>
</tr>
</tbody>
</table>
<h4><code>degoog-video-card</code></h4>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>title</code></td>
<td>string</td>
<td>The video title</td>
</tr>
<tr>
<td><code>url</code></td>