hd-garden 0.5.13 → 0.5.15
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/app/a2/page.tsx +2 -1
- package/app/about/page.tsx +2 -1
- package/app/columns/[column]/[...path]/page.tsx +2 -1
- package/app/components/ArticleTags.tsx +6 -3
- package/app/components/BlogArchive.tsx +3 -2
- package/app/components/ContentEmptyState.tsx +2 -1
- package/app/components/MarkdownArticle.tsx +40 -3
- package/app/components/SiteHeader.tsx +18 -15
- package/app/components/TagRedirect.tsx +4 -3
- package/app/components/ThoughtCard.tsx +3 -2
- package/app/components/garden/FilePreview.tsx +176 -0
- package/app/components/garden/GardenBlock.tsx +4 -0
- package/app/components/garden/GardenFile.tsx +69 -0
- package/app/components/garden/file-icons.tsx +49 -0
- package/app/garden-modules.d.ts +1 -1
- package/app/layout.tsx +3 -0
- package/app/lib/content.ts +5 -3
- package/app/lib/markdown-plugins.ts +2 -11
- package/app/lib/site-href.ts +9 -0
- package/app/lib/tag-filter.ts +8 -0
- package/app/page.tsx +5 -4
- package/app/rss.xml/route.ts +6 -3
- package/app/sitemap.ts +4 -3
- package/app/styles/a2.css +72 -0
- package/app/styles/shell.css +21 -2
- package/app/tags/page.tsx +3 -2
- package/app/thoughts/[slug]/page.tsx +4 -3
- package/bin/garden.mjs +10 -2
- package/next.config.ts +3 -1
- package/package.json +3 -1
- package/scripts/build-content.mjs +110 -10
- package/scripts/check-post.mjs +45 -0
- package/scripts/file-preview.mjs +138 -0
- package/scripts/file-sizes.mjs +146 -0
- package/scripts/prepare-pages-output.mjs +7 -1
- package/scripts/redirects.mjs +80 -55
- package/templates/garden-blocks.md +11 -0
- package/templates/garden-snippets.plist +9 -0
- package/ui/core/transform.mjs +18 -0
- package/ui/garden/catalog.mjs +15 -1
- package/ui/garden/check.mjs +12 -0
- package/ui/garden/file-block.mjs +232 -0
- package/ui/garden/file-paths.mjs +65 -0
- package/ui/garden/hash-jump.mjs +37 -0
- package/ui/garden/internal-links.mjs +113 -0
- package/ui/garden/markdown-syntax.mjs +12 -0
- package/ui/garden/parse.mjs +1 -1
- package/ui/garden/same-site.mjs +27 -0
- package/ui/garden/site-href.mjs +62 -0
- package/ui/garden/site-nav.mjs +25 -0
- package/ui/garden/snippets.mjs +2 -2
- package/ui/garden/word-count.mjs +5 -0
- package/ui/preview/dist/garden-ui.esm.js +33 -33
- package/ui/preview/dist/garden-ui.iife.js +32 -32
package/ui/garden/word-count.mjs
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
import katex from "katex";
|
|
37
37
|
import { Marked } from "marked";
|
|
38
38
|
import { parse as parseYaml } from "yaml";
|
|
39
|
+
import { fileSearchText } from "./file-block.mjs";
|
|
39
40
|
|
|
40
41
|
const marked = new Marked({
|
|
41
42
|
gfm: true,
|
|
@@ -156,6 +157,10 @@ function gardenHtml(info, body) {
|
|
|
156
157
|
if (!children.trim() || isHtmlDocument(document)) return sandboxHtml(title, document);
|
|
157
158
|
return document;
|
|
158
159
|
}
|
|
160
|
+
if (name === "file") {
|
|
161
|
+
// Only what the card shows: titles and notes, not the previewed document.
|
|
162
|
+
return `<p>${escapeHtml(fileSearchText(readYaml(yamlText) ?? {}))}</p>`;
|
|
163
|
+
}
|
|
159
164
|
if (name === "figure") {
|
|
160
165
|
const data = readYaml(yamlText);
|
|
161
166
|
if (!data) return `<pre class="code"><code>${escapeHtml(body)}</code></pre>`;
|