diff --git a/TASK.md b/TASK.md index 7e0758f..f74c610 100644 --- a/TASK.md +++ b/TASK.md @@ -7,10 +7,16 @@ ## Current Status -v2.2.0 ready. Footer content via markdown page complete. Created `content/pages/footer.md` for managing footer content via markdown sync. Footer content syncs with `npm run sync` without redeploy needed. Falls back to `siteConfig.footer.defaultContent` when page not found. Documentation updated in files.md, changelog.md, changelog-page.md, FORK_CONFIG.md, docs.md, setup-guide.md, and TASK.md. +v2.2.1 ready. ES module compatibility fix for configure-fork.ts. Fixed `__dirname is not defined` error when running `npm run configure`. Added `fileURLToPath` import to create ES module equivalent of `__dirname`. Script now works correctly with `"type": "module"` in package.json. ## Completed +- [x] ES module compatibility fix for configure-fork.ts + - [x] Fixed `__dirname is not defined` error when running `npm run configure` + - [x] Added `fileURLToPath` import from `url` module + - [x] Created ES module equivalent of `__dirname` using `import.meta.url` + - [x] Updated files.md, changelog.md, changelog-page.md, TASK.md + - [x] Footer content via markdown page (footer.md) - [x] Created `content/pages/footer.md` for managing footer content via markdown sync - [x] Footer content syncs with `npm run sync` without redeploy needed diff --git a/changelog.md b/changelog.md index 61359fb..c9d07f3 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [2.2.1] - 2025-12-31 + +### Fixed + +- ES module compatibility for configure-fork.ts + - Fixed `__dirname is not defined` error when running `npm run configure` + - Added `fileURLToPath` import from `url` module + - Created ES module equivalent of `__dirname` using `import.meta.url` + - Script now works correctly with `"type": "module"` in package.json + +### Technical + +- Updated: `scripts/configure-fork.ts` - Added ES module compatible __dirname using fileURLToPath + ## [2.2.0] - 2025-12-30 ### Added diff --git a/content/blog/markdown-with-code-examples.md b/content/blog/markdown-with-code-examples.md index ade8472..d8b644d 100644 --- a/content/blog/markdown-with-code-examples.md +++ b/content/blog/markdown-with-code-examples.md @@ -605,3 +605,113 @@ Indent code blocks with 4 spaces inside list items: | `![alt](image.png)` | image | | `> quote` | blockquote | | `---` | horizontal rule | + +## Image grid + +Create a grid layout using HTML and CSS Grid. Each cell contains an image, text, and a link: + +```html +
+
+ +

Nature

