Skip to content

Commit f032f7d

Browse files
committed
added portfolio boilerplate and sitemap support
1 parent 9d8a135 commit f032f7d

16 files changed

+8869
-7542
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ build/Release
3535
# Dependency directories
3636
node_modules/
3737
jspm_packages/
38+
target/
3839

3940
# Typescript v1 declaration files
4041
typings/
@@ -65,5 +66,6 @@ public
6566
yarn-error.log
6667
.pnp/
6768
.pnp.js
69+
6870
# Yarn Integrity file
6971
.yarn-integrity

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,15 @@ public
6565
yarn-error.log
6666
.pnp/
6767
.pnp.js
68+
6869
# Yarn Integrity file
6970
.yarn-integrity
71+
72+
# SASS/SCSS files
73+
src/sass/
74+
75+
# Markdown files
76+
src/pages/
77+
LICENSE.md
78+
README.md
79+
stackbit.yaml

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ You can [create a site](https://app.stackbit.com/create?theme=https://github.com
5555

5656
npx @stackbit/stackbit-pull --stackbit-pull-api-url=https://api.stackbit.com/pull/60323df295aa610015b59f66 --stackbit-api-key=STACKBIT_API_KEY
5757

58+
5859
1. Start the Gatsby local development server:
5960

6061
npm run develop

gatsby-config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ const siteMetadata = require('./site-metadata.json')
22

33
module.exports = {
44
pathPrefix: '/',
5-
siteMetadata: siteMetadata,
5+
siteMetadata: {
6+
siteUrl: `https://rehnert.co`,
7+
},
68
plugins: [
9+
`gatsby-plugin-advanced-sitemap`,
710
`gatsby-plugin-react-helmet`,
811
`gatsby-source-data`,
912
`gatsby-transformer-remark`,

jsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonJS",
4+
"target": "es6"
5+
},
6+
"exclude": ["node_modules", ".cache", "public"]
7+
}

package-lock.json

Lines changed: 8615 additions & 7422 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "stackbit-fresh-theme",
33
"description": "Stackbit Fresh Theme",
44
"version": "0.0.1",
5+
"prettier": "mj-pa",
56
"license": "MIT",
67
"scripts": {
78
"develop": "gatsby develop",
@@ -12,18 +13,24 @@
1213
"dependencies": {
1314
"@stackbit/gatsby-plugin-menus": "0.0.4",
1415
"acorn": "^6.4.2",
16+
"babel-runtime": "^6.26.0",
1517
"bulma": "^0.9.2",
1618
"chokidar": "^3.4.0",
1719
"classnames": "^2.2.6",
20+
"core-js": "^3.9.1",
21+
"debug": "^4.3.1",
22+
"documentation": "^13.2.0",
1823
"fs-extra": "^7.0.1",
19-
"gatsby": "2.22.17",
24+
"gatsby": "^2.32.11",
25+
"gatsby-plugin-advanced-sitemap": "^1.6.0",
2026
"gatsby-plugin-react-helmet": "^3.3.3",
2127
"gatsby-plugin-sass": "^2.8.0",
2228
"gatsby-source-filesystem": "2.3.10",
2329
"gatsby-transformer-remark": "2.8.14",
2430
"js-yaml": "^3.12.2",
25-
"lodash": "^4.17.11",
31+
"lodash": "^4.17.21",
2632
"marked": "^0.7.0",
33+
"mj-pa": "^1.3.1",
2734
"moment": "^2.23.0",
2835
"moment-strftime": "^0.5.0",
2936
"node-sass": "^4.14.1",
@@ -37,6 +44,7 @@
3744
"rehype-react": "^3.0.2",
3845
"sass": "^1.32.8",
3946
"sprintf-js": "^1.1.2",
47+
"typescript": "^4.2.3",
4048
"yup": "^0.27.0"
4149
}
4250
}

src/pages/posts/how-to-build-an-smtp-mail-server-with-express-node-and-gmail-aof.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ excerpt: >-
88
thumb_img_path: >-
99
https://res.cloudinary.com/practicaldev/image/fetch/s--U2LLP4Iw--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/de3p75v2w0yfb2sxcgpy.jpg
1010
comments_count: 5
11-
positive_reactions_count: 226
11+
positive_reactions_count: 227
1212
tags:
1313
- tutorial
1414
- node

src/pages/posts/new-wordpress-admin-color-palette-1001.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,15 @@ Oh, and if you're a WP plugin developer, listen up because this applies to you t
2626

2727
In his February post, [Standardization of WP-Admin colors in WordPress 5.7](https://make.wordpress.org/core/2021/02/23/standardization-of-wp-admin-colors-in-wordpress-5-7/), WP Core dev [Jb Audras](https://profiles.wordpress.org/audrasjb/) offered the following in-depth summary, and I quote:
2828

29-
---
30-
31-
> "This is the first part of a larger project in cleaning up WordPress admin CSS. In WordPress 5.7, all colors used in the CSS are collapsed to one of 12 blues, greens, reds, and yellows, 13 grays, pure black, and pure white.
32-
>
33-
> This new streamlined color palette collapses all the colors that used to be in the WordPress source code down to seven core colors and a range of 56 shades that meet the WCAG 2.0 AA recommended contrast ratio against white or black.
29+
> _This is the first part of a larger project in cleaning up WordPress admin CSS. In WordPress 5.7, all colors used in the CSS are collapsed to one of 12 blues, greens, reds, and yellows, 13 grays, pure black, and pure white._
3430
>
35-
> The colors are perceptually uniform from light to dark in each range, which means they start at white and get darker by the same amount with each step. Half the range has a 4.5 or higher contrast ratio against black, and the other half maintains the same contrast against white.
31+
> _This new streamlined color palette collapses all the colors that used to be in the WordPress source code down to seven core colors and a range of 56 shades that meet the WCAG 2.0 AA recommended contrast ratio against white or black._
3632
>
37-
> Standardizing on this set of colors will help contributors make consistent, accessible design decisions. Themes and Plugin developers are encouraged to use this new color palette for better consistency between their products and WordPress Core.
33+
> _The colors are perceptually uniform from light to dark in each range, which means they start at white and get darker by the same amount with each step. Half the range has a 4.5 or higher contrast ratio against black, and the other half maintains the same contrast against white._
34+
>
35+
> _Standardizing on this set of colors will help contributors make consistent, accessible design decisions. Themes and Plugin developers are encouraged to use this new color palette for better consistency between their products and WordPress Core._
3836
>
39-
> **Plugin authors that use the existing CSS Core classes should be all set up with the new color palette, as every Core class was updated accordingly."**
40-
41-
---
37+
> _Plugin authors that use the existing CSS Core classes should be all set up with the new color palette, as every Core class was updated accordingly._
4238
4339
Need/want more details? Check out the official [Design Handbook](https://make.wordpress.org/design/handbook/foundations/colors) or the CodePen palette shown below.
4440

src/pages/projects/index.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Portfolio
3+
seo:
4+
title: Portfolio
5+
description: My Portfolio, featuring a curated selection of my best projects, sorted by date of completion.
6+
extra:
7+
- name: "og:type"
8+
value: website
9+
keyName: property
10+
- name: "og:title"
11+
value: Blog
12+
keyName: property
13+
- name: "og:description"
14+
value: This is the blog page
15+
keyName: property
16+
- name: "og:image"
17+
value: images/1.jpg
18+
keyName: property
19+
relativeUrl: true
20+
- name: "twitter:card"
21+
value: summary_large_image
22+
- name: "twitter:title"
23+
value: Portfolio
24+
- name: "twitter:description"
25+
value: This is the blog page
26+
- name: "twitter:image"
27+
value: images/1.jpg
28+
relativeUrl: true
29+
template: blog
30+
---

src/sass/imports/_general.scss

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ pre {
113113
}
114114

115115
blockquote {
116-
border-bottom: 1px solid _palette(secondary);
117-
border-top: 3px solid _palette(secondary);
118-
font-size: 1.88889em;
116+
font-family: _font(body);
117+
color: _palette(txtp10);
118+
border-left: 10px solid _palette(accent);
119+
border-bottom: 4px solid _palette(primary);
120+
border-top: 4px solid _palette(primary);
121+
font-size: 1.11111em;
119122
line-height: 1.25;
120123
margin: 2rem 0;
121124
padding-bottom: 1.66667rem;
@@ -126,7 +129,8 @@ blockquote {
126129
}
127130

128131
p {
129-
margin-bottom: 0.5em;
132+
margin-bottom: 0.66667em;
133+
padding-left: 1.33333rem;
130134

131135
&:last-child {
132136
margin-bottom: 0;
@@ -135,7 +139,7 @@ blockquote {
135139

136140
small,
137141
cite {
138-
color: _palette(txtmet);
142+
color: _palette(acchyp);
139143
display: block;
140144
font-size: 0.52941em;
141145
font-style: normal;
@@ -471,6 +475,10 @@ img {
471475
}
472476

473477
blockquote {
474-
font-size: 1.55556em;
478+
background: _palette(secondary);
479+
border-left: 10px solid _palette(acchyp);
480+
margin: 1.5em 10px;
481+
padding: 1em 10px .1em 10px;
482+
quotes: "\201C""\201D""\2018""\2019";
475483
}
476484
}

src/sass/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $palette: (primary: #111A20,
1818
border: #416782,
1919
accent: #1CEDCA,
2020
acchyp: #BAEDA5,
21+
accqte: #F05D5E,
2122
accent-blue: #10bcf9,
2223
accent-violet: #9371e6,
2324
accent-orange: #fc6e51,

src/templates/portfolio.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import React from 'react'
2+
import _ from 'lodash'
3+
import moment from 'moment-strftime'
4+
import { graphql } from 'gatsby'
5+
6+
import { Layout } from '../components/index'
7+
import { getPages, Link, withPrefix } from '../utils'
8+
9+
// this minimal GraphQL query ensures that when 'gatsby develop' is running,
10+
// any changes to content files are reflected in browser
11+
export const query = graphql`
12+
query($url: String) {
13+
sitePage(path: { eq: $url }) {
14+
id
15+
}
16+
}
17+
`
18+
19+
export default class Portfolio extends React.Component {
20+
render() {
21+
let display_projects = _.orderBy(
22+
getPages(this.props.pageContext.pages, '/projects'),
23+
'frontmatter.date',
24+
'desc'
25+
)
26+
return (
27+
<Layout {...this.props}>
28+
<header className='screen-reader-text'>
29+
<h1>{_.get(this.props, 'pageContext.frontmatter.title', null)}</h1>
30+
</header>
31+
<div className='post-feed'>
32+
<div className='post-feed-inside'>
33+
{_.map(display_posts, (post, post_idx) => (
34+
<article key={post_idx} className='post post-card'>
35+
<div className='post-inside'>
36+
{_.get(post, 'frontmatter.thumb_img_path', null) && (
37+
<Link className='post-thumbnail' to={withPrefix(_.get(post, 'url', null))}>
38+
<img
39+
src={withPrefix(_.get(post, 'frontmatter.thumb_img_path', null))}
40+
alt={_.get(post, 'frontmatter.thumb_img_alt', null)}
41+
/>
42+
</Link>
43+
)}
44+
<header className='post-header'>
45+
<h2 className='post-title'>
46+
<Link to={withPrefix(_.get(post, 'url', null))} rel='bookmark'>
47+
{_.get(post, 'frontmatter.title', null)}
48+
</Link>
49+
</h2>
50+
</header>
51+
{_.get(post, 'frontmatter.excerpt', null) && (
52+
<div className='post-content'>
53+
<p>{_.get(post, 'frontmatter.excerpt', null)}</p>
54+
</div>
55+
)}
56+
<footer className='post-meta'>
57+
<time
58+
className='published'
59+
dateTime={moment(_.get(post, 'frontmatter.date', null)).strftime(
60+
'%Y-%m-%d %H:%M'
61+
)}>
62+
{moment(_.get(post, 'frontmatter.date', null)).strftime('%B %d, %Y')}
63+
</time>
64+
</footer>
65+
</div>
66+
</article>
67+
))}
68+
</div>
69+
</div>
70+
</Layout>
71+
)
72+
}
73+
}

0 commit comments

Comments
 (0)