@quartz-community/tag-page 1.0.2 → 1.0.4

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/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { jsxs, jsx, Fragment } from 'preact/jsx-runtime';
2
+ import { h } from 'preact';
3
+
1
4
  var __create = Object.create;
2
5
  var __defProp = Object.defineProperty;
3
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -56,8 +59,8 @@ var require_cjs = __commonJS({
56
59
  function updatePosition(str) {
57
60
  var lines = str.match(NEWLINE_REGEX);
58
61
  if (lines) lineno += lines.length;
59
- var i2 = str.lastIndexOf(NEWLINE);
60
- column = ~i2 ? str.length - i2 : column + str.length;
62
+ var i = str.lastIndexOf(NEWLINE);
63
+ column = ~i ? str.length - i : column + str.length;
61
64
  }
62
65
  function position3() {
63
66
  var start2 = { line: lineno, column };
@@ -88,22 +91,22 @@ var require_cjs = __commonJS({
88
91
  }
89
92
  }
90
93
  function match(re2) {
91
- var m2 = re2.exec(style);
92
- if (!m2) return;
93
- var str = m2[0];
94
+ var m = re2.exec(style);
95
+ if (!m) return;
96
+ var str = m[0];
94
97
  updatePosition(str);
95
98
  style = style.slice(str.length);
96
- return m2;
99
+ return m;
97
100
  }
98
101
  function whitespace2() {
99
102
  match(WHITESPACE_REGEX);
100
103
  }
101
104
  function comments(rules) {
102
- var c2;
105
+ var c;
103
106
  rules = rules || [];
104
- while (c2 = comment()) {
105
- if (c2 !== false) {
106
- rules.push(c2);
107
+ while (c = comment()) {
108
+ if (c !== false) {
109
+ rules.push(c);
107
110
  }
108
111
  }
109
112
  return rules;
@@ -111,18 +114,18 @@ var require_cjs = __commonJS({
111
114
  function comment() {
112
115
  var pos = position3();
113
116
  if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
114
- var i2 = 2;
115
- while (EMPTY_STRING != style.charAt(i2) && (ASTERISK != style.charAt(i2) || FORWARD_SLASH != style.charAt(i2 + 1))) {
116
- ++i2;
117
+ var i = 2;
118
+ while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
119
+ ++i;
117
120
  }
118
- i2 += 2;
119
- if (EMPTY_STRING === style.charAt(i2 - 1)) {
121
+ i += 2;
122
+ if (EMPTY_STRING === style.charAt(i - 1)) {
120
123
  return error("End of comment missing");
121
124
  }
122
- var str = style.slice(2, i2 - 2);
125
+ var str = style.slice(2, i - 2);
123
126
  column += 2;
124
127
  updatePosition(str);
125
- style = style.slice(i2);
128
+ style = style.slice(i);
126
129
  column += 2;
127
130
  return pos({
128
131
  type: TYPE_COMMENT,
@@ -290,23 +293,23 @@ function joinSegments(...args) {
290
293
  }
291
294
  return joined;
292
295
  }
293
- function endsWith(s2, suffix) {
294
- return s2 === suffix || s2.endsWith("/" + suffix);
296
+ function endsWith(s, suffix) {
297
+ return s === suffix || s.endsWith("/" + suffix);
295
298
  }
296
- function trimSuffix(s2, suffix) {
297
- if (endsWith(s2, suffix)) {
298
- s2 = s2.slice(0, -suffix.length);
299
+ function trimSuffix(s, suffix) {
300
+ if (endsWith(s, suffix)) {
301
+ s = s.slice(0, -suffix.length);
299
302
  }
300
- return s2;
303
+ return s;
301
304
  }
302
- function stripSlashes(s2, onlyStripPrefix) {
303
- if (s2.startsWith("/")) {
304
- s2 = s2.substring(1);
305
+ function stripSlashes(s, onlyStripPrefix) {
306
+ if (s.startsWith("/")) {
307
+ s = s.substring(1);
305
308
  }
306
- if (!onlyStripPrefix && s2.endsWith("/")) {
307
- s2 = s2.slice(0, -1);
309
+ if (!onlyStripPrefix && s.endsWith("/")) {
310
+ s = s.slice(0, -1);
308
311
  }
309
- return s2;
312
+ return s;
310
313
  }
311
314
  function isFolderPath(fplike) {
312
315
  return fplike.endsWith("/") || endsWith(fplike, "index") || endsWith(fplike, "index.md") || endsWith(fplike, "index.html");
@@ -314,13 +317,13 @@ function isFolderPath(fplike) {
314
317
  function getAllSegmentPrefixes(path) {
315
318
  const segments = path.split("/");
316
319
  const results = [];
317
- for (let i2 = 0; i2 < segments.length; i2++) {
318
- results.push(segments.slice(0, i2 + 1).join("/"));
320
+ for (let i = 0; i < segments.length; i++) {
321
+ results.push(segments.slice(0, i + 1).join("/"));
319
322
  }
320
323
  return results;
321
324
  }
322
325
  function pathToRoot(slug2) {
323
- let rootPath = slug2.split("/").filter((x2) => x2 !== "").slice(0, -1).map((_2) => "..").join("/");
326
+ let rootPath = slug2.split("/").filter((x) => x !== "").slice(0, -1).map((_) => "..").join("/");
324
327
  if (rootPath.length === 0) {
325
328
  rootPath = ".";
326
329
  }
@@ -330,66 +333,26 @@ function resolveRelative(current, target) {
330
333
  const res = joinSegments(pathToRoot(current), simplifySlug(target));
331
334
  return res;
332
335
  }
333
-
334
- // node_modules/preact/dist/preact.mjs
335
- var n;
336
- var l;
337
- var u;
338
- var w = [];
339
- function k(l2, u3, t2) {
340
- var i2, r2, o2, e2 = {};
341
- for (o2 in u3) "key" == o2 ? i2 = u3[o2] : "ref" == o2 ? r2 = u3[o2] : e2[o2] = u3[o2];
342
- if (arguments.length > 2 && (e2.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps) for (o2 in l2.defaultProps) void 0 === e2[o2] && (e2[o2] = l2.defaultProps[o2]);
343
- return x(l2, e2, i2, r2, null);
344
- }
345
- function x(n2, t2, i2, r2, o2) {
346
- var e2 = { type: n2, props: t2, key: i2, ref: r2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: null == o2 ? ++u : o2, __i: -1, __u: 0 };
347
- return null != l.vnode && l.vnode(e2), e2;
348
- }
349
- function S(n2) {
350
- return n2.children;
351
- }
352
- n = w.slice, l = { __e: function(n2, l2, u3, t2) {
353
- for (var i2, r2, o2; l2 = l2.__; ) if ((i2 = l2.__c) && !i2.__) try {
354
- if ((r2 = i2.constructor) && null != r2.getDerivedStateFromError && (i2.setState(r2.getDerivedStateFromError(n2)), o2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), o2 = i2.__d), o2) return i2.__E = i2;
355
- } catch (l3) {
356
- n2 = l3;
357
- }
358
- throw n2;
359
- } }, u = 0, "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Math.random().toString(8);
360
-
361
- // node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs
362
- var f2 = 0;
363
- function u2(e2, t2, n2, o2, i2, u3) {
364
- t2 || (t2 = {});
365
- var a2, c2, p2 = t2;
366
- if ("ref" in p2) for (c2 in p2 = {}, t2) "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
367
- var l2 = { type: e2, props: p2, key: n2, ref: a2, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --f2, __i: -1, __u: 0, __source: i2, __self: u3 };
368
- if ("function" == typeof e2 && (a2 = e2.defaultProps)) for (c2 in a2) void 0 === p2[c2] && (p2[c2] = a2[c2]);
369
- return l.vnode && l.vnode(l2), l2;
370
- }
371
-
372
- // src/components/PageList.tsx
373
336
  function byDateAndAlphabeticalFolderFirst(_cfg) {
374
- return (f1, f22) => {
337
+ return (f1, f2) => {
375
338
  const f1IsFolder = isFolderPath(f1.slug ?? "");
376
- const f2IsFolder = isFolderPath(f22.slug ?? "");
339
+ const f2IsFolder = isFolderPath(f2.slug ?? "");
377
340
  if (f1IsFolder && !f2IsFolder) return -1;
378
341
  if (!f1IsFolder && f2IsFolder) return 1;
379
- if (f1.dates && f22.dates) {
380
- return (getDate(f22)?.getTime() ?? 0) - (getDate(f1)?.getTime() ?? 0);
381
- } else if (f1.dates && !f22.dates) {
342
+ if (f1.dates && f2.dates) {
343
+ return (getDate(f2)?.getTime() ?? 0) - (getDate(f1)?.getTime() ?? 0);
344
+ } else if (f1.dates && !f2.dates) {
382
345
  return -1;
383
- } else if (!f1.dates && f22.dates) {
346
+ } else if (!f1.dates && f2.dates) {
384
347
  return 1;
385
348
  }
386
349
  const f1Title = f1.frontmatter?.title?.toLowerCase() ?? "";
387
- const f2Title = f22.frontmatter?.title?.toLowerCase() ?? "";
350
+ const f2Title = f2.frontmatter?.title?.toLowerCase() ?? "";
388
351
  return f1Title.localeCompare(f2Title);
389
352
  };
390
353
  }
391
354
  function DateDisplay({ date, locale }) {
392
- return /* @__PURE__ */ u2("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
355
+ return /* @__PURE__ */ jsx("time", { dateTime: date.toISOString(), children: date.toLocaleDateString(locale, {
393
356
  year: "numeric",
394
357
  month: "short",
395
358
  day: "2-digit"
@@ -408,18 +371,18 @@ var PageList = ({
408
371
  list = list.slice(0, limit);
409
372
  }
410
373
  const fileSlug = fileData?.slug;
411
- return /* @__PURE__ */ u2("ul", { class: "section-ul", children: list.map((page) => {
374
+ return /* @__PURE__ */ jsx("ul", { class: "section-ul", children: list.map((page) => {
412
375
  const title = page.frontmatter?.title;
413
376
  const tags = page.frontmatter?.tags ?? [];
414
- return /* @__PURE__ */ u2("li", { class: "section-li", children: /* @__PURE__ */ u2("div", { class: "section", children: [
415
- /* @__PURE__ */ u2("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ u2(
377
+ return /* @__PURE__ */ jsx("li", { class: "section-li", children: /* @__PURE__ */ jsxs("div", { class: "section", children: [
378
+ /* @__PURE__ */ jsx("p", { class: "meta", children: page.dates && getDate(page) && /* @__PURE__ */ jsx(
416
379
  DateDisplay,
417
380
  {
418
381
  date: getDate(page),
419
382
  locale: cfg?.locale ?? "en-US"
420
383
  }
421
384
  ) }),
422
- /* @__PURE__ */ u2("div", { class: "desc", children: /* @__PURE__ */ u2("h3", { children: /* @__PURE__ */ u2(
385
+ /* @__PURE__ */ jsx("div", { class: "desc", children: /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(
423
386
  "a",
424
387
  {
425
388
  href: resolveRelative(fileSlug ?? "", page.slug),
@@ -427,7 +390,7 @@ var PageList = ({
427
390
  children: title
428
391
  }
429
392
  ) }) }),
430
- /* @__PURE__ */ u2("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ u2("li", { children: /* @__PURE__ */ u2(
393
+ /* @__PURE__ */ jsx("ul", { class: "tags", children: tags.map((tag) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
431
394
  "a",
432
395
  {
433
396
  class: "internal tag-link",
@@ -686,7 +649,7 @@ var aria = create({
686
649
  ariaValueText: null,
687
650
  role: null
688
651
  },
689
- transform(_2, property) {
652
+ transform(_, property) {
690
653
  return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
691
654
  }
692
655
  });
@@ -1651,7 +1614,7 @@ var xlink = create({
1651
1614
  xLinkType: null
1652
1615
  },
1653
1616
  space: "xlink",
1654
- transform(_2, property) {
1617
+ transform(_, property) {
1655
1618
  return "xlink:" + property.slice(5).toLowerCase();
1656
1619
  }
1657
1620
  });
@@ -1668,7 +1631,7 @@ var xmlns = create({
1668
1631
  var xml = create({
1669
1632
  properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
1670
1633
  space: "xml",
1671
- transform(_2, property) {
1634
+ transform(_, property) {
1672
1635
  return "xml:" + property.slice(3).toLowerCase();
1673
1636
  }
1674
1637
  });
@@ -2058,7 +2021,7 @@ function root(state, node, key) {
2058
2021
  addChildren(props, createChildren(state, node));
2059
2022
  return state.create(node, state.Fragment, props, key);
2060
2023
  }
2061
- function text(_2, node) {
2024
+ function text(_, node) {
2062
2025
  return node.value;
2063
2026
  }
2064
2027
  function addNode(state, props, type, node) {
@@ -2074,11 +2037,11 @@ function addChildren(props, children) {
2074
2037
  }
2075
2038
  }
2076
2039
  }
2077
- function productionCreate(_2, jsx, jsxs) {
2040
+ function productionCreate(_, jsx4, jsxs4) {
2078
2041
  return create2;
2079
- function create2(_3, type, props, key) {
2042
+ function create2(_2, type, props, key) {
2080
2043
  const isStaticChildren = Array.isArray(props.children);
2081
- const fn = isStaticChildren ? jsxs : jsx;
2044
+ const fn = isStaticChildren ? jsxs4 : jsx4;
2082
2045
  return key ? fn(type, props, key) : fn(type, props);
2083
2046
  }
2084
2047
  }
@@ -2295,23 +2258,21 @@ function transformStyleToCssCasing(from) {
2295
2258
  function toDash($0) {
2296
2259
  return "-" + $0.toLowerCase();
2297
2260
  }
2298
-
2299
- // node_modules/@quartz-community/utils/dist/jsx.js
2300
2261
  function childrenToString(children) {
2301
2262
  if (typeof children === "string") return children;
2302
2263
  if (Array.isArray(children)) return children.map(childrenToString).join("");
2303
2264
  return String(children ?? "");
2304
2265
  }
2305
2266
  var builtinComponents = {
2306
- table: (props) => /* @__PURE__ */ u2("div", { class: "table-container", children: /* @__PURE__ */ u2("table", { ...props }) }),
2307
- style: ({ children, ...rest }) => k("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
2308
- script: ({ children, ...rest }) => k("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
2267
+ table: (props) => /* @__PURE__ */ jsx("div", { class: "table-container", children: /* @__PURE__ */ jsx("table", { ...props }) }),
2268
+ style: ({ children, ...rest }) => h("style", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } }),
2269
+ script: ({ children, ...rest }) => h("script", { ...rest, dangerouslySetInnerHTML: { __html: childrenToString(children) } })
2309
2270
  };
2310
2271
  function htmlToJsx(tree, components) {
2311
2272
  return toJsxRuntime(tree, {
2312
- Fragment: S,
2313
- jsx: u2,
2314
- jsxs: u2,
2273
+ Fragment,
2274
+ jsx: jsx,
2275
+ jsxs: jsxs,
2315
2276
  elementAttributeNameCase: "html",
2316
2277
  components: { ...builtinComponents, ...components }
2317
2278
  });
@@ -2785,8 +2746,8 @@ function i18n(locale) {
2785
2746
  // src/util/tags.ts
2786
2747
  function hasChildTags(tag, allTags) {
2787
2748
  const prefix = `${tag}/`;
2788
- for (const t2 of allTags) {
2789
- if (t2.startsWith(prefix)) return true;
2749
+ for (const t of allTags) {
2750
+ if (t.startsWith(prefix)) return true;
2790
2751
  }
2791
2752
  return false;
2792
2753
  }
@@ -2797,13 +2758,11 @@ function tagPageSlug(tag, allTags) {
2797
2758
 
2798
2759
  // src/components/styles/listPage.scss
2799
2760
  var listPage_default = "ul.section-ul {\n list-style: none;\n margin-top: 2em;\n padding-left: 0;\n}\n\nli.section-li {\n margin-bottom: 1em;\n}\nli.section-li > .section {\n display: grid;\n grid-template-columns: fit-content(8em) 3fr 1fr;\n}\n@media all and (max-width: 600px) {\n li.section-li > .section > .tags {\n display: none;\n }\n}\nli.section-li > .section > .desc > h3 > a {\n background-color: transparent;\n}\nli.section-li > .section .meta {\n margin: 0 1em 0 0;\n opacity: 0.6;\n}\n\n.popover .section {\n grid-template-columns: fit-content(8em) 1fr !important;\n}\n.popover .section > .tags {\n display: none;\n}";
2800
-
2801
- // src/components/TagContent.tsx
2802
2761
  var defaultOptions = {
2803
2762
  numPages: 10
2804
2763
  };
2805
2764
  function concatenateResources(...resources) {
2806
- const result = resources.filter((r2) => r2 !== void 0).flat();
2765
+ const result = resources.filter((r) => r !== void 0).flat();
2807
2766
  return result.length === 0 ? void 0 : result;
2808
2767
  }
2809
2768
  function isListed(file) {
@@ -2821,8 +2780,8 @@ var TagContent_default = ((opts) => {
2821
2780
  }
2822
2781
  let tag = simplifySlug(slug.slice("tags/".length));
2823
2782
  if (tag !== "/" && tag.endsWith("/")) tag = tag.slice(0, -1);
2824
- const allPagesWithTag = (t2) => allFiles.filter(isListed).filter(
2825
- (file) => (file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(t2)
2783
+ const allPagesWithTag = (t) => allFiles.filter(isListed).filter(
2784
+ (file) => (file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(t)
2826
2785
  );
2827
2786
  const hastRoot = tree;
2828
2787
  const content = hastRoot.children.length === 0 ? fd.description : htmlToJsx(hastRoot);
@@ -2833,16 +2792,16 @@ var TagContent_default = ((opts) => {
2833
2792
  ...new Set(
2834
2793
  allFiles.filter(isListed).flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes)
2835
2794
  )
2836
- ].sort((a2, b2) => a2.localeCompare(b2));
2795
+ ].sort((a, b) => a.localeCompare(b));
2837
2796
  const tagItemMap = /* @__PURE__ */ new Map();
2838
- for (const t2 of tags) {
2839
- tagItemMap.set(t2, allPagesWithTag(t2));
2797
+ for (const t of tags) {
2798
+ tagItemMap.set(t, allPagesWithTag(t));
2840
2799
  }
2841
- return /* @__PURE__ */ u2("div", { class: "popover-hint", children: [
2842
- /* @__PURE__ */ u2("article", { class: classes, children: /* @__PURE__ */ u2("div", { class: "markdown-preview-view markdown-rendered", children: /* @__PURE__ */ u2("p", { children: content }) }) }),
2843
- /* @__PURE__ */ u2("p", { children: i18n(locale).pages.tagContent.totalTags({ count: tags.length }) }),
2844
- /* @__PURE__ */ u2("div", { children: tags.map((t2) => {
2845
- const pages = tagItemMap.get(t2);
2800
+ return /* @__PURE__ */ jsxs("div", { class: "popover-hint", children: [
2801
+ /* @__PURE__ */ jsx("article", { class: classes, children: /* @__PURE__ */ jsx("div", { class: "markdown-preview-view markdown-rendered", children: /* @__PURE__ */ jsx("p", { children: content }) }) }),
2802
+ /* @__PURE__ */ jsx("p", { children: i18n(locale).pages.tagContent.totalTags({ count: tags.length }) }),
2803
+ /* @__PURE__ */ jsx("div", { children: tags.map((t) => {
2804
+ const pages = tagItemMap.get(t);
2846
2805
  const listProps = {
2847
2806
  ...props,
2848
2807
  allFiles: pages
@@ -2853,21 +2812,21 @@ var TagContent_default = ((opts) => {
2853
2812
  sort: options?.sort
2854
2813
  });
2855
2814
  const contentPage = allFiles.find(
2856
- (file) => file.slug === `tags/${t2}` || file.slug === `tags/${t2}/index`
2815
+ (file) => file.slug === `tags/${t}` || file.slug === `tags/${t}/index`
2857
2816
  );
2858
2817
  const root2 = contentPage?.filePath ? contentPage?.htmlAst : void 0;
2859
2818
  const tagDesc = !root2 || root2.children.length === 0 ? contentPage?.description : htmlToJsx(root2);
2860
- const tagListingPage = contentPage?.slug ?? tagPageSlug(t2, tags);
2819
+ const tagListingPage = contentPage?.slug ?? tagPageSlug(t, tags);
2861
2820
  const href = resolveRelative(slug, tagListingPage);
2862
- return /* @__PURE__ */ u2("div", { children: [
2863
- /* @__PURE__ */ u2("h2", { children: /* @__PURE__ */ u2("a", { class: "internal tag-link", href, children: t2 }) }),
2864
- tagDesc && /* @__PURE__ */ u2("p", { children: tagDesc }),
2865
- /* @__PURE__ */ u2("div", { class: "page-listing", children: [
2866
- /* @__PURE__ */ u2("p", { children: [
2821
+ return /* @__PURE__ */ jsxs("div", { children: [
2822
+ /* @__PURE__ */ jsx("h2", { children: /* @__PURE__ */ jsx("a", { class: "internal tag-link", href, children: t }) }),
2823
+ tagDesc && /* @__PURE__ */ jsx("p", { children: tagDesc }),
2824
+ /* @__PURE__ */ jsxs("div", { class: "page-listing", children: [
2825
+ /* @__PURE__ */ jsxs("p", { children: [
2867
2826
  i18n(locale).pages.tagContent.itemsUnderTag({ count: pages.length }),
2868
- pages.length > options.numPages && /* @__PURE__ */ u2(S, { children: [
2827
+ pages.length > options.numPages && /* @__PURE__ */ jsxs(Fragment, { children: [
2869
2828
  " ",
2870
- /* @__PURE__ */ u2("span", { children: i18n(locale).pages.tagContent.showingFirst({
2829
+ /* @__PURE__ */ jsx("span", { children: i18n(locale).pages.tagContent.showingFirst({
2871
2830
  count: options.numPages
2872
2831
  }) })
2873
2832
  ] })
@@ -2887,11 +2846,11 @@ var TagContent_default = ((opts) => {
2887
2846
  ...listProps,
2888
2847
  sort: options?.sort
2889
2848
  });
2890
- return /* @__PURE__ */ u2("div", { class: "popover-hint", children: [
2891
- /* @__PURE__ */ u2("article", { class: classes, children: /* @__PURE__ */ u2("div", { class: "markdown-preview-view markdown-rendered", children: content }) }),
2892
- /* @__PURE__ */ u2("div", { class: "page-listing", children: [
2893
- /* @__PURE__ */ u2("p", { children: i18n(locale).pages.tagContent.itemsUnderTag({ count: pages.length }) }),
2894
- /* @__PURE__ */ u2("div", { children: pageListContent })
2849
+ return /* @__PURE__ */ jsxs("div", { class: "popover-hint", children: [
2850
+ /* @__PURE__ */ jsx("article", { class: classes, children: /* @__PURE__ */ jsx("div", { class: "markdown-preview-view markdown-rendered", children: content }) }),
2851
+ /* @__PURE__ */ jsxs("div", { class: "page-listing", children: [
2852
+ /* @__PURE__ */ jsx("p", { children: i18n(locale).pages.tagContent.itemsUnderTag({ count: pages.length }) }),
2853
+ /* @__PURE__ */ jsx("div", { children: pageListContent })
2895
2854
  ] })
2896
2855
  ] });
2897
2856
  }
@@ -2909,7 +2868,7 @@ var TagPage = (opts) => ({
2909
2868
  priority: 10,
2910
2869
  match: tagMatcher,
2911
2870
  generate({ content, cfg }) {
2912
- const allFiles = content.map((c2) => c2[1].data).filter((d2) => d2?.unlisted !== true);
2871
+ const allFiles = content.map((c) => c[1].data).filter((d) => d?.unlisted !== true);
2913
2872
  const locale = cfg?.locale ?? "en-US";
2914
2873
  const tags = new Set(
2915
2874
  allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes)
@@ -2938,7 +2897,9 @@ var TagPage = (opts) => ({
2938
2897
  return virtualPages;
2939
2898
  },
2940
2899
  layout: "tag",
2941
- body: TagContent_default
2900
+ // Quartz calls body(undefined): pass this plugin's options through, or numPages and sort
2901
+ // never reach the tag listing
2902
+ body: () => TagContent_default(opts)
2942
2903
  });
2943
2904
 
2944
2905
  export { TagContent_default as TagContent, TagPage };