Skip to content

Commit

Permalink
Merge branch 'feat/new-layout' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shaun-jacks committed May 23, 2020
2 parents 6c220c9 + 79ef97d commit 3f31609
Show file tree
Hide file tree
Showing 21 changed files with 4,630 additions and 4,057 deletions.
3 changes: 3 additions & 0 deletions content/assets/git.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions content/assets/iconfinder_git-branch_298785.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions content/pages/about/about.mdx

This file was deleted.

7 changes: 4 additions & 3 deletions data/SiteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const config = {
"Just a software engineer trying to mesh art and engineering.", // User description to display in the author segment.
// Links to social profiles/projects you want to display in the author segment/navigation bar.
avatar: {
description: "Just a software engineer trying to mesh art and engineering.",
description:
"Uncovering the keys for navigating the landscape of Software Engineering. One Blog at a time.",
photo:
"https://shaunjacks.com/static/426d80516a46be4949bdfd16faafdcb3/b9d37/shaun-coffee-zoom.png",
},
Expand All @@ -38,13 +39,13 @@ const config = {
},
{
label: "email",
url: "mailto:shaun@shaunjacks.com",
url: "mailto:shaunbjackson@gmail.com",
},
],
menuLinks: [
{
name: "Me",
url: "/about-me",
url: "/about",
},
{
name: "Articles",
Expand Down
8 changes: 8 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ module.exports = {
],
},
},
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /assets/,
},
},
},
{
resolve: "gatsby-plugin-google-analytics",
options: {
Expand Down
8,132 changes: 4,283 additions & 3,849 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@emotion/core": "^10.0.21",
"@mdx-js/mdx": "^1.5.1",
"@mdx-js/react": "^1.5.1",
"@theme-ui/color": "^0.3.1",
"@theme-ui/prism": "^0.2.46",
"gatsby": "^2.17.10",
"gatsby-image": "^2.3.4",
Expand All @@ -20,6 +21,7 @@
"gatsby-plugin-offline": "^3.0.11",
"gatsby-plugin-page-creator": "^2.1.27",
"gatsby-plugin-react-helmet": "^3.1.10",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-sharp": "^2.5.6",
"gatsby-plugin-sitemap": "^2.2.16",
"gatsby-plugin-theme-ui": "^0.2.43",
Expand Down
105 changes: 53 additions & 52 deletions src/components/AllCategories.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import React from "react";
import { useStaticQuery, graphql } from "gatsby";
import _ from "lodash";
import { Link } from 'gatsby'
import { Link } from "gatsby";

/** @jsx jsx */
import { Styled, jsx } from "theme-ui";


import { darken, lighten } from "@theme-ui/color";

const AllCategories = () => {
const PostCategories = useStaticQuery(graphql`
const PostCategories = useStaticQuery(graphql`
{
allMdx {
edges {
Expand All @@ -21,54 +20,56 @@ const AllCategories = () => {
}
}
}
`)

const { edges } = PostCategories.allMdx
`);

const categorySet = new Set();
//this erases the duplicates of categories that I have
edges.forEach(element => {
const category = element.node.frontmatter
if(category.category) {
categorySet.add(category.category)
}
});
//this will pass that into an array so that I can loop
const array =[]
categorySet.forEach(cat => {
array.push(cat)
})
const renderCategories = array.map(cat => {
return (
<Styled
key={cat}
as={Link}
to={`/categories/${_.kebabCase(cat)}/`}
sx={{
m: 2,
color: `primary`,
border: `solid 3px`,
borderRadius: `5px`,
textDecoration: `none`,
fontSize:26,
p: 2,
":hover": {
bg: `muted`
}
}}
>
{cat}
</Styled>
);
})
const { edges } = PostCategories.allMdx;

const categorySet = new Set();
//this erases the duplicates of categories that I have
edges.forEach((element) => {
const category = element.node.frontmatter;
if (category.category) {
categorySet.add(category.category);
}
});
//this will pass that into an array so that I can loop
const array = [];
categorySet.forEach((cat) => {
array.push(cat);
});
const renderCategories = array.map((cat) => {
return (
<>
<Styled sx={{ display: `flex`, flexWrap: `wrap`, justifyContent:`center` }}>
{renderCategories}
</Styled>
</>
<Styled
key={cat}
as={Link}
to={`/categories/${_.kebabCase(cat)}/`}
sx={{
m: 2,
color: `primary`,
border: `solid 3px`,
borderRadius: `5px`,
textDecoration: `none`,
fontSize: 26,
p: 2,
":hover": {
bg: lighten("background", 0.1),
},
}}
>
{cat}
</Styled>
);
}
});

return (
<>
<Styled
sx={{ display: `flex`, flexWrap: `wrap`, justifyContent: `center` }}
>
{renderCategories}
</Styled>
</>
);
};

export default AllCategories
export default AllCategories;
11 changes: 8 additions & 3 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ function Footer(props) {
return (
<footer
sx={{
fontSize: 1,
variant: "styles.footer"
width: "100%",
variant: "styles.footer",
backgroundColor: "panelBackground",
color: "panelText",
}}
>
<div
sx={{
display: "flex",
justifyContent: "space-between",
p: 3
alignItems: `center`,
maxWidth: `container`,
m: "auto",
p: 3,
}}
>
<div>
Expand Down
17 changes: 8 additions & 9 deletions src/components/NavMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Styled, jsx } from "theme-ui";

class NavMenu extends React.Component {
state = {
scrolled: false
scrolled: false,
};

componentDidMount() {
Expand Down Expand Up @@ -46,10 +46,10 @@ class NavMenu extends React.Component {
top: 0,
left: 0,
height: `60px`,
backgroundColor: `background`,
backgroundColor: `panelBackground`,
boxShadow: shadow,
m: `auto`,
zIndex: 100
zIndex: 100,
}}
>
<div
Expand All @@ -58,16 +58,15 @@ class NavMenu extends React.Component {
justifyContent: `space-between`,
alignItems: `center`,
maxWidth: `container`,
height: "100%",
m: "auto",
mt: `18px`,
px: 3
}}
>
<Link to="/" sx={{ textDecoration: `none`, color: `primary` }}>
<div>{siteTitle}</div>
<Link to="/" sx={{ textDecoration: `none`, color: `panelText` }}>
<div sx={{ pl: "1rem" }}>{siteTitle}</div>
</Link>
<div style={{ display: `flex`, alignItems: `center` }}>
{menuLinks.map(link => {
{menuLinks.map((link) => {
return (
<Styled.h3
key={link.url}
Expand All @@ -76,7 +75,7 @@ class NavMenu extends React.Component {
sx={{
mr: 3,
textDecoration: `none`,
color: `primary`
color: "panelText",
}}
>
{link.name}
Expand Down
9 changes: 4 additions & 5 deletions src/components/PostHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ import PostTags from "./PostTags";
/** @jsx jsx */
import { Styled, jsx } from "theme-ui";

const PostHeader = props => {
const PostHeader = (props) => {
const { post } = props;

return (
<div sx={{ mb: `-1px`, mx: 2 }}>
<div sx={{ display: `flex`, flexDirection: `column`, color: "text" }}>
<div>
<small sx={{ mr: 2 }}>{post.date}</small>
<small>{post.timeToRead} minute(s)</small>
</div>
<div
sx={{
display: `flex`,
flexWrap: `wrap`,
mt: 2,
alignItems: `baseline`
alignItems: `baseline`,
}}
>
<Styled.p
{/* <Styled.p
as={Link}
sx={{
color: `primary`,
Expand All @@ -42,7 +41,7 @@ const PostHeader = props => {
>
{post.category}
</Styled.p>
<PostTags tags={post.tags} />
<PostTags tags={post.tags} /> */}
</div>
</div>
</div>
Expand Down
50 changes: 50 additions & 0 deletions src/components/PostHeaderLong.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from "react";
import _ from "lodash";
import { Link } from "gatsby";
import PostTags from "./PostTags";

/** @jsx jsx */
import { Styled, jsx } from "theme-ui";

const PostHeaderLong = (props) => {
const { post } = props;

return (
<div sx={{ mb: `-1px`, mx: 2 }}>
<div sx={{ display: `flex`, flexDirection: `column`, color: "text" }}>
<div>
<small sx={{ mr: 2 }}>{post.date}</small>
</div>
<div
sx={{
display: `flex`,
flexWrap: `wrap`,
mt: 2,
alignItems: `baseline`,
}}
>
<Styled.p
as={Link}
sx={{
color: `primary`,
textDecoration: `none`,
border: `solid 1px`,
boxSizing: `content-box`,
display: `inline-block`,
px: `4px`,
borderRadius: `5px`,
p: 1,
mb: `10px`,
mr: 2,
}}
to={`/categories/${_.kebabCase(post.category)}/`}
>
{post.category}
</Styled.p>
</div>
</div>
</div>
);
};

export default PostHeaderLong;
Loading

0 comments on commit 3f31609

Please sign in to comment.