@abreen/tada 1.7.1 → 1.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abreen/tada",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "type": "module",
5
5
  "description": "A static site generator",
6
6
  "license": "MIT",
package/src/_base.scss CHANGED
@@ -99,6 +99,7 @@ code {
99
99
  pre {
100
100
  background: var(--bg2-color);
101
101
  border-radius: var(--mono-border-radius);
102
+ font-size: var(--mono-font-size);
102
103
  line-height: var(--mono-line-height);
103
104
  overflow-x: auto;
104
105
  overflow-y: hidden;
@@ -34,7 +34,6 @@ body.literate .literate-code-output {
34
34
  display: grid;
35
35
  grid-template-columns: 1fr;
36
36
  gap: var(--gap);
37
- font-size: var(--mono-font-size);
38
37
 
39
38
  > pre {
40
39
  margin-top: 0;
@@ -11,7 +11,7 @@ interface PagefindSubResult {
11
11
  }
12
12
 
13
13
  interface PagefindResult {
14
- meta?: { title?: string; page?: string };
14
+ meta?: { title?: string; page?: string; template?: string };
15
15
  url: string;
16
16
  excerpt?: string;
17
17
  score: number;
@@ -79,6 +79,7 @@ async function doSearch(state: State) {
79
79
  score: d.score ?? 0,
80
80
  subResults,
81
81
  pageNumber: getPdfPageNumber(d.url, d.meta?.page),
82
+ template: d.meta?.template ?? null,
82
83
  };
83
84
  });
84
85
 
@@ -139,14 +140,15 @@ function render(
139
140
  const titleEl = doc.createElement('div');
140
141
  titleEl.id = `title-${i}`;
141
142
  titleEl.className = 'title';
142
- titleEl.textContent = result.title;
143
+ if (result.template === 'code') {
144
+ const code = doc.createElement('code');
145
+ code.textContent = result.title;
146
+ titleEl.appendChild(code);
147
+ } else {
148
+ titleEl.textContent = result.title;
149
+ }
143
150
  a.appendChild(titleEl);
144
151
 
145
- const subtitle = doc.createElement('div');
146
- subtitle.className = 'subtitle';
147
- subtitle.innerText = result.url;
148
- a.appendChild(subtitle);
149
-
150
152
  const excerpt = doc.createElement('div');
151
153
  excerpt.className = 'excerpt';
152
154
  excerpt.innerHTML = result.excerpt;
@@ -6,6 +6,7 @@ export type Result = {
6
6
  score: number;
7
7
  subResults: SubResult[];
8
8
  pageNumber: number | null;
9
+ template: string | null;
9
10
  };
10
11
 
11
12
  export function getPdfPageNumber(
@@ -71,6 +72,7 @@ export function groupPdfResults(results: Result[]): Result[] {
71
72
  score: primary.score,
72
73
  subResults,
73
74
  pageNumber: null,
75
+ template: null,
74
76
  });
75
77
  });
76
78
 
@@ -127,15 +127,11 @@ header {
127
127
 
128
128
  ol a .title {
129
129
  font-weight: 500;
130
- }
131
130
 
132
- ol li .subtitle {
133
- font-family: var(--mono-font);
134
- font-size: var(--font-size-small);
135
- color: var(--fg2-color);
136
- white-space: nowrap;
137
- overflow: hidden;
138
- text-overflow: ellipsis;
131
+ code {
132
+ background: none;
133
+ padding: 0;
134
+ }
139
135
  }
140
136
 
141
137
  ol li .excerpt {
@@ -54,7 +54,7 @@
54
54
  </style></noscript>
55
55
  </head>
56
56
 
57
- <body class="<%= page.template %><% if (page.tocHtml) { %> toc-is-active<% } %>">
57
+ <body class="<%= page.template %><% if (page.tocHtml) { %> toc-is-active<% } %>" data-pagefind-meta="template:<%= page.template %>">
58
58
  <header data-pagefind-ignore>
59
59
  <div class="header-controls">
60
60
  <div id="to-top-container" class="to-top-container"></div>