We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd736d1 commit 29c2094Copy full SHA for 29c2094
src/project/types/website/website-search.ts
@@ -187,7 +187,21 @@ export async function updateSearchIndex(
187
const doc = new DOMParser().parseFromString(contents, "text/html")!;
188
189
// determine title
190
- const titleEl = doc.querySelector("h1.title");
+ const findTitle = () => {
191
+ const titleEl = doc.querySelector("h1.title");
192
+ if (titleEl) {
193
+ return titleEl;
194
+ } else {
195
+ const title = doc.querySelector("main h1");
196
+ if (title) {
197
+ return title;
198
199
+ return undefined;
200
+ }
201
202
+ };
203
+
204
+ const titleEl = findTitle();
205
const title = titleEl
206
? titleEl.textContent
207
: (websiteTitle(context.config) || "");
0 commit comments