Skip to content

Commit 97cec0f

Browse files
jemgillambenjie
andauthored
feature: News site update (#362)
* News pages * RSS feed * Pagination * Dates for old posts * remove unneeded line in nav * Articles added * uses old template on index page * Number of posts on index page * press kit moved * move worker announcement * Nav menu for news updated * Thumbnails added to index page * Update Starter announcement * News about Worker 0.4 * Better images for Worker articles * thumbnail for Graphile Migrate * Better image for graphile migrate * Custom summary on index page, defaults to excerpt * Worker 0.1 announcement * Starter 3.0 * formatted early PostGraphile articles * PostGraphile 4.8 announcement * Graphile Worker 1.0 * PostGraphile 4.10 * Wroker 0.9 * PostGraphile 4.11 * Nav idea * PostGraphile 4.12 * New real time image works better as thumbnail * GraphQL over SSE * Worker 0.14 * GraphQL Radio * Events articles * Minor articles * Styling of pagination * Last editorial pass * Fix titles * Fix links --------- Co-authored-by: Benjie Gillam <benjie@jemjie.com>
1 parent 28cf0be commit 97cec0f

File tree

63 files changed

+7935
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+7935
-222
lines changed

gatsby-config.js

+73
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
siteMetadata: {
33
title: `Graphile.org`,
4+
description:
5+
"Community funded open source utilities to build powerful, performant and extensible applications rapidly",
6+
siteUrl: "https://graphile.org",
47
},
58
plugins: [
69
`gatsby-plugin-mdx`,
@@ -22,6 +25,13 @@ module.exports = {
2225
name: `data`,
2326
},
2427
},
28+
{
29+
resolve: `gatsby-source-filesystem`,
30+
options: {
31+
path: `${__dirname}/src/news`,
32+
name: `news`,
33+
},
34+
},
2535
{
2636
resolve: `gatsby-transformer-remark`,
2737
options: {
@@ -38,5 +48,68 @@ module.exports = {
3848
},
3949
},
4050
`gatsby-transformer-json`,
51+
{
52+
resolve: `gatsby-plugin-feed`,
53+
options: {
54+
query: `
55+
{
56+
site {
57+
siteMetadata {
58+
title
59+
description
60+
siteUrl
61+
site_url: siteUrl
62+
}
63+
}
64+
}
65+
`,
66+
feeds: [
67+
{
68+
serialize: ({ query: { site, allFile } }) => {
69+
return allFile.nodes.map(({ post: node }) => {
70+
return Object.assign({}, node.frontmatter, {
71+
description: node.excerpt,
72+
date: node.frontmatter.date,
73+
url: site.siteMetadata.siteUrl + node.fields.slug,
74+
guid: site.siteMetadata.siteUrl + node.fields.slug,
75+
custom_elements: [{ "content:encoded": node.html }],
76+
});
77+
});
78+
},
79+
query: /* GraphQL */ `
80+
{
81+
allFile(
82+
filter: { sourceInstanceName: { eq: "news" } }
83+
sort: {
84+
fields: childMarkdownRemark___frontmatter___date
85+
order: DESC
86+
}
87+
) {
88+
nodes {
89+
post: childMarkdownRemark {
90+
excerpt
91+
html
92+
fields {
93+
slug
94+
}
95+
frontmatter {
96+
title
97+
date
98+
}
99+
}
100+
}
101+
}
102+
}
103+
`,
104+
output: "/news/rss.xml",
105+
title: "Graphile News",
106+
// Which URLs to advertise on?
107+
// match: "^/news($|/)",
108+
// optional configuration to specify external rss feed, such as feedburner
109+
// link: "https://feeds.feedburner.com/gatsby/blog",
110+
},
111+
],
112+
},
113+
},
41114
],
42115
};

gatsby-node.js

+22
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
const path = require("path");
22
//const { createFilePath } = require(`gatsby-source-filesystem`);
33

