Skip to content

Commit 62daac0

Browse files
committed
Tweaks to blog posts
1 parent 41e3d92 commit 62daac0

File tree

6 files changed

+36
-21
lines changed

6 files changed

+36
-21
lines changed

packages/homepage/content/articles/codesandbox-ci-embeds/index.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ best use of their time. Today we're pleased to launch CodeSandbox CI: A free
2020
continuous integration service purpose-built for open source library
2121
maintainers.
2222

23-
![](./images/CodeSandboxCI.gif)
23+
<iframe width="100%" height="500" src="https://www.youtube.com/embed/k_aR_4FeKlc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
2424

2525
## Here's how it works
2626

@@ -69,7 +69,14 @@ on the UI and more on the content. We also wanted to give users more control and
6969
improve the embed experience on mobile.”_
7070

7171
See the difference for yourself:
72-
[![Vanilla embed](./images/oldvsnew.png)](https://codesandbox.io/embed/vanilla)
72+
73+
<iframe
74+
src="https://codesandbox.io/embed/new?fontsize=14"
75+
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
76+
title="new"
77+
allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
78+
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
79+
></iframe>
7380
7481
## The next big design trend?
7582

packages/homepage/gatsby-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const getBlogNodeInfo = ({
1414
frontmatter: { authors, date, description, photo },
1515
},
1616
}) => ({
17-
author: authors[0],
17+
authors,
1818
date,
1919
description,
2020
photo,
@@ -89,7 +89,7 @@ const createNodeFieldsFromNodeInfo = ({
8989
const createBlogNodeFields = ({ createNodeField, nodeInfo }) => {
9090
createNodeFieldsFromNodeInfo({
9191
createNodeField,
92-
nodeFieldNames: ['author', 'date', 'description', 'photo'],
92+
nodeFieldNames: ['authors', 'date', 'description', 'photo'],
9393
nodeInfo,
9494
});
9595
};

packages/homepage/src/components/PostElements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ export const AuthorImage = styled.img`
2828
width: 32px;
2929
height: 32px;
3030
border-radius: 4px;
31+
margin-right: 1rem;
3132
`;
3233

3334
export const Author = styled.h4`
3435
font-family: 'Poppins', sans-serif;
3536
font-weight: 500;
3637
font-size: 18px;
3738
margin: 0;
38-
margin-left: 16px;
3939
4040
color: #f2f2f2;
4141
`;

packages/homepage/src/pages/blog.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ import {
2626
// UNCOMMENT AT THE BOTTOM IF IT BREAKS
2727
// GATSBY DOES NOT LET YOU HAVE FIELDS THAT DON'T EXIST YET
2828

29-
const Info = ({ author, date, mobile, photo, ...props }) => (
29+
const Info = ({ authors, date, mobile, photo, ...props }) => (
3030
<Aside mobile={mobile} {...props}>
3131
<PostDate>{format(date, 'MMM DD, YYYY')}</PostDate>
3232

33-
<section>
34-
<AuthorImage src={photo} alt={author} />
33+
{authors.map(author => (
34+
<section key={author.name}>
35+
<AuthorImage src={photo} alt={author} />
3536

36-
<Author>{author}</Author>
37-
</section>
37+
<Author>{author}</Author>
38+
</section>
39+
))}
3840
</Aside>
3941
);
4042

@@ -62,15 +64,15 @@ const Blog = ({
6264
{blogPosts.map(
6365
({
6466
node: {
65-
fields: { author, date, description, photo, slug, title },
67+
fields: { authors, date, description, photo, slug, title },
6668
frontmatter: {
6769
banner: { publicURL: banner },
6870
},
6971
id,
7072
},
7173
}) => (
7274
<Wrapper key={id}>
73-
<Info author={author} date={date} photo={photo} />
75+
<Info authors={authors} date={date} photo={photo} />
7476

7577
<Posts>
7678
{banner && (
@@ -98,7 +100,7 @@ const Blog = ({
98100
<Subtitle>{description}</Subtitle>
99101
</div>
100102

101-
<Info author={author} date={date} mobile photo={photo} />
103+
<Info authors={authors} date={date} mobile photo={photo} />
102104
</Posts>
103105
</Wrapper>
104106
)
@@ -116,7 +118,7 @@ export const query = graphql`
116118
edges {
117119
node {
118120
fields {
119-
author
121+
authors
120122
date
121123
description
122124
photo

packages/homepage/src/templates/_post.elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ export const MetaData = styled.aside`
9191
export const AuthorContainer = styled.div`
9292
align-items: center;
9393
display: flex;
94-
flex: 1;
94+
margin-bottom: 0.5rem;
9595
`;

packages/homepage/src/templates/post.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
export default ({
2424
data: {
2525
blogPost: {
26-
fields: { author, date, description, photo, title },
26+
fields: { authors, date, description, photo, title },
2727
frontmatter: {
2828
banner: { publicURL: banner },
2929
},
@@ -43,11 +43,17 @@ export default ({
4343
<Title>{title}</Title>
4444

4545
<MetaData>
46-
<AuthorContainer>
47-
<AuthorImage alt={author} src={photo} />
46+
<div style={{ flex: 1 }}>
47+
{authors.map(author => (
48+
<AuthorContainer key={author}>
49+
{authors.length === 1 && (
50+
<AuthorImage alt={author} src={photo} />
51+
)}
4852

49-
<Author>{author}</Author>
50-
</AuthorContainer>
53+
<Author>{author}</Author>
54+
</AuthorContainer>
55+
))}
56+
</div>
5157

5258
<PostDate>{format(date, 'MMM DD, YYYY')}</PostDate>
5359
</MetaData>
@@ -64,7 +70,7 @@ export const pageQuery = graphql`
6470
query Post($id: String) {
6571
blogPost: markdownRemark(id: { eq: $id }) {
6672
fields {
67-
author
73+
authors
6874
date
6975
description
7076
photo

0 commit comments

Comments
 (0)