|
10 | 10 | <link rel="manifest" href="{{manifest}}">
|
11 | 11 | {{/if}}
|
12 | 12 | <link rel="stylesheet" href="{{static_path 'sqlpage.css'}}">
|
13 |
| - {{#each (to_array css)}} |
| 13 | + {{#each (to_array css)}} |
14 | 14 | {{#if this}}
|
15 | 15 | <link rel="stylesheet" href="{{this}}">
|
16 | 16 | {{/if}}
|
17 |
| - {{/each}} |
| 17 | + {{/each}} |
| 18 | + |
| 19 | + {{#if font_custom}} |
| 20 | + <style> |
| 21 | + {{#each font_custom}} |
| 22 | + {{#if (startsWith this "/")}} |
| 23 | + @font-face { |
| 24 | + font-family: '{{this}}_custom'; |
| 25 | + src: url('{{this}}.woff2') format('woff2'), |
| 26 | + url('{{this}}.woff') format('woff'), |
| 27 | + url('{{this}}.ttf') format('truetype'), |
| 28 | + url('{{this}}.otf') format('opentype'), |
| 29 | + url('{{this}}.eot') format('embedded-opentype'), |
| 30 | + url('{{this}}.svg#{{this}}_custom') format('svg'); |
| 31 | + } |
| 32 | + {{/if}} |
| 33 | + {{/each}} |
| 34 | + </style> |
| 35 | + |
| 36 | + {{!-- Handling Google Fonts --}} |
| 37 | + {{#each (filter font_custom (lambda font (not (startsWith font "/"))))}} |
| 38 | + <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 39 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 40 | + <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family={{this}}&display=fallback"> |
| 41 | + {{/each}} |
18 | 42 |
|
19 |
| - {{#if font}} |
20 |
| - <link rel="preconnect" href="https://fonts.googleapis.com"> |
21 |
| - <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
22 |
| - <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family={{font}}&display=fallback"> |
23 |
| - <style>:root { --tblr-font-sans-serif: '{{font}}', Arial, sans;}</style> |
| 43 | + <style> |
| 44 | + :root { |
| 45 | + {{#each font_custom}} |
| 46 | + {{!-- Local fonts will have _custom appended to their names --}} |
| 47 | + {{#if (startsWith this "/")}} |
| 48 | + --tblr-font-{{replace this "/" "-"}}: '{{this}}_custom', Arial, sans; |
| 49 | + {{else}} |
| 50 | + --tblr-font-{{replace this " " "-"}}: '{{this}}', Arial, sans; |
| 51 | + {{/if}} |
| 52 | + {{/each}} |
| 53 | + } |
| 54 | + </style> |
24 | 55 | {{/if}}
|
25 | 56 |
|
26 | 57 | <script src="{{static_path 'sqlpage.js'}}" defer></script>
|
|
0 commit comments