• Stars
    star
    545
  • Rank 81,554 (Top 2 %)
  • Language
    TypeScript
  • License
    BSD Zero Clause L...
  • Created about 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An accessible and fast portfolio starter for Gatsby integrated with Contentful CMS

Gatsby Starter: Mate ๐Ÿง‰

Build Netlify Status

Gatsby starter for gatsby-theme-mate. An accessible and fast portfolio starter for Gatsby integrated with Contentful CMS.

The target audience are Developers ๐Ÿ’ป and Tech Writers โœ๏ธ.

Check the Demo โœจ

Why? ๐Ÿค”

In case you are looking for a quick setup portfolio or upgrade your current, you have to definitely try Mate!

This starter is totally content based on Contentful, which is a headless CMS where you can write the content for your page. In summary, Contentful is the Model when Gatsby with React is the View.

At the same time, as this portfolio is written with Gatsby is extremely easy to add more than one source of data! For example, the demo comes with an integration of Medium posts based on a user name โœŒ๏ธ

Features ๐Ÿ› 

How to start

As this process needs more steps compared to other starters, I decided to made a tutorial video of how to set up your own instance of Mate. You can follow the video or jump directly to the written documentation.

Watch the tutorial

If you never used Gatsby before, I highly recommend you to Set up your development environment!

Also, it's recommended that you use Yarn as your Package Manager inside gatsby-cli:

$ gatsby options set pm yarn
info Preferred package manager set to "yarn"

To copy and install this starter run this command:

$ gatsby new mate-portfolio https://github.com/EmaSuriano/gatsby-starter-mate

At this point you have the repository download with all the dependencies installed, but if you try to start by running yarn develop you are going to received this message in the console:

  TypeError: Expected parameter accessToken

This is because you didn't specify from which Contentful space the portfolio will take the information. So the next step is create an empty space in Contentful!

After the space is created, run the following command:

yarn setup

This CLI will request 3 values:

  • Space ID
  • Content Delivery API - access token
  • Personal Access Token

These 3 values are inside the Settings section --> API keys.

After you provide them the CLI will automatically starts copying all the Content models and Contents from mate-demo-contentful to your space โœจ

If everything went smooth you should see something like this in your terminal:

Writing config file...
Config file /Users/my-user/Git/test/mate-portfolio/.env written
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ The following entities are going to be imported: โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Content Types                   โ”‚ 3              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Editor Interfaces               โ”‚ 3              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Entries                         โ”‚ 8              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Assets                          โ”‚ 6              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Locales                         โ”‚ 1              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Webhooks                        โ”‚ 0              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
 โœ” Validating content-file
 โœ” Initialize client (1s)
 โœ” Checking if destination space already has any content and retrieving it (2s)
 โœ” Apply transformations to source data (1s)
 โœ” Push content to destination space
   โœ” Connecting to space (1s)
   โœ” Importing Locales (1s)
   โœ” Importing Content Types (4s)
   โœ” Publishing Content Types (3s)
   โœ” Importing Editor Interfaces (3s)
   โœ” Importing Assets (7s)
   โœ” Publishing Assets (3s)
   โœ” Archiving Assets (1s)
   โœ” Importing Content Entries (1s)
   โœ” Publishing Content Entries (5s)
   โœ” Archiving Entries (1s)
   โœ” Creating Web Hooks (0s)
Finished importing all data

After this step we can finally run the project and see the result in http://localhost:8000/ ๐Ÿ˜ƒ

$ yarn start

Screenshot and Design

As the starter is a SPA it only has two routes:

  • /: main page with the sections of Home, About me, Projects and Writing.
  • /404: error page for unexpected route.
Section Screenshot
Home Home
About me About me
Projects Projects
Writing Writing
404 404

Building your site

As we are dealing with environment variables, the .env file is excluded from .gitignore file. Therefore, in order to deploy the website you have to send SPACE_ID and ACCESS_TOKEN with the build command.

SPACE_ID=xxxxx ACCESS_TOKEN=yyyyy yarn build

The result will be stored inside the public folder, so you can upload to your web host. I highly suggest using this starter with Netlify when you can define which command will build the project and also send the environment variables inside the website configuration.

