create-next-mdx-blog-app 2.1.9 → 2.2.0
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/README.md +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ npx create-next-mdx-blog-app .
|
|
|
61
61
|
### Package Information
|
|
62
62
|
|
|
63
63
|
- **Package Name**: `create-next-mdx-blog-app`
|
|
64
|
-
- **Version**: `2.
|
|
64
|
+
- **Version**: `2.2.0`
|
|
65
65
|
- **License**: MIT
|
|
66
66
|
- **Homepage**: [https://www.npmjs.com/package/create-next-mdx-blog-app](https://www.npmjs.com/package/create-next-mdx-blog-app/)
|
|
67
67
|
|
|
@@ -81,7 +81,7 @@ npx create-next-mdx-blog-app .
|
|
|
81
81
|
- **react-syntax-highlighter**: A library for syntax highlighting in React applications, making code snippets more readable.
|
|
82
82
|
- **tsx**: Run TypeScript code without worrying about configuration! Run the `article-manager.ts` for manually working with published articles.
|
|
83
83
|
- **@codesandbox/sandpack-react**: Powers the in-browser JavaScript/TypeScript code execution environment, running code entirely client-side with no server required.
|
|
84
|
-
- **ai** (Vercel AI SDK): Provides streaming AI response primitives and transport utilities (`TextStreamChatTransport`, `streamText`, tool support)
|
|
84
|
+
- **ai** (Vercel AI SDK): Provides streaming AI response primitives and transport utilities (`TextStreamChatTransport`, `streamText`, tool support) used by both the interactive chatbot and the AI article summarizer.
|
|
85
85
|
- **@ai-sdk/anthropic**: Anthropic provider for the Vercel AI SDK, used to connect to Claude models.
|
|
86
86
|
- **@ai-sdk/react**: React hooks (`useChat`) for building streaming AI chat interfaces.
|
|
87
87
|
- **zod**: TypeScript-first schema validation library used to define and validate AI tool parameters.
|
|
@@ -219,6 +219,9 @@ The project includes an interactive AI-powered chatbot optimised for readers of
|
|
|
219
219
|
### API Route
|
|
220
220
|
`src/app/api/chat/route.ts` — Next.js edge route. Accepts the `UIMessages` array, converts it to `CoreMessages` via `convertToModelMessages`, streams a response using `streamText` with the three blog tools, and returns `result.toTextStreamResponse()`.
|
|
221
221
|
|
|
222
|
+
## ✨ AI Article Summarizer
|
|
223
|
+
A **Generate TL;DR** button above every dynamic article streams a short Claude Haiku summary into a collapsible green panel. The slug is the only thing sent over the wire — `src/app/api/summarize/[slug]/route.ts` (edge) fetches the article server-side, applies an origin allow-list (`NEXT_PUBLIC_SITE_URL`) + per-IP rate limit (10/min) + 1-hour in-memory cache, then calls `streamText` and writes the final text to cache via `after()`. The client (`src/components/ArticleSummarizer.tsx`) uses `AbortController` to cancel in-flight requests on close/unmount. Model and prompt live in `src/utils/constants/AiSummaryConfig.ts`.
|
|
224
|
+
|
|
222
225
|
## 📬 Newsletter Subscription
|
|
223
226
|
The project ships with an integrated **newsletter signup form** powered by [Resend](https://resend.com). Visitors can subscribe from the home page or from the bottom of any article; new subscribers are added to a Resend **Audience** and immediately receive a welcome email.
|
|
224
227
|
|
|
@@ -389,6 +392,9 @@ export const viewport: Viewport = {
|
|
|
389
392
|
## 📊 Analytics
|
|
390
393
|
Integrated in this setup project is Vercel Analytics (`@vercel/analytics`) to track user interactions and performance metrics of the blog.
|
|
391
394
|
|
|
395
|
+
## 🗺️ Sitemap & Robots
|
|
396
|
+
A `sitemap.xml` is auto-generated at build time via `src/app/sitemap.ts`, covering all static routes and every dynamic article slug fetched from Supabase. A companion `robots.txt` is served from `src/app/robots.ts`, permitting all crawlers and pointing them to the generated sitemap for full search engine discoverability.
|
|
397
|
+
|
|
392
398
|
## ⚙️ Next.js Configuration
|
|
393
399
|
The `next.config.ts` file is set up for working with AWS S3 and includes MDX extensions for enhanced functionality. Feel free to modify and add your own custom links to access storage and setting up other configurations.
|
|
394
400
|
|
package/package.json
CHANGED