Skip to content

Commit 8d725ba

Browse files
authored
Merge pull request #30 from clean-commit/next
1.1.0 Update -
2 parents 12999c0 + 6512961 commit 8d725ba

24 files changed

+2333
-3336
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.13.0
1+
v18.12.1

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 1.1.0 - January 4, 2022
4+
5+
**BREAKING CHANGES**
6+
- Support for Gatsby v5 added
7+
- `react-helmet` removed, SEO partials moved to Head API
8+
- `yarn start` renamed to `yarn dev`
9+
10+
**Minor changes**
11+
- `classnames` removed, `clsx` added
12+
- Language definition added to `gatsby-ssr.js`
13+
- Removed unnused packages
14+
15+
**Bug Fixes**
16+
- Improved darkmode toggle component - issue with hydration
17+
- Resolved minor warnings issues
18+
319
## 1.0.1 - October 22, 2022
420

521
**Minor changes**

README.md

+13-30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Henlo Starter](https://repository-images.githubusercontent.com/270961687/4085d990-9083-451d-b39b-5316579adf09)
22

3-
# Gatsby Starter Henlo (v1.0.0)
3+
# Gatsby Starter Henlo (v1.1.0)
44

55
[![Netlify Status](https://api.netlify.com/api/v1/badges/43532afb-3488-432b-8185-a745645a90d8/deploy-status)](https://app.netlify.com/sites/henlo/deploys)
66

@@ -14,15 +14,16 @@ It follows the [JAMstack architecture](https://jamstack.org) by using Git as a s
1414

1515
## Features
1616

17+
- Support for Gatsby v5
1718
- 💪 Battle-tested starting point for small & large web projects
1819
- 📄 Form Builder that enables Admins to create multiple forms with ease & Netlify Forms integration.
1920
- 🌗 Darkmode support
2021
- 🗺 Sitemaps using `gatsby-plugin-sitemap`
2122
- 🔥 Perfect score on Lighthouse for SEO, Accessibility and Performance
22-
- 💇‍♀️ TailwindCSS support with PostCSS processing & PurgeCSS
23+
- 💇‍♀️ TailwindCSS support with PostCSS
2324
- 🔌 Support for Gatsby API functions
2425
- 🎇 Crazy fast images with `gatsby-plugin-image`
25-
- 🕵️‍♂️ Complete SEO configuration with graphql fragment and reusable components
26+
- 🕵️‍♂️ Complete SEO configuration with graphql fragment and reusable components based on Head API
2627
- Netlify deploy configuration
2728
- Example pages, collections, CMS configuration with Netlify CMS & hooks
2829
- Readme template for custom projects
@@ -31,7 +32,7 @@ It follows the [JAMstack architecture](https://jamstack.org) by using Git as a s
3132

3233
## Prerequisites
3334

34-
- Node 16.13
35+
- Node 18
3536
- [Gatsby CLI](https://www.gatsbyjs.org/docs/)
3637
- [Netlify CLI](https://github.com/netlify/cli)
3738

@@ -48,7 +49,7 @@ After clicking that button, you’ll authenticate with GitHub and choose a repos
4849
```
4950
$ gatsby new [SITE_DIRECTORY_NAME] https://github.com/clean-commit/gatsby-starter-henlo
5051
$ cd [SITE_DIRECTORY_NAME]
51-
$ yarn start
52+
$ yarn dev
5253
```
5354

5455
### Access Locally
@@ -58,13 +59,13 @@ Pulldown a local copy of the Github repository Netlify created for you, with the
5859
```
5960
$ git clone https://github.com/[GITHUB_USERNAME]/[REPO_NAME].git
6061
$ cd [REPO_NAME]
61-
$ yarn && yarn start
62+
$ yarn && yarn dev
6263
```
6364

6465
To test the CMS locally, you'll need run a production build of the site & [run local instance of Netlify CMS](https://www.netlifycms.org/docs/beta-features/#working-with-a-local-git-repository)
6566

6667
```
67-
$ yarn start
68+
$ yarn dev
6869
$ npx netlify-cms-proxy-server
6970
```
7071

@@ -113,6 +114,7 @@ The website will build locally and then deploy to production.
113114
│ └── post.js
114115
├── static
115116
├── _headers
117+
├── .env.example # Example env -> GATSBY_APP_URL is required to run the app
116118
├── gatsby-config.js # Config files for gatsby
117119
├── gatsby-node.js # Page generation setup
118120
└── tailwind.config.js # Tailwind configuration
@@ -122,6 +124,9 @@ The website will build locally and then deploy to production.
122124

123125
Follow the [Netlify CMS Quick Start Guide](https://www.netlifycms.org/docs/quick-start/#authentication) to set up authentication, and hosting.
124126

127+
**Important**
128+
This template can be mostly changed by the user within the CMS itself (Settings type). For sitemaps to work correctly, you'll need to provide ENV variable `GATSBY_APP_URL` which defaults to https://example.com, this url will be used in setting up meta values in the head of the documents and links URL in the CMS.
129+
125130
CMS configuration was placed within `cms` directory in the root of the project. This allows us to work efficiently on fields and collections without mixing CMS config with Gatsby code.
126131

127132
Henlo uses Manual Initialization to take advantage of componetized approach to managing configuration for Netlify CMS. Thanks to that you don't have to control the CMS from centralized YAML file.
@@ -250,36 +255,14 @@ Favicons can be generated using this [Favicon Generator](https://www.favicon-gen
250255
Since 0.4.0 Henlo supports [`gatsby-plugin-preload-fonts`](https://www.gatsbyjs.com/plugins/gatsby-plugin-preload-fonts/) plugin out of the box. To create the preload cache you need to start development server and then run `preload-fonts` command. This will generate the `font-preload-cache.json` file in the root of your project. When your projects builds fonts will be added automatically to head of the document.
251256
252257
```
253-
yarn start
258+
yarn dev
254259
yarn preload-fonts
255260
```
256261
257262
## Browser support
258263
259264
Gatsby tends to add a lot of polyfills to support older browser versions. In package.json file you can adjust which sites your project should support. As default Henlo will use `defaults` setting. If you want to learn more about the browser support visit official [Gatsby How-To Guide on this subject](https://www.gatsbyjs.com/docs/how-to/custom-configuration/browser-support/)
260265
261-
## PurgeCSS
262-
263-
This plugin uses [gatsby-plugin-purgecss](https://www.gatsbyjs.org/packages/gatsby-plugin-purgecss/) and [Tailwind](https://tailwindcss.com/). The builds are usually ~780K but reduced 98% by purgecss. Normally our websites won't cross 30Kb of CSS.
264-
265-
Since Henlo v0.5.0 we use PurgeCSS v4, the default configuration is already included, to learn more [check purgecss docs](https://purgecss.com/configuration.html) or [check gatsby-plugin-purgecss documentation](https://www.gatsbyjs.com/plugins/gatsby-plugin-purgecss/)
266-
267-
```javascript
268-
{
269-
resolve: `gatsby-plugin-purgecss`,
270-
options: {
271-
printRejected: true,
272-
develop: false,
273-
tailwind: true,
274-
purgeCSSOptions: {
275-
safelist: {
276-
standard: [],
277-
deep: [],
278-
},
279-
},
280-
},
281-
},
282-
```
283266
284267
# CONTRIBUTING
285268

gatsby-config.js

+9-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
const path = require('path');
1+
const path = require('path')
22
require('dotenv').config({
33
path: `.env.${process.env.NODE_ENV}`,
4-
});
4+
})
55

66
module.exports = {
77
siteMetadata: {
8-
siteUrl: process.env.GATSBY_APP_URL,
8+
siteUrl: process.env.GATSBY_APP_URL || 'http://localhost:8000',
9+
},
10+
flags: {
11+
DEV_SSR: true,
912
},
1013
plugins: [
1114
'gatsby-plugin-sharp',
@@ -14,20 +17,6 @@ module.exports = {
1417
'gatsby-plugin-image',
1518
'gatsby-plugin-dark-mode',
1619
'gatsby-plugin-postcss',
17-
{
18-
resolve: `gatsby-plugin-purgecss`,
19-
options: {
20-
printRejected: true,
21-
develop: false,
22-
tailwind: true,
23-
purgeCSSOptions: {
24-
safelist: {
25-
standard: [],
26-
deep: [],
27-
},
28-
},
29-
},
30-
},
3120
{
3221
resolve: 'gatsby-plugin-brotli',
3322
},
@@ -56,7 +45,8 @@ module.exports = {
5645
{
5746
resolve: 'gatsby-plugin-sitemap',
5847
options: {
59-
resolveSiteUrl: () => process.env.GATSBY_APP_URL,
48+
resolveSiteUrl: () =>
49+
process.env.GATSBY_APP_URL || 'https://www.example.com',
6050
},
6151
},
6252
{
@@ -73,7 +63,6 @@ module.exports = {
7363
name: 'pages',
7464
},
7565
},
76-
'gatsby-plugin-react-helmet',
7766
{
7867
resolve: 'gatsby-plugin-root-import',
7968
options: {
@@ -92,4 +81,4 @@ module.exports = {
9281
},
9382
'gatsby-plugin-netlify', // make sure to keep it last in the array
9483
],
95-
};
84+
}

gatsby-ssr.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const seoData = require('./src/settings/seo.json')
2+
3+
exports.onRenderBody = ({ setHtmlAttributes }) => {
4+
setHtmlAttributes({ lang: seoData?.lang || 'en' })
5+
}

package.json

+31-35
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,58 @@
11
{
22
"name": "gatsby-starter-henlo",
3-
"description": "Minimalistic starter for Gatsby v4, optimized for SEO & Performance.",
4-
"version": "1.0.1",
3+
"description": "Minimalistic starter for Gatsby v5, optimized for SEO & Performance.",
4+
"version": "1.1.0",
55
"author": "Wojciech Kałużny <[email protected]>",
66
"browserslist": [
77
"defaults"
88
],
99
"dependencies": {
10-
"babel-preset-gatsby": "^2.24.0",
11-
"classnames": "^2.2.6",
12-
"gatsby": "^4.24.0",
10+
"clsx": "^1.2.1",
11+
"gatsby": "^5.3.3",
1312
"gatsby-plugin-brotli": "^2.1.0",
1413
"gatsby-plugin-dark-mode": "^1.1.2",
15-
"gatsby-plugin-image": "^2.9.0",
16-
"gatsby-plugin-netlify": "^4.1.0",
17-
"gatsby-plugin-netlify-cms": "^6.9.0",
18-
"gatsby-plugin-postcss": "^5.20.0",
19-
"gatsby-plugin-preload-fonts": "^3.9.0",
20-
"gatsby-plugin-purgecss": "^6.0.0",
21-
"gatsby-plugin-react-helmet": "^5.9.0",
14+
"gatsby-plugin-image": "^3.3.2",
15+
"gatsby-plugin-netlify": "^5.1.0",
16+
"gatsby-plugin-netlify-cms": "^7.3.0",
17+
"gatsby-plugin-postcss": "^6.3.0",
18+
"gatsby-plugin-preload-fonts": "^4.3.1",
2219
"gatsby-plugin-root-import": "^2.0.6",
23-
"gatsby-plugin-sharp": "^4.24.0",
24-
"gatsby-plugin-sitemap": "^5.20.0",
20+
"gatsby-plugin-sharp": "^5.3.2",
21+
"gatsby-plugin-sitemap": "^6.3.1",
2522
"gatsby-plugin-svgr-loader": "^0.1.0",
26-
"gatsby-remark-copy-linked-files": "^3.0.0",
27-
"gatsby-remark-images": "^6.9.0",
23+
"gatsby-remark-copy-linked-files": "^6.3.0",
24+
"gatsby-remark-images": "^7.3.1",
2825
"gatsby-remark-relative-images": "^2.0.2",
29-
"gatsby-source-filesystem": "^4.9.0",
30-
"gatsby-transformer-remark": "^5.9.0",
31-
"gatsby-transformer-sharp": "^4.9.0",
32-
"lodash": "^4.17.21",
33-
"lodash-webpack-plugin": "^0.11.6",
26+
"gatsby-source-filesystem": "^5.3.1",
27+
"gatsby-transformer-remark": "^6.3.2",
28+
"gatsby-transformer-sharp": "^5.3.1",
3429
"netlify-cms-app": "^2.14.29",
3530
"netlify-cms-widget-id": "^1.0.1",
3631
"netlify-cms-widget-permalink": "^1.0.2",
3732
"parcel-bundler": "^1.9.4",
3833
"path-browserify": "^1.0.1",
3934
"prop-types": "^15.6.0",
40-
"react": "^17.0.1",
41-
"react-dom": "^17.0.1",
35+
"react": "^18.2.0",
36+
"react-dom": "^18.2.0",
4237
"react-helmet": "^6.1.0",
43-
"react-hook-form": "^7.34.0",
44-
"react-markdown": "^8.0.3"
38+
"react-hook-form": "^7.41.3",
39+
"react-markdown": "^8.0.4"
4540
},
4641
"keywords": [
4742
"gatsby"
4843
],
4944
"license": "MIT",
5045
"main": "n/a",
5146
"scripts": {
52-
"init": "netlify init",
53-
"link": "netlify link",
54-
"clean": "gatsby clean",
55-
"start": "npm run develop",
56-
"build": "npm run clean && gatsby build",
47+
"start": "gatsby serve",
48+
"dev": "npm run develop",
5749
"develop": "npm run clean && gatsby develop",
50+
"build": "npm run clean && gatsby build",
5851
"serve:prod": "npm run clean && gatsby build && gatsby serve",
5952
"build:prod": "netlify build",
53+
"init": "netlify init",
54+
"link": "netlify link",
55+
"clean": "gatsby clean",
6056
"deploy": "npm run clean && netlify build && netlify deploy",
6157
"deploy:prod": "npm run clean && netlify build && netlify deploy --prod",
6258
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",
@@ -67,10 +63,10 @@
6763
"@tailwindcss/forms": "^0.5.0",
6864
"@tailwindcss/typography": "^0.5.2",
6965
"autoprefixer": "^10.4.2",
70-
"postcss": "^8.4.16",
71-
"postcss-nested": "^5.0.6",
72-
"prettier": "^2.2.1",
73-
"prettier-plugin-tailwindcss": "^0.1.13",
66+
"postcss": "^8.4.20",
67+
"postcss-nested": "^6.0.0",
68+
"prettier": "^2.8.1",
69+
"prettier-plugin-tailwindcss": "^0.2.1",
7470
"tailwindcss": "^3.0.23"
7571
}
76-
}
72+
}

src/blocks/ContentImage.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,51 @@
1-
import React from 'react';
2-
import Image from '../resolvers/Image';
3-
import Container from '../components/UI/Container';
4-
import Text from '../components/UI/Text';
5-
import Title from '../components/UI/Title';
6-
import Buttons from '../components/UI/Buttons';
7-
import classNames from 'classnames';
1+
import React from 'react'
2+
import Image from '../resolvers/Image'
3+
import Container from '../components/UI/Container'
4+
import Text from '../components/UI/Text'
5+
import Title from '../components/UI/Title'
6+
import Buttons from '../components/UI/Buttons'
7+
import clsx from 'clsx'
88

99
export default function ContentImage({ data }) {
10-
const isReversed = data?.variant === 'reversed';
10+
const isReversed = data?.variant === 'reversed'
1111
return (
12-
<section className='py-20 lg:py-32'>
13-
<Container className='max-w-7xl'>
12+
<section className="py-20 lg:py-32">
13+
<Container className="max-w-7xl">
1414
<div
15-
className={classNames(
15+
className={clsx(
1616
'flex flex-col items-center justify-center gap-4 md:gap-6 lg:gap-10',
1717
{ 'md:flex-row-reverse': isReversed },
1818
{ 'md:flex-row': !isReversed },
19-
)}>
20-
<div className='lg:w-1/2'>
19+
)}
20+
>
21+
<div className="lg:w-1/2">
2122
{data?.photo?.image && (
2223
<Image
2324
src={data?.photo?.image}
2425
alt={data?.photo?.alt}
25-
className='w-full'
26+
className="w-full"
2627
/>
2728
)}
2829
</div>
29-
<div className='lg:w-1/2'>
30-
<div className='mx-auto max-w-2xl'>
30+
<div className="lg:w-1/2">
31+
<div className="mx-auto max-w-2xl">
3132
{data?.title && (
32-
<Title Tag='h2' variant='lg'>
33+
<Title Tag="h2" variant="lg">
3334
{data?.title}
3435
</Title>
3536
)}
3637
{data?.content && (
37-
<Text className='mt-4 lg:text-lg lg:leading-relaxed'>
38+
<Text className="mt-4 lg:text-lg lg:leading-relaxed">
3839
{data?.content}
3940
</Text>
4041
)}
4142
{data?.buttons && (
42-
<Buttons buttons={data?.buttons} className='mt-4' />
43+
<Buttons buttons={data?.buttons} className="mt-4" />
4344
)}
4445
</div>
4546
</div>
4647
</div>
4748
</Container>
4849
</section>
49-
);
50+
)
5051
}

0 commit comments

Comments
 (0)