Skip to content

Commit fc71667

Browse files
committed
Support embeds in blog posts
1 parent 7cf7425 commit fc71667

File tree

17 files changed

+337
-133
lines changed

17 files changed

+337
-133
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,6 @@ sw.*
8383

8484
# macOS
8585
.DS_Store
86+
87+
# Local Netlify folder
88+
.netlify

cms/schema.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import captionedImage from "./schemas/modular/captioned-image";
88
import codeBlock from "./schemas/modular/code-block";
99
import iconLink from "./schemas/modular/icon-link";
1010
import skill from "./schemas/modular/skill";
11+
import embed from "./schemas/modular/embed";
1112
// Collection schemas
1213
import post from "./schemas/collections/post";
1314
import project from "./schemas/collections/project";
@@ -34,5 +35,6 @@ export default createSchema({
3435
codeBlock,
3536
iconLink,
3637
skill,
38+
embed,
3739
]),
3840
});

cms/schemas/collections/post.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default {
2323
},
2424
{
2525
name: "mainImage",
26-
title: "Main Image",
26+
title: "Main image",
2727
type: "image",
2828
options: {
2929
hotspot: true,
@@ -56,7 +56,7 @@ export default {
5656
},
5757
{
5858
name: "publishedAt",
59-
title: "Published At",
59+
title: "Published at",
6060
type: "datetime",
6161
},
6262
{

cms/schemas/modular/block-content.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
export default {
1313
name: "blockContent",
14-
title: "Block Content",
14+
title: "Block content",
1515
type: "array",
1616
of: [
1717
{
@@ -40,5 +40,6 @@ export default {
4040
},
4141
{ type: "captionedImage" },
4242
{ type: "codeBlock" },
43+
{ type: "embed" },
4344
],
4445
};

cms/schemas/modular/captioned-image.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
name: "captionedImage",
3-
title: "Captioned Image",
3+
title: "Captioned image",
44
type: "object",
55
fields: [
66
{

cms/schemas/modular/code-block.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
name: "codeBlock",
3-
title: "Code Block",
3+
title: "Code block",
44
type: "object",
55
fields: [
66
{

cms/schemas/modular/embed.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react";
2+
3+
export default {
4+
title: "Embed",
5+
name: "embed",
6+
type: "object",
7+
fields: [
8+
{
9+
title: "URL",
10+
name: "url",
11+
type: "url",
12+
},
13+
],
14+
preview: {
15+
select: {
16+
url: "url",
17+
},
18+
component: ({ value }) => (
19+
<iframe src={value.url} width="100%" height="500px" frameBorder={0} />
20+
),
21+
},
22+
};

cms/schemas/modular/icon-link.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
name: "iconLink",
3-
title: "Icon Link",
3+
title: "Icon link",
44
type: "object",
55
fields: [
66
{

cms/schemas/singletons/about.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
},
4444
{
4545
name: "gpgPublicKey",
46-
title: "Public Key",
46+
title: "Public key",
4747
type: "text",
4848
fieldset: "gpg",
4949
},

0 commit comments

Comments
 (0)