Customization

When you first bootstrap the project, you will notice that it doesn't contain many files. This is because of how the project is structured, for example where is the data coming from and how it is displayed to the user. The starter is based on 2 principles:

  1. Data coming from an external source: Contentful. Therefore in case you want to change the content of the website, please refer to Adding your information section.
  2. Components and pages decoupled inside a Gatsby Theme: gatsby-theme-mate. The reason behind it is to provide an easy way to keep your starter up to date. To know more about Gatsby Theme, please refer to the official documentation. Most common customizations:
    1. Theming
    2. Changing Icons
    3. Modifying the Sections

Adding your information

All the information of this starter resides inside Contentful, inside the Content of About. To change it, just go to the Content section and change the entity with the information you want.

Contentful About change

Regarding the projects and social links, the process is the same! Contentful is easy to learn so don't be afraid of breaking everything, remember that you can restore to the start point by running yarn setup ๐Ÿ˜„

Theming

Thanks to the Theme Shadowing, changing the colors of your portfolio is quite easy! You have to create a new file located at src/gatsby-theme-mate/colors.json. Some examples I made by using palettes from Color Hunt:

Name Code Screenshot
Original { "text": "#333333", "background": "#FFFFFF", "muted": "#f0e6f6", "primary": "#7c37ad", "secondary": "#ff4081" } Original Schema
Teal { "text": "#40514e", "background": "#FFFFFF", "muted": "#e4f9f5", "primary": "#11999e", "secondary": "#30e3ca" } Teal Theme
Dark { "text": "#e3e3e3", "background": "#1b262c", "muted": "#0f4c75", "primary": "#bbe1fa", "secondary": "#3282b8" } Dark Theme

Changing Icons

This project is using the icons from Font Awesome, with the implementation made by fortawesome. A good practice when dealing with icons is to load only the ones that the project is going to use. Therefore not all the icons inside FA are loaded by default.

To change the icons used in your portfolio, you have to make use of Theme Shadowing and create a file located at src/gatsby-theme-mate/icons.js with your icons. By default this is the content of the file:

import {
  faMedium,
  faTwitter,
  faGithub,
} from '@fortawesome/free-brands-svg-icons';
import {
  faGlobe,
  faEnvelope,
  faCoffee,
} from '@fortawesome/free-solid-svg-icons';

export const ICONS = [
  faMedium,
  faTwitter,
  faGithub,
  faGlobe,
  faEnvelope,
  faCoffee,
];

Simply import the icons you want to use either @fortawesome/free-brands-svg-icons or @fortawesome/free-solid-svg-icons and export them inside the ICONS array. They get loaded as soon as the app starts.

Modifying the Sections

This starter by default provides 4 different sections:

  • Landing: your name, roles, and social links.
  • About: information about yourself plus the image on the side.
  • Projects: summary of the projects you worked on.
  • Writing: articles from Medium you wrote (this will be visible only if you specify a Medium user).

In case you want to change the order, remove or even add new sections. You can do it by using the feature of Theme Shadowing and create a file inside src/gatsby-theme-mate/templates/Home.js and have total control over what you want to render. This will be an example of swapping between the About and Projects section.

import React from 'react';

// Layout components
import Layout from 'gatsby-theme-mate/src/components/Layout';
import Header from 'gatsby-theme-mate/src/components/Header';
import Footer from 'gatsby-theme-mate/src/components/Footer';

// Sections that will fetch data for you
import Landing from 'gatsby-theme-mate/src/sections/Landing';
import About from 'gatsby-theme-mate/src/sections/About';
import Projects from 'gatsby-theme-mate/src/sections/Projects';
import Writing from 'gatsby-theme-mate/src/sections/Writing';

const Home = () => (
  <Layout>
    <Header />
    <Landing />
    <Projects />
    <About />
    <Writing />
    <Footer />
  </Layout>
);

export default Home;

By following this approach it's possible to modify the code of any component of the project. But please be aware, that by using Theme Shadowing you are going to always override the content of this, so in case there will be an update of the same file inside gatsby-theme-mate you are not going to use it.

