Skip to content

Commit

Permalink
Merge pull request #120 from whitep4nth3r/add-arcade-embed
Browse files Browse the repository at this point in the history
add arcade embed
  • Loading branch information
whitep4nth3r authored Sep 25, 2023
2 parents 69513ab + c38690c commit 7e7d6e2
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 3 deletions.
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;
}

0 comments on commit 7e7d6e2

Please sign in to comment.