Skip to content

Commit 6b86771

Browse files
authored
website redesign (#7454)
1 parent c0c8df5 commit 6b86771

File tree

233 files changed

+10412
-6842
lines changed

Some content is hidden

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

233 files changed

+10412
-6842
lines changed

.github/workflows/publish-website.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ jobs:
5050
run: yarn --immutable --network-timeout 100000
5151
working-directory: website
5252

53+
- name: Unzip Icons
54+
run: |
55+
sudo apt-get install -y unzip
56+
unzip -P ${{ secrets.ICON_PASSWORD }} src/images/icons.zip -d src/images/
57+
working-directory: website
58+
5359
- name: Build Website
5460
run: yarn build --prefix-paths
5561
working-directory: website

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 ChilliCream Inc. (Michael & Rafael Staib)
3+
Copyright (c) 2024 ChilliCream Inc. (Michael & Rafael Staib)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

website/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ public
6666

6767
# Mac files
6868
.DS_Store
69+
70+
# to prevent upload any font awesome icons to github
71+
src/images/icons/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

website/gatsby-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// https://github.com/FormidableLabs/prism-react-renderer/issues/53#issuecomment-546653848
22
import Prism from "prismjs";
3-
import "prismjs/themes/prism-tomorrow.css";
3+
import "./src/style/prism-theme.css";
44

55
(typeof global !== "undefined" ? global : window).Prism = Prism;
66
require("prismjs/components/prism-csharp");

website/gatsby-config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ module.exports = {
1111
repositoryUrl: `https://github.com/ChilliCream/graphql-platform`,
1212
tools: {
1313
bcp: `https://eat.bananacakepop.com`,
14+
blog: `/blog`,
1415
github: `https://github.com/ChilliCream/graphql-platform`,
1516
linkedIn: `https://www.linkedin.com/company/chillicream`,
1617
shop: `https://store.chillicream.com`,
1718
slack: `https://slack.chillicream.com/`,
18-
twitter: `https://twitter.com/Chilli_Cream`,
1919
youtube: `https://www.youtube.com/c/ChilliCream`,
20+
x: `https://x.com/Chilli_Cream`,
2021
},
2122
},
2223
plugins: [
@@ -109,15 +110,15 @@ module.exports = {
109110
options: {
110111
rule: {
111112
include: /images/,
112-
exclude: /images\/(artwork|brands|companies|logo)\/.*\.svg$/,
113+
exclude: /images\/(artwork|companies|icons|logo)\/.*\.svg$/,
113114
},
114115
},
115116
},
116117
{
117118
resolve: require.resolve(`./plugins/gatsby-plugin-svg-sprite`),
118119
options: {
119120
rule: {
120-
test: /images\/(artwork|brands|companies|logo)\/.*\.svg$/,
121+
test: /images\/(artwork|companies|icons|logo)\/.*\.svg$/,
121122
},
122123
},
123124
},
@@ -140,7 +141,7 @@ module.exports = {
140141
resolve: "gatsby-plugin-web-font-loader",
141142
options: {
142143
google: {
143-
families: ["Roboto"],
144+
families: ["Radio Canada:400,500,600,700"],
144145
},
145146
},
146147
},
@@ -150,8 +151,8 @@ module.exports = {
150151
name: `ChilliCream GraphQL`,
151152
short_name: `ChilliCream`,
152153
start_url: `/`,
153-
background_color: `#3b4f74`,
154-
theme_color: `#3b4f74`,
154+
background_color: `#0a0721`,
155+
theme_color: `#0a0721`,
155156
display: `standalone`,
156157
icon: `src/images/chillicream-favicon.png`,
157158
},

website/gatsby-node.js

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
3131
fields {
3232
slug
3333
}
34+
frontmatter {
35+
tags
36+
}
3437
}
3538
tags: group(field: frontmatter___tags) {
3639
fieldValue
@@ -68,9 +71,9 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
6871
return;
6972
}
7073

71-
createBasicPages(createPage, result.data.basic);
74+
createDefaultArticles(createPage, result.data.basic);
7275
createBlogArticles(createPage, result.data.blog);
73-
createDocPages(createPage, result.data.docs);
76+
createDocArticles(createPage, result.data.docs);
7477

7578
const products = result.data.productsConfig.products;
7679
const latestHcVersion = products?.find(
@@ -164,8 +167,8 @@ exports.onCreateNode = async ({ node, actions, getNode, reporter }) => {
164167
});
165168
};
166169

167-
function createBasicPages(createPage, data) {
168-
const component = path.resolve(`src/templates/basic-page-template.tsx`);
170+
function createDefaultArticles(createPage, data) {
171+
const component = path.resolve(`src/templates/default-article-template.tsx`);
169172

170173
data.pages.forEach((page) => {
171174
createPage({
@@ -180,48 +183,59 @@ function createBasicPages(createPage, data) {
180183

181184
function createBlogArticles(createPage, data) {
182185
// Create Single Pages
183-
let component = path.resolve(`src/templates/blog-article-template.tsx`);
184-
185186
data.posts.forEach((post) => {
186187
createPage({
187188
path: post.fields.slug,
188-
component,
189+
component: path.resolve(`src/templates/blog-article-template.tsx`),
189190
context: {},
190191
});
191192
});
192193

194+
const postsPerPage = 21;
195+
193196
// Create List Pages
194-
const postsPerPage = 20;
195-
const numPages = Math.ceil(data.posts.length / postsPerPage);
197+
const numPagesAllPosts = Math.ceil(data.posts.length / postsPerPage);
196198

197-
Array.from({ length: numPages }).forEach((_, i) => {
199+
Array.from({ length: numPagesAllPosts }).forEach((_, i) => {
198200
createPage({
199201
path: i === 0 ? `/blog` : `/blog/${i + 1}`,
200202
component: path.resolve(`src/templates/blog-articles-template.tsx`),
201203
context: {
202204
limit: postsPerPage,
203205
skip: i * postsPerPage,
204-
numPages,
206+
numPages: numPagesAllPosts,
205207
currentPage: i + 1,
206208
},
207209
});
208210
});
209211

210212
// Create Tag Pages
211-
component = path.resolve(`src/templates/blog-tag-template.tsx`);
212-
data.tags.forEach((tag) => {
213-
createPage({
214-
path: `/blog/tags/${tag.fieldValue}`,
215-
component,
216-
context: {
217-
tag: tag.fieldValue,
218-
},
213+
data.tags.forEach(({ fieldValue: tag }) => {
214+
const numPagesPostsByTags = Math.ceil(
215+
data.posts.filter(({ frontmatter: { tags } }) => tags.includes(tag))
216+
.length / postsPerPage
217+
);
218+
219+
Array.from({ length: numPagesPostsByTags }).forEach((_, i) => {
220+
createPage({
221+
path: i === 0 ? `/blog/tags/${tag}` : `/blog/tags/${tag}/${i + 1}`,
222+
component: path.resolve(
223+
`src/templates/blog-articles-by-tag-template.tsx`
224+
),
225+
context: {
226+
tag,
227+
limit: postsPerPage,
228+
skip: i * postsPerPage,
229+
numPages: numPagesPostsByTags,
230+
currentPage: i + 1,
231+
},
232+
});
219233
});
220234
});
221235
}
222236

223-
function createDocPages(createPage, data) {
224-
const component = path.resolve(`src/templates/doc-page-template.tsx`);
237+
function createDocArticles(createPage, data) {
238+
const component = path.resolve(`src/templates/doc-article-template.tsx`);
225239

226240
// Create Single Pages
227241
data.pages.forEach((page) => {

0 commit comments

Comments
 (0)