+ View +
+ +
+``` + +Result: + +
+
+ +

Nature

+ View +
+
+ +

Mountains

+ View +
+
+ +

Ocean

+ View +
+
+ +

Forest

+ View +
+
+ +

Landscape

+ View +
+
+ +

Desert

+ View +
+
+ +

Sky

+ View +
+
+ +

Sunset

+ View +
+
+ +

Beach

+ View +
+
+ +

River

+ View +
+
+ +

Valley

+ View +
+
+ +

Flowers

+ View +
+
+ +

Lake

+ View +
+
+ +

Meadow

+ View +
+
+ +

Waterfall

+ View +
+
+ +

Sunrise

+ View +
+
+ +**Note:** The grid uses CSS Grid with `repeat(4, 1fr)` to create 4 equal columns. Images have empty `alt` attributes so no captions appear. Adjust the `gap` value to change spacing between cells. diff --git a/content/pages/changelog-page.md b/content/pages/changelog-page.md index ba53175..95070e4 100644 --- a/content/pages/changelog-page.md +++ b/content/pages/changelog-page.md @@ -10,6 +10,18 @@ layout: "sidebar" All notable changes to this project. ![](https://img.shields.io/badge/License-MIT-yellow.svg) +## v2.2.1 + +Released December 31, 2025 + +**ES module compatibility fix for configure-fork.ts** + +- Fixed `__dirname is not defined` error when running `npm run configure` +- Added `fileURLToPath` import from `url` module to create ES module equivalent of `__dirname` +- Script now works correctly with `"type": "module"` in package.json + +Updated files: `scripts/configure-fork.ts`, `files.md`, `changelog.md`, `content/pages/changelog-page.md`, `TASK.md` + ## v2.2.0 Released December 30, 2025 diff --git a/files.md b/files.md index e5da587..2203877 100644 --- a/files.md +++ b/files.md @@ -211,7 +211,7 @@ Markdown files for static pages like About, Projects, Contact, Changelog. | `sync-posts.ts` | Syncs markdown files to Convex at build time (markdown sync v2) | | `sync-discovery-files.ts` | Updates AGENTS.md, CLAUDE.md, and llms.txt with current app data | | `import-url.ts` | Imports external URLs as markdown posts (Firecrawl) | -| `configure-fork.ts` | Automated fork configuration (reads fork-config.json) | +| `configure-fork.ts` | Automated fork configuration (reads fork-config.json). ES module compatible using fileURLToPath for __dirname equivalent. | | `send-newsletter.ts` | CLI tool for sending newsletter posts (npm run newsletter:send ). Calls scheduleSendPostNewsletter mutation directly. | | `send-newsletter-stats.ts` | CLI tool for sending weekly stats summary (npm run newsletter:send:stats). Calls scheduleSendStatsSummary mutation directly. | | `sync-server.ts` | Local HTTP server for executing sync commands from Dashboard UI. Runs on localhost:3001 with optional token authentication. Whitelisted commands only. Part of markdown sync v2. | diff --git a/public/raw/changelog.md b/public/raw/changelog.md index 3e6c204..5ff26b4 100644 --- a/public/raw/changelog.md +++ b/public/raw/changelog.md @@ -8,6 +8,18 @@ Date: 2025-12-31 All notable changes to this project. ![](https://img.shields.io/badge/License-MIT-yellow.svg) +## v2.2.1 + +Released December 31, 2025 + +**ES module compatibility fix for configure-fork.ts** + +- Fixed `__dirname is not defined` error when running `npm run configure` +- Added `fileURLToPath` import from `url` module to create ES module equivalent of `__dirname` +- Script now works correctly with `"type": "module"` in package.json + +Updated files: `scripts/configure-fork.ts`, `files.md`, `changelog.md`, `content/pages/changelog-page.md`, `TASK.md` + ## v2.2.0 Released December 30, 2025 diff --git a/public/raw/markdown-with-code-examples.md b/public/raw/markdown-with-code-examples.md index 9dc1831..3d280f1 100644 --- a/public/raw/markdown-with-code-examples.md +++ b/public/raw/markdown-with-code-examples.md @@ -599,4 +599,114 @@ Indent code blocks with 4 spaces inside list items: | `[link](url)` | [link](https://x.com) | | `![alt](image.png)` | image | | `> quote` | blockquote | -| `---` | horizontal rule | \ No newline at end of file +| `---` | horizontal rule | + +## Image grid + +Create a grid layout using HTML and CSS Grid. Each cell contains an image, text, and a link: + +```html +
+
+ +

Nature

+ View +
+ +
+``` + +Result: + +
+
+ +

Nature

+ View +
+
+ +

Mountains

+ View +
+
+ +

Ocean

+ View +
+
+ +

Forest

+ View +
+
+ +

Landscape

+ View +
+
+ +

Desert

+ View +
+
+ +

Sky

+ View +
+
+ +

Sunset

+ View +
+
+ +

Beach

+ View +
+
+ +

River

+ View +
+
+ +

Valley

+ View +
+
+ +

Flowers

+ View +
+
+ +

Lake

+ View +
+
+ +

Meadow

+ View +
+
+ +

Waterfall

+ View +
+
+ +

Sunrise

+ View +
+
+ +**Note:** The grid uses CSS Grid with `repeat(4, 1fr)` to create 4 equal columns. Images have empty `alt` attributes so no captions appear. Adjust the `gap` value to change spacing between cells. \ No newline at end of file diff --git a/scripts/configure-fork.ts b/scripts/configure-fork.ts index 610b839..0f87899 100644 --- a/scripts/configure-fork.ts +++ b/scripts/configure-fork.ts @@ -21,6 +21,11 @@ import * as fs from "fs"; import * as path from "path"; +import { fileURLToPath } from "url"; + +// ES module equivalent of __dirname +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); // Configuration interface matching fork-config.json interface ForkConfig { diff --git a/src/components/BlogPost.tsx b/src/components/BlogPost.tsx index 0686c7b..9b876d9 100644 --- a/src/components/BlogPost.tsx +++ b/src/components/BlogPost.tsx @@ -11,7 +11,7 @@ import NewsletterSignup from "./NewsletterSignup"; import ContactForm from "./ContactForm"; import siteConfig from "../config/siteConfig"; -// Sanitize schema that allows collapsible sections (details/summary) and inline styles for lists +// Sanitize schema that allows collapsible sections (details/summary) and inline styles const sanitizeSchema = { ...defaultSchema, tagNames: [...(defaultSchema.tagNames || []), "details", "summary"], @@ -21,6 +21,13 @@ const sanitizeSchema = { ul: ["style"], // Allow inline styles on ul for list-style control ol: ["style"], // Allow inline styles on ol for list-style control li: ["style"], // Allow inline styles on li elements + div: ["style"], // Allow inline styles on div for grid layouts + p: ["style"], // Allow inline styles on p elements + a: ["style", "href", "target", "rel"], // Allow inline styles on links + img: [ + ...(defaultSchema.attributes?.img || []), + "style", + ], // Allow inline styles on images }, };