Skip to content

Commit 7af2a71

Browse files
authored
Merge pull request #814 from CodingCatDev/dev
Release: universal social media embeds & Anthropic S-1 circular AI post
2 parents ad6a532 + 2daf036 commit 7af2a71

17 files changed

Lines changed: 1901 additions & 53 deletions

‎.github/workflows/syndicate-post.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
elif [ "$TARGET_DOCUMENT_ID" = "firebase-archive-2017-2024" ]; then
5252
FIREBASE_ARCHIVE_YEARS=2017,2018,2019,2020,2021,2022,2023,2024 SANITY_STUDIO_DATASET=production node scripts/generate-firebase-archive-posts.mjs
5353
FIREBASE_ARCHIVE_YEARS=2017,2018,2019,2020,2021,2022,2023,2024 SANITY_STUDIO_DATASET=dev node scripts/generate-firebase-archive-posts.mjs
54+
elif [ "$TARGET_DOCUMENT_ID" = "publish-circular-ai-s1" ]; then
55+
SANITY_STUDIO_DATASET=production node scripts/publish-circular-ai-s1-post.mjs
56+
SANITY_STUDIO_DATASET=dev node scripts/publish-circular-ai-s1-post.mjs
5457
else
5558
node scripts/run-syndicate-post.mjs
5659
fi

‎GEMINI.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CodingCat.dev Monorepo Always-On Skills & Editorial Rules
2+
3+
Every interactive session, subagent, and script in this repository (`codingcat.dev`) MUST follow these live CodingCat.dev skills:
4+
5+
- @[alex-voice-and-copy](/home/alex/.gemini/config/skills/alex-voice-and-copy/SKILL.md)
6+
- @[alex-writing-style](/home/alex/.gemini/config/skills/alex-voice-and-copy/references/writing-style.md)
7+
- @[alex-wtf-is-series](/home/alex/.gemini/config/skills/alex-voice-and-copy/references/wtf-is-series.md)
8+
- @[codingcat-design-system](/home/alex/.gemini/config/skills/codingcat-design-system/SKILL.md)
9+
- @[codingcat-media-studio](/home/alex/.gemini/config/skills/codingcat-media-studio/SKILL.md)
10+
- @[codingcat-diagrams](/home/alex/.gemini/config/skills/codingcat-media-studio/references/excalidraw-diagrams.md)
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
import { defineType } from "sanity";
2+
import type { IconType } from "react-icons";
3+
import {
4+
FaBluesky,
5+
FaGithub,
6+
FaInstagram,
7+
FaLinkedin,
8+
FaMastodon,
9+
FaReddit,
10+
FaShareNodes,
11+
FaThreads,
12+
FaTiktok,
13+
} from "react-icons/fa6";
14+
15+
const socialFields = [
16+
{
17+
name: "platform",
18+
type: "string",
19+
title: "Platform",
20+
description: "Optional: auto-detected from URL when left blank.",
21+
options: {
22+
list: [
23+
{ title: "Auto-detect from URL", value: "auto" },
24+
{ title: "X (Twitter)", value: "x" },
25+
{ title: "Bluesky", value: "bluesky" },
26+
{ title: "LinkedIn", value: "linkedin" },
27+
{ title: "Reddit", value: "reddit" },
28+
{ title: "TikTok", value: "tiktok" },
29+
{ title: "Instagram", value: "instagram" },
30+
{ title: "Threads", value: "threads" },
31+
{ title: "Mastodon", value: "mastodon" },
32+
{ title: "GitHub Gist", value: "gist" },
33+
{ title: "YouTube", value: "youtube" },
34+
],
35+
},
36+
},
37+
{
38+
name: "url",
39+
type: "url",
40+
title: "Post URL",
41+
validation: (rule: { required: () => unknown }) => rule.required(),
42+
},
43+
{
44+
name: "author",
45+
type: "string",
46+
title: "Author Name (Optional)",
47+
},
48+
{
49+
name: "handle",
50+
type: "string",
51+
title: "Author Handle (Optional)",
52+
},
53+
{
54+
name: "fallbackText",
55+
type: "text",
56+
title: "Post Text / Fallback Excerpt (Optional)",
57+
rows: 3,
58+
},
59+
{
60+
name: "caption",
61+
type: "string",
62+
title: "Caption (Optional)",
63+
},
64+
];
65+
66+
function createPlatformEmbedSchema(
67+
name: string,
68+
title: string,
69+
defaultPlatform: string,
70+
icon: IconType,
71+
) {
72+
return defineType({
73+
name,
74+
type: "object",
75+
title,
76+
icon,
77+
fields: socialFields,
78+
initialValue: {
79+
platform: defaultPlatform,
80+
},
81+
preview: {
82+
select: {
83+
title: "author",
84+
subtitle: "url",
85+
},
86+
prepare({ title: authorName, subtitle }) {
87+
return {
88+
title: authorName ? `${title}: ${authorName}` : title,
89+
subtitle: subtitle || "",
90+
};
91+
},
92+
},
93+
});
94+
}
95+
96+
export const socialEmbed = createPlatformEmbedSchema(
97+
"socialEmbed",
98+
"Social Media Embed",
99+
"auto",
100+
FaShareNodes,
101+
);
102+
export const blueskyEmbed = createPlatformEmbedSchema(
103+
"bluesky",
104+
"Bluesky Embed",
105+
"bluesky",
106+
FaBluesky,
107+
);
108+
export const linkedinEmbed = createPlatformEmbedSchema(
109+
"linkedin",
110+
"LinkedIn Embed",
111+
"linkedin",
112+
FaLinkedin,
113+
);
114+
export const redditEmbed = createPlatformEmbedSchema(
115+
"reddit",
116+
"Reddit Embed",
117+
"reddit",
118+
FaReddit,
119+
);
120+
export const tiktokEmbed = createPlatformEmbedSchema(
121+
"tiktok",
122+
"TikTok Embed",
123+
"tiktok",
124+
FaTiktok,
125+
);
126+
export const instagramEmbed = createPlatformEmbedSchema(
127+
"instagram",
128+
"Instagram Embed",
129+
"instagram",
130+
FaInstagram,
131+
);
132+
export const threadsEmbed = createPlatformEmbedSchema(
133+
"threads",
134+
"Threads Embed",
135+
"threads",
136+
FaThreads,
137+
);
138+
export const mastodonEmbed = createPlatformEmbedSchema(
139+
"mastodon",
140+
"Mastodon Embed",
141+
"mastodon",
142+
FaMastodon,
143+
);
144+
export const githubGistEmbed = createPlatformEmbedSchema(
145+
"githubGist",
146+
"GitHub Gist Embed",
147+
"gist",
148+
FaGithub,
149+
);
150+
151+
export default socialEmbed;
Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,57 @@
11
import { defineType } from "sanity";
2-
import { FaTwitter } from "react-icons/fa6";
2+
import { FaXTwitter } from "react-icons/fa6";
33
import preview from "../../components/TwitterPreview";
44