4+
const postsPerPage = 8;
5+
46
exports.createPages = async ({ actions, graphql }) => {
57
const { createPage } = actions;
68

79
const layouts = {
810
page: path.resolve(`src/templates/page.js`),
911
marketing: path.resolve(`src/templates/marketing.js`),
12+
news: path.resolve(`src/templates/news.js`),
1013
home: path.resolve(`src/templates/home.js`),
1114
};
1215

@@ -26,6 +29,9 @@ exports.createPages = async ({ actions, graphql }) => {
2629
}
2730
}
2831
}
32+
news: allFile(filter: { sourceInstanceName: { eq: "news" } }) {
33+
totalCount
34+
}
2935
}
3036
`);
3137
if (result.errors) {
@@ -51,6 +57,22 @@ exports.createPages = async ({ actions, graphql }) => {
5157
},
5258
});
5359
});
60+
61+
// Create blog-list pages
62+
const postCount = result.data.news.totalCount;
63+
const numPages = Math.ceil(postCount / postsPerPage);
64+
Array.from({ length: numPages }).forEach((_, i) => {
65+
createPage({
66+
path: i === 0 ? `/news` : `/news/${i + 1}`,
67+
component: path.resolve("./src/templates/news.js"),
68+
context: {
69+
limit: postsPerPage,
70+
skip: i * postsPerPage,
71+
numPages,
72+
currentPage: i + 1,
73+
},
74+
});
75+
});
5476
};
5577

5678
exports.onCreateNode = ({ node, actions /*, getNode*/ }) => {

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"gatsby": "^2.18.17",
2525
"gatsby-link": "^2.2.11",
2626
"gatsby-plugin-catch-links": "^2.1.7",
27+
"gatsby-plugin-feed": "2.x",
2728
"gatsby-plugin-mdx": "^1.0.36",
2829
"gatsby-plugin-react-helmet": "^3.1.6",
2930
"gatsby-plugin-sass": "^2.1.13",
@@ -78,5 +79,8 @@
7879
},
7980
"optionalDependencies": {
8081
"fsevents": "^2.0.7"
82+
},
83+
"engines": {
84+
"node": "12.x"
8185
}
8286
}

src/components/Layout/index.scss

+4
Original file line numberDiff line numberDiff line change
@@ -1031,3 +1031,7 @@ svg.MarketingDivide {
10311031
margin: 0.5rem;
10321032
padding: 0.5rem;
10331033
}
1034+
1035+
.text-center2 {
1036+
text-align: center;
1037+
}

src/data/nav.json

+127-8
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,161 @@
44
"sections": [
55
{
66
"id": "main",
7-
"title": "Archive"
7+
"title": "Releases"
88
},
99
{
1010
"id": "about",
11-
"title": "About"
11+
"title": "About Graphile"
12+
},
13+
{
14+
"id": "misc",
15+
"title": "Talks, Events & Podcasts"
1216
}
1317
],
1418
"pages": [
19+
{
20+
"to": "/news/20221020-development-support/",
21+
"title": "Development Support Now Available",
22+
"sectionId": "about"
23+
},
24+
{
25+
"to": "/news/20221011-worker-014/",
26+
"title": "Graphile Worker 0.14 - Batch Jobs",
27+
"sectionId": "main"
28+
},
29+
{
30+
"to": "/news/20220714-graphql-radio/",
31+
"title": "GraphQL Radio Appearance",
32+
"sectionId": "misc"
33+
},
34+
{
35+
"to": "/news/20220704-github-readme/",
36+
"title": "Jem's Discussion Panel at GitHub ReadME",
37+
"sectionId": "about"
38+
},
39+
{
40+
"to": "/news/20220607-spec-news/",
41+
"title": "Spec News Pod Launch",
42+
"sectionId": "misc"
43+
},
44+
{
45+
"to": "/news/20220415-graphql-over-sse/",
46+
"title": "GraphQL over SSE",
47+
"sectionId": "main"
48+
},
49+
{
50+
"to": "/news/20211207-graphql-galaxy/",
51+
"title": "Working Group Discussion Panel",
52+
"sectionId": "misc"
53+
},
54+
{
55+
"to": "/news/20211109-graphql-summit/",
56+
"title": "What's Next for the GraphQL Spec in 2022?",
57+
"sectionId": "misc"
58+
},
59+
{
60+
"to": "/news/20210527-postgraphile-412/",
61+
"title": "PostGraphile 4.12 - Awesome Aggregates",
62+
"sectionId": "main"
63+
},
64+
{
65+
"to": "/news/20210129-postgraphile-411/",
66+
"title": "PostGraphile 4.11 - Wonderful Websockets",
67+
"sectionId": "main"
68+
},
69+
{
70+
"to": "/news/20210120-worker-09/",
71+
"title": "Graphile Worker 0.9",
72+
"sectionId": "main"
73+
},
74+
{
75+
"to": "/news/20201208-github-sponsors/",
76+
"title": "GitHub Sponsors Now Available to Organizations",
77+
"sectionId": "about"
78+
},
79+
{
80+
"to": "/news/20201127-postgraphile-410/",
81+
"title": "PostGraphile 4.10 - Framework Friends",
82+
"sectionId": "main"
83+
},
84+
{
85+
"to": "/news/20200922-github-readme/",
86+
"title": "Benjie's Story at GitHub ReadME",
87+
"sectionId": "about"
88+
},
89+
{
90+
"to": "/news/20201127-migrate-1/",
91+
"title": "Graphile Migrate Reaches 1.0 Milestone",
92+
"sectionId": "main"
93+
},
94+
{
95+
"to": "/news/20200805-postgraphile-48/",
96+
"title": "PostGraphile 4.8 - Excellent Enums",
97+
"sectionId": "main"
98+
},
99+
{
100+
"to": "/news/20200721-rita/",
101+
"title": "pgRITA - A Tool for Postgres",
102+
"sectionId": "main"
103+
},
104+
{
105+
"to": "/news/20200427-starter-30/",
106+
"title": "Graphile Starter 3.0",
107+
"sectionId": "main"
108+
},
109+
{
110+
"to": "/news/20200317-migrate-01/",
111+
"title": "Graphile Migrate 0.1",
112+
"sectionId": "main"
113+
},
114+
{
115+
"to": "/news/20200205-worker-04/",
116+
"title": "Graphile Worker 0.4",
117+
"sectionId": "main"
118+
},
119+
{
120+
"to": "/news/20200131-fosdem/",
121+
"title": "Graphile Goes to FOSDEM 2020",
122+
"sectionId": "misc"
123+
},
15124
{
16125
"to": "/news/graphile-starter/",
17-
"title": "Graphile Starter is here",
126+
"title": "Graphile Starter Released",
18127
"sectionId": "main"
19128
},
20129
{
21130
"to": "/news/postgraphile-version-4-5/",
22-
"title": "Version 4.5 - Explain feature",
131+
"title": "PostGraphile 4.5 - Explain Feature",
23132
"sectionId": "main"
24133
},
134+
{
135+
"to": "/news/20191104-reactive-conf/",
136+
"title": "Increasing velocity with GraphQL and Postgres",
137+
"sectionId": "misc"
138+
},
25139
{
26140
"to": "/news/postgraphile-version-4-4/",
27-
"title": "Version 4.4 - Real-time",
141+
"title": "PostGraphile 4.4 - Real-time",
28142
"sectionId": "main"
29143
},
30144
{
31145
"to": "/news/postgraphile-version-4-1/",
32-
"title": "Version 4.1 - Better Webpackability",
146+
"title": "PostGraphile 4.1 - Better Webpackability",
33147
"sectionId": "main"
34148
},
149+
{
150+
"to": "/news/20181023-graphql-finland/",
151+
"title": "Database-Driven GraphQL Development",
152+
"sectionId": "misc"
153+
},
35154
{
36155
"to": "/news/postgraphile-version-4/",
37-
"title": "Version 4 - Fantastic Performance",
156+
"title": "PostGraphile 4.0 - Fantastic Performance",
38157
"sectionId": "main"
39158
},
40159
{
41160
"to": "/news/press-kit/",
42-
"title": "Press Kit",
161+
"title": "Graphile Press Kit",
43162
"sectionId": "about"
44163
}
45164
]
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: post
3+
title: "GraphQL Finland"
4+
date: 2018-10-23T01:00:00Z
5+
path: /news/20181023-graphql-finland/
6+
tags: conference, talks
7+
thumbnail: /images/news/youtube.svg
8+
thumbnailAlt:
9+
"A cartoon developer leans against an oversized laptop showing the YouTube
10+
logo"
11+
12+
summary:
13+
"Benjie gave a talk on Database-Driven GraphQL Development at GraphQL Finland.
14+
Learn how a database-centric approach to GraphQL API development can give your
15+
engineers more time to focus on the important parts of your project."
16+
---
17+
18+
_2018-10-23_
19+
20+
Benjie travelled to [GraphQL Finland](https://graphql-finland.fi/2018/) to give
21+
a talk on Database-Driven GraphQL Development. Learn how a database-centric
22+
approach to GraphQL API development can give your engineers more time to focus
23+
on the important parts of your application. Topics covered included
24+
authorization, adhering to GraphQL best practices, embracing the power of
25+
PostgreSQL, and avoiding common pitfalls.
26+
27+
<div class="tc">
28+
<iframe
29+
width="560"
30+
height="315"
31+
src="https://www.youtube-nocookie.com/embed/XDOrhTXd4pE"
32+
title="YouTube video player"
33+
frameborder="1"
34+
style="border: 6px solid #1b1b3d; border-radius: 10px"
35+
allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
36+
allowfullscreen>
37+
</iframe>
38+
</div>
39+
40+
[You can also find the talk on YouTube here.](https://www.youtube.com/watch?v=XDOrhTXd4pE)

0 commit comments

Comments
 (0)