setExtraImg(key, img)}
+ type="showcase"
+ subId={key}
+ img={extraImages[key]}
+ slug={slug}
+ />
+ {extraImages[key] && (
+ <>
+ To include this image in your post, use this markdown snippet:
+
+ >
+ )}
+ >
+ )
+ })}
- {Object.keys(extraImages).length > 0 && (
- <>
- Using extra images in your post
- To include these images, use this markup:
-
- {Object.keys(extraImages)
- .map((key) => `[Image caption here][img${key}]`)
- .join('\n\n')}
-
- Then, at at the bottom of your post, make sure to include this:
-
- {Object.keys(extraImages)
- .map(
- (key) =>
- `[img${key}]: ${cloudflareImageUrl({
- id: extraImages[key],
- variant: 'main',
- })}`
- )
- .join('\n')}
-
-
- >
- )}
>
) : (
@@ -223,7 +212,20 @@ export const CreateShowcasePost = ({ noTitle = false }) => {
>
) : (
- Post preview here
+ <>
+ {title}
+
+ >
)}
diff --git a/sites/shared/components/github/design-picker.mjs b/sites/org/components/github/design-picker.mjs
similarity index 100%
rename from sites/shared/components/github/design-picker.mjs
rename to sites/org/components/github/design-picker.mjs
diff --git a/sites/shared/components/github/inputs.mjs b/sites/org/components/github/inputs.mjs
similarity index 100%
rename from sites/shared/components/github/inputs.mjs
rename to sites/org/components/github/inputs.mjs
diff --git a/sites/org/components/mdx/posts/article.mjs b/sites/org/components/mdx/posts/article.mjs
index 538eb774ecc..ad2fa2c3f19 100644
--- a/sites/org/components/mdx/posts/article.mjs
+++ b/sites/org/components/mdx/posts/article.mjs
@@ -6,55 +6,84 @@ import { TimeAgo } from 'shared/components/mdx/meta.mjs'
import { useTranslation } from 'next-i18next'
import { MdxWrapper } from 'shared/components/wrappers/mdx.mjs'
import { cloudflareImageUrl } from 'shared/utils.mjs'
+import Markdown from 'react-markdown'
export const ns = ['common', 'posts']
-export const PostArticle = ({ frontmatter, MDX, imgId }) => {
+export const PostArticle = (props) => {
const { t } = useTranslation('common')
+
return (
-
-
-
- [{frontmatter.date}]
-
-
- {frontmatter.designs?.map((design) => (
-
- ))}
-
-
-
-
-
-
-
-
-
-
-
-
- {MDX}
-
-
-
+
+
+
+
+
+
)
}
+
+const PostWrapper = ({ children }) => {children}
+
+const PostMeta = ({ frontmatter, t }) => (
+
+
+ [{frontmatter.date}]
+
+
+ {frontmatter.designs?.map((design) => (
+
+ ))}
+
+
+
+)
+
+const PostImage = ({ imgId, frontmatter }) => (
+
+
+
+
+
+
+
+
+)
+
+const PostAuthor = ({ frontmatter }) => (
+
+)
+
+const PostContent = (props) =>
+ props.MDX ? :
+
+const PostMDXContent = ({ MDX }) => (
+
+ {MDX}
+
+)
+
+const PostPreviewContent = ({ body }) => (
+
+ {body}
+
+)
diff --git a/sites/org/pages/new/showcase.mjs b/sites/org/pages/new/showcase.mjs
index 511ef6f8dbe..e69a5492a1d 100644
--- a/sites/org/pages/new/showcase.mjs
+++ b/sites/org/pages/new/showcase.mjs
@@ -6,7 +6,7 @@ import { useTranslation } from 'next-i18next'
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
import { ns as apikeysNs } from 'shared/components/account/apikeys.mjs'
-import { CreateShowcasePost } from 'shared/components/github/create-showcase.mjs'
+import { CreateShowcasePost } from 'site/components/github/create-showcase.mjs'
// Translation namespaces used on this page
const namespaces = [...new Set([...apikeysNs, ...authNs, ...pageNs])]
diff --git a/sites/shared/components/code-box.mjs b/sites/shared/components/code-box.mjs
index a18acb8e5da..6d4f5e638c7 100644
--- a/sites/shared/components/code-box.mjs
+++ b/sites/shared/components/code-box.mjs
@@ -1,7 +1,21 @@
-export const CodeBox = ({ children }) => (
+import { CopyIcon } from 'shared/components/icons.mjs'
+import { CopyToClipboard } from 'shared/components/copy-to-clipboard.mjs'
+
+export const CodeBox = ({ code, title }) => (
+
+ {title}
+
+
- {children}
+ {code}
)
diff --git a/sites/shared/components/copy-to-clipboard.mjs b/sites/shared/components/copy-to-clipboard.mjs
index 8ba5f9594ca..e68bb8ffa16 100644
--- a/sites/shared/components/copy-to-clipboard.mjs
+++ b/sites/shared/components/copy-to-clipboard.mjs
@@ -1,6 +1,6 @@
import ReactDOMServer from 'react-dom/server'
import { useState } from 'react'
-import { CopyIcon } from 'shared/components/icons.mjs'
+import { CopyIcon, OkIcon } from 'shared/components/icons.mjs'
import { CopyToClipboard as Copy } from 'react-copy-to-clipboard'
const strip = (html) =>
@@ -22,7 +22,11 @@ export const CopyToClipboard = ({ content }) => {
return (
handleCopied(setCopied)}>
)