Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add arcade embed #120

Merged
merged 3 commits into from
Sep 25, 2023
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
1 change: 1 addition & 0 deletions lib/contentfulBlogPosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const ContentfulBlogPosts = {
}
__typename
${GraphQLStringBlocks.videoEmbed()}
${GraphQLStringBlocks.arcadeEmbed()}
${GraphQLStringBlocks.callout()}
${GraphQLStringBlocks.codeBlock()}
${GraphQLStringBlocks.blogPost()}
Expand Down
8 changes: 8 additions & 0 deletions lib/graphQLStringBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ const GraphQLStringBlocks = {
}
`;
},
arcadeEmbed: function () {
return `
... on ArcadeEmbed {
title
embedCode
}
`;
},
videoEmbed: function () {
return `
... on VideoEmbed {
Expand Down
8 changes: 8 additions & 0 deletions src/_components/arcadeEmbed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function ArcadeEmbed({ embedCode, title }) {
return /* html */ `
<div class="post__arcadeEmbed">
${embedCode}>
</div>`;
}

module.exports = ArcadeEmbed;
3 changes: 3 additions & 0 deletions src/_components/richText.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ResponsiveImage = require("./responsiveImage");
const Callout = require("./callout");
const CodeBlock = require("./codeBlock");
const VideoEmbed = require("./videoEmbed");
const ArcadeEmbed = require("./arcadeEmbed");
const CodePenEmbed = require("./codepenEmbed");
const TweetEmbed = require("./tweetEmbed");
const BlogPostEmbed = require("./blogPostEmbed");
Expand Down Expand Up @@ -121,6 +122,8 @@ function getRichTextRenderOptions(links, options) {
return TweetEmbed({ tweetUrl: entry.tweetUrl });
case "VideoEmbed":
return VideoEmbed({ embedUrl: entry.embedUrl, title: entry.title });
case "ArcadeEmbed":
return ArcadeEmbed({ embedCode: entry.embedCode, title: entry.title });
case "Callout":
return Callout({ title: entry.title, content: entry.content, emoji: entry.emoji });
case "CodeBlock":
Expand Down
9 changes: 7 additions & 2 deletions src/_css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/_css/main.css.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/_sass/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,8 @@
@include link_focus;
}
}

.post__arcadeEmbed {
margin-bottom: 2rem;
margin-top: 2rem;
}
Loading