Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/web/content/blog/build-time-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ We also have a <WithTooltip name="two">_`function LinkWithCard({ href, children,

!isCode true

```jsx scraper.js
```jsx scraper.js -c
const regex = /<meta property="og:image" content="([^"]+)"/

export async function scrape(url) {
const res = await fetch(url)
const html = await res.text()
Expand All @@ -251,7 +252,7 @@ export async function scrape(url) {

!isCode true

```jsx card.jsx
```jsx card.jsx -c
// !link[/(http.*?$)/] https://ui.shadcn.com/docs/components/hover-card
// from https://ui.shadcn.com/docs/components/hover-card
import {
Expand Down Expand Up @@ -328,7 +329,7 @@ function rehypeLinkImage() {
const promises = links.map(async (node) => {
const url = node.properties.href
const { image } = await scrape(url)
node.properties["data-image"] = image
node.properties["dataImage"] = image
})
await Promise.all(promises)
}
Expand Down
9 changes: 9 additions & 0 deletions apps/web/content/blog/type-safe-markdown.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Type-safe Markdown
description: test description
date: 2024-06-20
authors: [pomber]
draft: true
---

test