1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00
👔 Portfolio thingy, built with Gatsby https://matthiaskretschmann.com
Go to file
2019-03-29 23:43:40 +01:00
data project links tweaks 2018-11-24 15:02:32 +01:00
scripts remove CI lighthouse test 2019-01-20 14:43:15 +01:00
src project nav fixes 2019-03-29 23:43:40 +01:00
static cleanup & fixes 2018-09-24 00:13:41 +02:00
.dockerignore docker 2018-09-20 00:34:48 +02:00
.editorconfig stylelint updates 2018-05-22 22:17:51 +02:00
.eslintrc define React version for eslint-plugin-react 2018-12-07 13:57:44 +01:00
.gitignore use SVGR directly 2018-06-23 14:07:11 +02:00
.prettierignore remove local vcf lib 2018-06-23 14:07:10 +02:00
.prettierrc package updates 2018-05-22 20:40:57 +02:00
.stylelintrc tweaks 2018-11-24 18:06:16 +01:00
.travis.yml lighthouse test tweaks 2018-12-07 12:18:05 +01:00
docker-compose.yml docker 2018-09-20 00:34:48 +02:00
Dockerfile fix Dockerfile 2018-11-10 14:19:39 +01:00
gatsby-browser.js cleanup & fixes 2018-09-24 00:13:41 +02:00
gatsby-config.js switch back to gatsby-plugin-svgr 2018-09-20 19:06:46 +02:00
gatsby-node.js remove promises 2019-01-04 18:49:39 +01:00
gatsby-ssr.js setup global store 2018-09-16 21:33:42 +02:00
LICENSE documentation, switch to Travis 2018-05-14 01:51:47 +02:00
package.json package updates 2019-03-29 22:59:45 +01:00
README.md remove CI lighthouse test 2019-01-20 14:43:15 +01:00

👔 Portfolio thingy, built with Gatsby.

matthiaskretschmann.com


🎉 Features

The whole portfolio is a React-based Single Page App built with Gatsby v2.

Lighthouse score

Lighthouse scores

💍 One data file to rule all pages

All content is powered by one YAML file where all the portfolio's projects are defined. The project description itself is transformed from Markdown written inside the YAML file int HTML on build time.

Gatsby automatically creates pages from each item in that file utilizing the Project.jsx template.

💅 Theme switcher

Includes a theme switcher which allows user to toggle between a light and a dark theme. Switching between them also happens automatically based on user's local sunset and sunrise times. Uses Cloudflare's geo location HTTP header functionality.

If a visitor has set the theme manually that selection is remembered in localStorage, and is restored on next visit.

If you want to know how, have a look at the respective components:

🏆 SEO component

Includes a SEO component which automatically switches all required meta tags for search engines, Twitter Cards, and Facebook OpenGraph tags based on the browsed route/page.

If you want to know how, have a look at the respective component:

📇 Client-side vCard creation

The Add to addressbook link in the footer automatically creates a downloadable vCard file on the client-side, based on data defined in data/meta.yml.

If you want to know how, have a look at the respective component:

💫 Page transitions

Includes mechanism for transitioning between route changes with full page transitions defined with react-pose. Mechanism stolen inspired by gatsby-universal.

If you want to know how, have a look at the respective components:

📈 Matomo (formerly Piwik) analytics tracking

Site sends usage statistics to my own Matomo installation. To make this work in Gatsby, I created and open sourced a plugin, gatsby-plugin-matomo, which is in use on this site.

🖼 Project images

All project images live under src/images and are automatically attached to each project based on the inclusion of the project's slug in their filenames.

All project images make use of the excellent gatsby-image plugin, working in tandem with gatsby-plugin-sharp and gatsby-transformer-sharp.

All together, Gatsby automatically generates all required image sizes for delivering responsible, responsive images to visitors, including lazy loading of all images. Also includes the intersection-observer polyfill to make lazy loading work properly in Safari.

All project images use one single component where one main GraphQL query fragment is defined, which then gets used throughout other GraphQL queries.

💎 Importing SVG assets

All SVG assets under src/images/ will be converted to React components with the help of gatsby-plugin-svgr. Makes use of SVGR so SVG assets can be imported like so:

import { ReactComponent as Logo } from './components/svg/Logo'

return <Logo />

🍬 Typekit component

Includes a component for adding the Typekit snippet.

If you want to know how, have a look at the respective component:

Development

You can simply use Docker & Docker Compose or install and run dependencies on your local system.

git clone git@github.com:kremalicious/portfolio.git
cd portfolio/

# use Docker
docker-compose up

# or go with local system
npm i
npm start

🔮 Linting

ESlint, Prettier, and Stylelint are setup for all linting purposes:

npm run lint

To automatically format all code files:

npm run format
npm run format:css

🎈 Add a new project

To add a new project, run the following command. This adds a new item to the top of the projects.yml file, creating the title & slug from the argument:

npm run new -- "Hello"

Then continue modifying the new entry in data/projects.yml.

Finally, add as many images as needed with the file name format and put into src/images/:

portfolio-SLUG-01.png
portfolio-SLUG-02.png
portfolio-SLUG-03.png
...

🚚 Deployment

Automatic deployments are triggered upon successful tests & builds on Travis:

  • push to master initiates a live deployment
  • any Pull Request, and subsequent pushes to it, initiates a beta deployment

The deploy command simply calls the scripts/deploy.sh script, syncing the contents of the public/ folder to S3:

npm run deploy

The deploymeng script can be used locally too, the branch checks are only happening for Travis builds, allowing to deploy any branch from local machine.

🏛 Licenses

© Copyright 2018 Matthias Kretschmann

All images and projects are plain ol' copyright, most displayed projects are subject to the copyright of their respective owners.

Don't care if you fork & play with it, but you're not allowed to publish anything from it as a whole without my written permission. Also please be aware, the combination of typography, colors & layout makes up my brand identity. So please don't just clone everything, but rather do a remix!

All the rest, like all code and documentation, is under:

The MIT License

Full MIT license text