fix: guard against undefined getDate in PageList

This commit is contained in:
saberzero1 2026-04-03 16:01:03 +02:00
parent a4d0b92a1a
commit c43e090698
No known key found for this signature in database
5 changed files with 5 additions and 5 deletions

View file

@ -84,7 +84,7 @@ var PageList = ({
const title = page.frontmatter?.title;
const tags = page.frontmatter?.tags ?? [];
return /* @__PURE__ */ jsx("li", { class: "section-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
/* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && /* @__PURE__ */ jsx(
/* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ jsx(
DateDisplay,
{
date: getDate(page),

File diff suppressed because one or more lines are too long

2
dist/index.js vendored
View file

@ -84,7 +84,7 @@ var PageList = ({
const title = page.frontmatter?.title;
const tags = page.frontmatter?.tags ?? [];
return /* @__PURE__ */ jsx("li", { class: "section-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
/* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && /* @__PURE__ */ jsx(
/* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ jsx(
DateDisplay,
{
date: getDate(page),

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -89,7 +89,7 @@ export const PageList: QuartzComponent = ({
<li class="section-li">
<div class="section">
<p class="meta">
{page.dates && (
{page.dates && getDate(page) && (
<DateDisplay
date={getDate(page)!}
locale={(cfg as { locale?: string } | undefined)?.locale ?? "en-US"}