create-next-mdx-blog-app 2.2.2 → 2.2.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.
Files changed (2) hide show
  1. package/README.md +34 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -17,6 +17,8 @@ This project was developed with the help of **Claude** (Anthropic) and **Cursor*
17
17
  - [AI Features](#-ai-features)
18
18
  - [Code Sandbox](#%EF%B8%8F-code-sandbox)
19
19
  - [Author Profile Pages](#-author-profile-pages)
20
+ - [Search](#-search)
21
+ - [Tags](#-tags)
20
22
  - [Newsletter Subscription](#-newsletter-subscription)
21
23
  - [Supabase Database](#%EF%B8%8F-supabase-database)
22
24
  - [Article Manager CLI](#%EF%B8%8F-article-manager-cli)
@@ -41,7 +43,7 @@ Scaffold the blog into an empty directory:
41
43
  npx create-next-mdx-blog-app .
42
44
  ```
43
45
 
44
- The installer ([`create-next-mdx-blog-app`](https://www.npmjs.com/package/create-next-mdx-blog-app/), v2.2.2, MIT) clones the app, installs dependencies, and prints the environment setup steps.
46
+ The installer ([`create-next-mdx-blog-app`](https://www.npmjs.com/package/create-next-mdx-blog-app/), v2.2.4, MIT) clones the app, installs dependencies, and prints the environment setup steps.
45
47
 
46
48
  ### Option 2 — Manual clone
47
49
 
@@ -251,6 +253,37 @@ Components: `src/components/SandpackEditor.tsx` (provider, editor, toolbar, cons
251
253
 
252
254
  A `/authors` index lists every distinct contributor pulled from the Supabase `Article` table, with per-author profile routes at `/authors/[slug]` showing their bio, avatar, and every article they've published.
253
255
 
256
+ ## 🔍 Search
257
+
258
+ Full-text search across published articles at `/search`, powered by native Postgres `tsvector` — no external search service required.
259
+
260
+ - **Search-as-you-type** — `src/components/ArticleSearch.tsx` debounces input (300 ms), cancels stale requests with `AbortController`, caches repeated queries, and waits for at least 2 characters before querying
261
+ - **Prefix matching** — partial words match while you type (`reac` → `react`)
262
+ - **Ranked, weighted results** — scored by `ts_rank` with column weights (title > tags > description > content) and returned as lightweight summaries (the heavy `content` column is excluded)
263
+ - **Request flow** — `GET /api/search?q=…` (`src/app/api/search/route.ts`) → `searchArticles()` (`src/utils/functions/rpc/searchArticles.ts`) → the `search_articles` Postgres RPC
264
+
265
+ ### One-time setup
266
+
267
+ Run **`scripts/sql/DDL/createSearchArticlesFunction.sql`** once in the Supabase SQL editor. It creates the weighted GIN index and the `search_articles` function. Search returns an error until this script is deployed.
268
+
269
+ ### ⚠️ Change the hardcoded author filter
270
+
271
+ The shipped function locks results to a single author:
272
+
273
+ ```sql
274
+ AND a."articleAuthorName" = 'Abdullah Muhammad.'
275
+ ```
276
+
277
+ Before deploying, replace `'Abdullah Muhammad.'` with **your own author name** — it must match the `articleAuthorName` values in your `Article` table **exactly**, including any trailing punctuation. Alternatively, **delete that line entirely** to search across all authors. Re-run the script after editing.
278
+
279
+ ## 🏷 Tags
280
+
281
+ Browse articles by topic at `/tags`, which lists every distinct tag pulled from the Supabase `Article` table, with per-tag archive pages at `/tags/[tag]`.
282
+
283
+ - `fetchAllTags()` (`src/utils/functions/tags/fetchAllTags.ts`) — deduplicates tags case-insensitively and counts how many articles carry each one
284
+ - `fetchArticlesByTag()` (`src/utils/functions/crud/fetchArticlesByTag.ts`) — returns every article carrying a given tag, newest first
285
+ - `slugifyTag()` (`src/utils/functions/tags/slugifyTag.ts`) — normalizes tag names into URL-safe slugs (e.g. `"DevOps"` → `"devops"`), so casing/spacing variants still resolve to the same tag page
286
+
254
287
  ## 📬 Newsletter Subscription
255
288
 
256
289
  An integrated newsletter signup form powered by [Resend](https://resend.com). Visitors can subscribe from the home page or the bottom of any article; new subscribers are added to a Resend **Audience** and receive a welcome email.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-next-mdx-blog-app",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "A production-ready technical blog starter kit built with Next.js, MDX, Supabase, and TypeScript.",
5
5
  "author": {
6
6
  "name": "Abdullah Muhammad",