My final recommendation with shadowing is to try to keep as minimum as possible to avoid having breaking changes between new releases of the theme.

Tracking with Google Analytics (Optional)

This starter has the analytics plugin inside the gatsby-config, so the only need to do in order to enable it is to provide the Tracking Id for your site (starts with UA-). Just set a new variable inside your .env file called ANALYTICS_ID and analytics will be turn on automatically ๐Ÿ˜„

Contributing

In case you want to add your contribution into this project, please refer to the Gatsby Theme repository so then everybody using this starter will be able to get the changes.

More Repositories

1

react-scroll-section

React library to provide a declarative scroll to between sections
TypeScript
116
star
2

astro-art-portfolio

Minimalistic Art showcase built with Astro and connected with Notion API
Astro
105
star
3

gatsby-starter-event-calendar

A customisable calendar event page built with Gatsby integrated with Google Spreadsheet
TypeScript
77
star
4

astro-resume

Resume builder written in Markdown using Astro with Tailwind
Astro
75
star
5

react-hotkey-tooltip

A global Hotkey provider with built in tooltip for React
TypeScript
34
star
6

gatsby-theme-jsonresume

A Gatsby Theme with JSONResume to host your Resume in HTML and PDF
JavaScript
24
star
7

astro-multi-framework-dashboard

Multi framework dashboard built with Astro
TypeScript
24
star
8

weather-styled-icon

โ›…๏ธโ˜€๏ธ๐ŸŒง๐ŸŒจin โš›๏ธ
JavaScript
23
star
9

e2e-react-native-detox

Demo of react-native project using Detox
JavaScript
14
star
10

maintainable-icon-system-react

Implementation of a maintainable icon system for React and React Native
JavaScript
14
star
11

react-radio-group-context

Radio Group Component for React written with the new Context API
JavaScript
10
star
12

jsonresume-theme-standard-resume

Standard Resume JSONResume theme
Handlebars
7
star
13

gatsby-starter-linkedin-resume

Generate your resume (HTML, PDF) from your Linked information with Gatsby ๐Ÿ’ช
TypeScript
6
star
14

particle-js-background

Created with CodeSandbox
JavaScript
6
star
15

astro-mate

New version of Gatsby Mate, built in Astro
Astro
6
star
16

test-workshop-fastify

Test project using fastify for the workshop of Nodeconf EU 2019
JavaScript
4
star
17

oss-project-dashboard

Dashboard to provide a quick overview of Open Source projects in Github
TypeScript
4
star
18

gatsby-theme-mate

Gatsby theme for gatsby-starter-mate
TypeScript
4
star
19

react-spring-parallax-demo

Demo of parallax effect of react-spring
JavaScript
3
star
20

custom-icons-react-native

This is an example of how to load custom icons into react native without Fontello or Icomoon
JavaScript
3
star
21

portfolio

My portfolio where I show information about myself, my projects and articles.
Astro
3
star
22

brastlewark-finder

Web application that will allow you to find all the gnomes inside Brastlewark (Gnome town) and see their characteristics
JavaScript
2
star
23

30DaysOfReactNative

30 RN Projects in 30 Days
JavaScript
1
star
24

weather-app-integration-test-cosmos

This project is a test of cosmos framework to do integration test
JavaScript
1
star
25

react-scrollreveal

React wrapper for the library scrollreveal
JavaScript
1
star
26

astro-client-directives-test

Created with StackBlitz โšก๏ธ
Astro
1
star
27

Felix-fix-it-multiplayer

Remake of the retro game: Felix Fix It, with the ability to create rooms dynamically in order to play with another person via HTTPS.
C
1
star
28

gatsby-followers

Gatsby page that shows all the followers of an user in different platform
CSS
1
star
29

error-handling-workshop

Workshop of error Handling - NodeConf 2019
JavaScript
1
star
30

from-CRA-to-CAA

Talk given at Byteconf React 2020
JavaScript
1
star
31

visual-testing-storybook

Example of how to do visual testing with storybook
JavaScript
1
star
32

typescript-eslint-test

Testing new typescript-eslint with prettier and airbnb config
JavaScript
1
star
33

exchange-app

Exchange app built with React and Recoil
TypeScript
1
star