55
export default defineType({
66
name: "twitter",
77
type: "object",
8-
title: "Twitter Embed",
9-
icon: FaTwitter,
8+
title: "X (Twitter) Post Embed",
9+
icon: FaXTwitter,
1010
components: {
1111
preview,
1212
},
1313
preview: {
1414
select: {
1515
id: "id",
16+
url: "url",
17+
handle: "handle",
1618
},
1719
},
1820
fields: [
1921
{
2022
name: "id",
2123
type: "string",
22-
title: "Twitter(X) tweet id",
24+
title: "X (Twitter) Post ID or URL",
25+
description: "Paste either the numeric status ID or the full x.com / twitter.com status URL.",
26+
},
27+
{
28+
name: "url",
29+
type: "url",
30+
title: "Full Post URL (Optional)",
31+
},
32+
{
33+
name: "author",
34+
type: "string",
35+
title: "Author Display Name (Optional)",
36+
},
37+
{
38+
name: "handle",
39+
type: "string",
40+
title: "Author Handle (Optional, without @)",
41+
},
42+
{
43+
name: "text",
44+
type: "text",
45+
title: "Post Text Fallback (Optional)",
46+
rows: 3,
47+
},
48+
{
49+
name: "date",
50+
type: "string",
51+
title: "Display Date (Optional)",
2352
},
2453
],
2554
initialValue: {
26-
id: "1083592734038929408",
55+
id: "2114705042817110293",
2756
},
2857
});

‎apps/sanity/schemas/partials/base.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ import twitter from "../custom/twitter-embed";
1717
import quote from "../custom/quote";
1818
import youtube from "../custom/youtube";
1919
import youtubeShorts from "../custom/youtube-shorts";
20+
import socialEmbed, {
21+
blueskyEmbed,
22+
githubGistEmbed,
23+
instagramEmbed,
24+
linkedinEmbed,
25+
mastodonEmbed,
26+
redditEmbed,
27+
threadsEmbed,
28+
tiktokEmbed,
29+
} from "../custom/social-embed";
2030

2131
const baseType = defineType({
2232
name: "base",
@@ -101,6 +111,15 @@ const baseType = defineType({
101111
defineArrayMember(codepen),
102112
defineArrayMember(codesandbox),
103113
defineArrayMember(twitter),
114+
defineArrayMember(socialEmbed),
115+
defineArrayMember(blueskyEmbed),
116+
defineArrayMember(linkedinEmbed),
117+
defineArrayMember(redditEmbed),
118+
defineArrayMember(tiktokEmbed),
119+
defineArrayMember(instagramEmbed),
120+
defineArrayMember(threadsEmbed),
121+
defineArrayMember(mastodonEmbed),
122+
defineArrayMember(githubGistEmbed),
104123
defineArrayMember(html),
105124
defineArrayMember(quote),
106125
defineArrayMember({ type: "table" }),
755 KB
Loading
700 KB
Loading
764 KB
Loading
738 KB
Loading
670 KB
Loading

0 commit comments

Comments
 (0)