├── .gitignore
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── LICENSE
├── README.md
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── package-lock.json
├── package.json
├── src
├── components
│ ├── layout.js
│ ├── layout.scss
│ ├── navbar.js
│ └── seo.js
├── hooks
│ └── use-site-metadata.js
├── images
│ ├── gatsby-astronaut.png
│ └── gatsby-icon.png
└── pages
│ ├── 404.js
│ ├── about.js
│ ├── index.js
│ └── page-2.js
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (http://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # Typescript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # dotenv environment variable files
55 | .env*
56 |
57 | # gatsby files
58 | .cache/
59 | public
60 |
61 | # Mac files
62 | .DS_Store
63 |
64 | # Yarn
65 | yarn-error.log
66 | .pnp/
67 | .pnp.js
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 |
72 | #Intellij editor
73 | .idea
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | lts/*
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .cache
2 | package.json
3 | package-lock.json
4 | public
5 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "arrowParens": "avoid",
3 | "semi": false
4 | }
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The BSD Zero Clause License (0BSD)
2 |
3 | Copyright (c) 2020 Gatsby Inc.
4 |
5 | Permission to use, copy, modify, and/or distribute this software for any
6 | purpose with or without fee is hereby granted.
7 |
8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 | PERFORMANCE OF THIS SOFTWARE.
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Gatsby Bootstrap 5 starter
8 |
9 |
10 |
11 | Minimal bootstrap 5 and Gatsby configuration with SCSS support.
12 |
13 | Demo here : https://gatsbystarterbootstrap5.gatsbyjs.io/
14 |
15 | ## 📋 Available options
16 |
17 | - You can theme bootstrap via `src/components/layout.scss`
18 |
19 | ## 🚀 How to install
20 |
21 | Use the Gatsby CLI to create a new site.
22 |
23 | ```shell
24 | # create a new Gatsby site using the default starter
25 | gatsby new gatsby-starter-bootstrap-5 https://github.com/r-ichard/gatsby-starter-bootstrap-5
26 | ```
27 |
28 |
29 | ## ✏️ How to develop locally
30 |
31 | 1. Navigate into your new site’s directory and start it up.
32 |
33 | ```shell
34 | cd gatsby-starter-bootstrap-5/
35 | gatsby develop
36 | ```
37 |
38 | 1. **Open the source code and start editing!**
39 |
40 | Your site is now running at `http://localhost:8000`!
41 |
42 | _Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.com/tutorial/part-five/#introducing-graphiql)._
43 |
44 | Open the `gatsby-starter-bootstrap-5` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time!
45 |
46 | ## 💡 How to contribute
47 |
48 | Any feedback is welcome and helpful.
--------------------------------------------------------------------------------
/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | import "bootstrap/dist/js/bootstrap.min.js";
2 | import "@popperjs/core/dist/umd/popper.min.js";
--------------------------------------------------------------------------------
/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | siteMetadata: {
3 | title: `Gatsby Boostrap 5 Sass Starter`,
4 | description: `A simple bootstrap 5 and Sass starter for Gatsby. This barebones starter ships with the main Gatsby configuration files you might need.`,
5 | author: `@r-ichard`,
6 | },
7 | plugins: [
8 | `gatsby-plugin-image`,
9 | {
10 | resolve: `gatsby-source-filesystem`,
11 | options: {
12 | name: `images`,
13 | path: `${__dirname}/src/images`,
14 | },
15 | },
16 | `gatsby-transformer-sharp`,
17 | `gatsby-plugin-sharp`,
18 | {
19 | resolve: `gatsby-plugin-sass`,
20 | options: {
21 | sassOptions: {
22 | precision: 6,
23 | },
24 | },
25 | },
26 | {
27 | resolve: `gatsby-plugin-manifest`,
28 | options: {
29 | name: `gatsby-starter-bootstrap-5`,
30 | short_name: `gb5-starter`,
31 | start_url: `/`,
32 | background_color: `#663399`,
33 | theme_color: `#663399`,
34 | display: `standalone`,
35 | icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
36 | },
37 | },
38 | `gatsby-plugin-gatsby-cloud`,
39 | ],
40 | }
41 |
--------------------------------------------------------------------------------
/gatsby-node.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Implement Gatsby's Node APIs in this file.
3 | *
4 | * See: https://www.gatsbyjs.com/docs/node-apis/
5 | */
6 |
7 | // You can delete this file if you're not using it
8 |
--------------------------------------------------------------------------------
/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
3 | *
4 | * See: https://www.gatsbyjs.com/docs/ssr-apis/
5 | */
6 |
7 | // You can delete this file if you're not using it
8 | exports.onRenderBody = ({ setHtmlAttributes }) => {
9 | setHtmlAttributes({ lang: "en" })
10 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@r-ichard/gatsby-starter-bootstrap-5",
3 | "private": false,
4 | "description": "A simple starter to get up and developing quickly with Gatsby 5 and Bootstrap 5",
5 | "version": "2.0.2",
6 | "author": "Richard Raduly ",
7 | "dependencies": {
8 | "@popperjs/core": "^2.11.6",
9 | "bootstrap": "^5.2.2",
10 | "gatsby": "^5.1.0",
11 | "gatsby-plugin-gatsby-cloud": "^5.1.0",
12 | "gatsby-plugin-image": "^3.1.0",
13 | "gatsby-plugin-manifest": "^5.1.0",
14 | "gatsby-plugin-offline": "^6.1.0",
15 | "gatsby-plugin-sass": "^6.1.0",
16 | "gatsby-plugin-sharp": "^5.1.0",
17 | "gatsby-source-filesystem": "^5.1.0",
18 | "gatsby-transformer-sharp": "^5.1.0",
19 | "prop-types": "^15.8.1",
20 | "react": "^18.2.0",
21 | "react-dom": "^18.0.0",
22 | "sass": "1.49.11"
23 | },
24 | "devDependencies": {
25 | "prettier": "2.5.1"
26 | },
27 | "keywords": [
28 | "gatsby",
29 | "starter",
30 | "bootstrap",
31 | "sass"
32 | ],
33 | "license": "0BSD",
34 | "scripts": {
35 | "build": "gatsby build",
36 | "develop": "gatsby develop",
37 | "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
38 | "start": "npm run develop",
39 | "serve": "gatsby serve",
40 | "clean": "gatsby clean",
41 | "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
42 | },
43 | "repository": {
44 | "type": "git",
45 | "url": "git+https://github.com/r-ichard/gatsby-starter-bootstrap-5.git"
46 | },
47 | "bugs": {
48 | "url": "https://github.com/gatsbyjs/gatsby/issues"
49 | },
50 | "homepage": "https://github.com/r-ichard/gatsby-starter-bootstrap-5#readme",
51 | "main": "gatsby-browser.js"
52 | }
53 |
--------------------------------------------------------------------------------
/src/components/layout.js:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import PropTypes from "prop-types"
3 | import { useStaticQuery, graphql } from "gatsby"
4 |
5 | import Navbar from "./navbar"
6 | import "./layout.scss"
7 |
8 | const Layout = ({ children }) => {
9 | const data = useStaticQuery(graphql`
10 | query SiteTitleQuery {
11 | site {
12 | siteMetadata {
13 | title
14 | }
15 | }
16 | }
17 | `)
18 |
19 | return (
20 |
21 |
22 |
23 | {children}
24 |
25 |
26 | )
27 | }
28 |
29 | Layout.propTypes = {
30 | children: PropTypes.node.isRequired,
31 | }
32 |
33 | export default Layout
34 |
--------------------------------------------------------------------------------
/src/components/layout.scss:
--------------------------------------------------------------------------------
1 | //Here you can customize bootstrap
2 | $primary: #663399;
3 | @import "~bootstrap/scss/bootstrap";
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/components/navbar.js:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import PropTypes from "prop-types"
3 | import { Link } from "gatsby"
4 |
5 | const isActive = ({ isCurrent }) => {
6 | return isCurrent ? { className: "nav-link active" } : {className: "nav-link"}
7 | }
8 |
9 | const ExactNavLink = props => (
10 |
11 | )
12 |
13 | const Navbar = ({ siteTitle }) => {
14 | return (
15 |
43 | )
44 | }
45 |
46 | Navbar.propTypes = {
47 | siteTitle: PropTypes.string,
48 | }
49 |
50 | Navbar.defaultProps = {
51 | siteTitle: ``,
52 | }
53 |
54 | export default Navbar
55 |
--------------------------------------------------------------------------------
/src/components/seo.js:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import { useSiteMetadata } from "../hooks/use-site-metadata"
3 |
4 | export const Seo = ({ title, description, pathname, children }) => {
5 | const { title: defaultTitle, description: defaultDescription, siteUrl } = useSiteMetadata()
6 |
7 | const seo = {
8 | title: title || defaultTitle,
9 | description: description || defaultDescription,
10 | url: `${siteUrl}${pathname || ``}`,
11 | }
12 |
13 | return (
14 | <>
15 | {seo.title}
16 |
17 |
18 |
19 |
20 | {children}
21 | >
22 | )
23 | }
--------------------------------------------------------------------------------
/src/hooks/use-site-metadata.js:
--------------------------------------------------------------------------------
1 | import { graphql, useStaticQuery } from "gatsby"
2 |
3 | export const useSiteMetadata = () => {
4 | const data = useStaticQuery(graphql`
5 | query {
6 | site {
7 | siteMetadata {
8 | title
9 | description
10 | author
11 | }
12 | }
13 | }
14 | `)
15 |
16 | return data.site.siteMetadata
17 | }
--------------------------------------------------------------------------------
/src/images/gatsby-astronaut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r-ichard/gatsby-starter-bootstrap-5/534531b8b3ca1619a2e0cf6a41243295d30a0965/src/images/gatsby-astronaut.png
--------------------------------------------------------------------------------
/src/images/gatsby-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/r-ichard/gatsby-starter-bootstrap-5/534531b8b3ca1619a2e0cf6a41243295d30a0965/src/images/gatsby-icon.png
--------------------------------------------------------------------------------
/src/pages/404.js:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import Layout from "../components/layout"
4 | import {Seo} from "../components/seo"
5 |
6 | const NotFoundPage = () => (
7 |
8 |
9 |
404: Not Found
10 |
You just hit a route that doesn't exist... the sadness.
11 |
12 |
13 |
14 | )
15 |
16 | export default NotFoundPage
17 |
18 | export const Head = () => (
19 |
20 | )
21 |
--------------------------------------------------------------------------------
/src/pages/about.js:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { Link } from "gatsby"
3 |
4 | import Layout from "../components/layout"
5 | import {Seo} from "../components/seo"
6 |
7 | const AboutPage = () => (
8 |
9 |
10 |
11 |
12 |
What you need to know
13 |
14 |
15 | - Bootstrap 5 support with SASS
16 | - Customize theme via layout.scss
17 | - If any issue report to Github Repo
18 |
19 |
20 |
Created by Richard Raduly
21 |
22 |
Go back to the homepage
23 |
24 |
25 | )
26 |
27 | export default AboutPage
28 |
29 | export const Head = () => (
30 |
31 | )
--------------------------------------------------------------------------------
/src/pages/index.js:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { Link } from "gatsby"
3 | import { StaticImage } from "gatsby-plugin-image"
4 |
5 | import Layout from "../components/layout"
6 | import { Seo } from "../components/seo"
7 |
8 | const IndexPage = () => (
9 |
10 |
11 |
12 |
13 |
Hello world !
14 |
Welcome to this Boostrap 5 Gatsby Starter
15 |
23 |
24 |
25 |
26 |
27 | About
28 | Go to page 2
29 |
30 |
31 |
32 | )
33 |
34 | export default IndexPage
35 |
36 | export const Head = () => (
37 |
38 | )
--------------------------------------------------------------------------------
/src/pages/page-2.js:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { Link } from "gatsby"
3 |
4 | import Layout from "../components/layout"
5 | import {Seo} from "../components/seo"
6 |
7 | const SecondPage = () => (
8 |
9 |
10 |
Hi from the second page
11 |
Welcome to page 2
12 |
Go back to the homepage
13 |
14 |
15 | )
16 |
17 | export default SecondPage
18 |
19 | export const Head = () => (
20 |
21 | )
22 |
--------------------------------------------------------------------------------