ContentActions
Provides action buttons for blog posts, guides, and kickstarts including copying content for LLM and viewing as markdown.
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
content | Blogpost | Guide | Kickstart | Yes | - | Content data from Contentstack |
type | 'blog' | 'guide' | 'kickstart' | Yes | - | Content type to determine field names and routes |
className | string | No | '' | Additional CSS classes for the wrapper |
layout | 'stacked' | 'inline' | No | 'stacked' | Layout style for actions |
Usage
import ContentActions from '@/components/organisms/ContentActions';
// For blog posts
<ContentActions content={blogPost} type="blog" />
// For guides
<ContentActions content={guide} type="guide" />
// For kickstarts
<ContentActions content={kickstart} type="kickstart" />
// Inline layout (header/meta row)
<ContentActions content={guide} type="guide" layout="inline" />Features
- Copy for LLM: Formats content (title, authors, dates, content) for LLM consumption and copies to clipboard
- View as Markdown: Links to markdown version at
/blog/[slug].mdor/guides/[...slug].md - Shows "Copied!" feedback when content is copied
- Uses icons from the Icons component
- Works with blog posts, guides, and kickstarts
Actions
Copy for LLM
Formats the content into a structured text format including:
- Title (from
blog_content.titleorguide_content.title) - Authors
- Published/Updated dates (
datefallback tocreated_at) - Full content text
View as Markdown
Links to the markdown route for the current content:
- Blogs:
/blog/[slug].md - Guides:
/guides/[...slug].md - Kickstarts:
/kickstarts/[...slug].md
Notes
- Client-side component (uses
'use client') - Uses
usePathnameto extract slug from current route - Copy feedback disappears after 2 seconds
- Automatically handles different content field names based on type (
blog_content,guide_content,kickstart_content)