Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Step 5: Converting post markdown to HTML with Marked
Browse files Browse the repository at this point in the history
  • Loading branch information
colbyfayock committed Jan 15, 2024
1 parent 86ce899 commit bc2ae53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -15,6 +15,7 @@
"@astrojs/vercel": "^6.1.3",
"appwrite": "^13.0.1",
"astro": "^4.1.1",
"marked": "^11.1.1",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
},
Expand Down
3 changes: 2 additions & 1 deletion src/pages/posts/new.astro
@@ -1,5 +1,6 @@
---
import { ID } from 'appwrite';
import { marked } from 'marked';
import { databases } from '@/lib/appwrite';
Expand All @@ -11,7 +12,7 @@ if (Astro.request.method === "POST") {
const data = {
title: String(formData.get('title')),
slug: String(formData.get('slug')),
content: String(formData.get('content')),
content: await marked(String(formData.get('content'))),
excerpt: String(formData.get('excerpt')),
}
const results = await databases.createDocument(
Expand Down

0 comments on commit bc2ae53

Please sign in to comment.