Giter VIP home page Giter VIP logo

lekoarts / gatsby-starter-portfolio-bella Goto Github PK

View Code? Open in Web Editor NEW
124.0 3.0 18.0 1.74 MB

A bright single-page portfolio starter for Gatsby powered by Prismic.io. The target audience are designers and photographers.

Home Page: https://portfolio-bella.netlify.com/

License: MIT License

JavaScript 100.00%
react gatsby static-site-generator gatsbyjs gatsby-starter designer photographers portfolio prismicio

gatsby-starter-portfolio-bella's Introduction

Gatsby Starter Portfolio: Bella

A portfolio starter for Gatsby. The target audience are designers and photographers.

Demo Website

Deploy to Netlify

  • Big Typography & Images
  • White Theme
  • Prismic.io as CMS
  • One-Page layout with sub-pages for projects

Why?

If you want to quickly bootstrap a design/photography portfolio or use it as a foundation for your personal site the gatsby-starter-portfolio are a perfect fit for you! The project's goal is to offer minimalistic and fast websites.

I hope you like my starters and create something awesome! To see some of my work you can visit my website or support me on Patreon to get some neat rewards (4K images, project files, tutorial insights). Every pledge on Patreon helps me creating more free starters!

Also check out the other gatsby-starter-portfolio:

Check out the Gatsby Starter Portfolio Overview!

Interest in more advanced usages? Visit gatsby-starter-prismic to use the full power of Prismic!

Features

  • Gatsby v2.0.0
  • Configurable
    • Use the website.js to easily change the most important information
    • Google Fonts
  • Prismic.io as CMS
  • Emotion + Emotion-Grid for CSS
  • SEO
    • Sitemap
    • Schema.org JSONLD
    • OpenGraph Tags
    • Twitter Tags
  • Offline Support
  • WebApp Manifest Support
  • Typography.js
  • Responsive images
    • The right image size for every screen size
    • Traced SVG Loading (Lazy-Loading)
    • WebP Support

Getting Started

Check your development environment! You'll need Node.js, the Gatsby CLI and node-gyp installed. The official Gatsby website also lists two articles regarding this topic:

To copy and install this starter run this command (with "project-name" being the name of your folder you wish to install it in):

gatsby new project-name https://github.com/LeKoArts/gatsby-starter-portfolio-bella
cd project-name

Prismic?!

This starter uses Prismic.io as its CMS and therefore you have two options:

  • Setup an account on Prismic and also use it
  • Modify this starter in order to use your favourite data source

If you choose Prismic, you need to create the exact same "Custom Type" if you not want to modify the queries and names in the components. The gatsby-starter-prismic has extensive instructions on setting these things up, you can have a look at them for reference. You can also have a look at the official guide I wrote for Gatsby: Sourcing from Prismic

Go to your custom types:

https://your-name.prismic.io/masks/ and click New. Choose the name Case Study which results in the API ID case_study. On the right side you have your Build mode and JSON editor. Open the JSON editor and copy/paste the following content:

{
  "Content" : {
    "uid" : {
      "type" : "UID",
      "config" : {
        "label" : "SEO",
        "placeholder" : "SEO"
      }
    },
    "header_image" : {
      "type" : "Image",
      "config" : {
        "constraint" : {
          "width" : 1920,
          "height" : 1080
        },
        "thumbnails" : [ ],
        "label" : "Header Image"
      }
    },
    "title" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading1",
        "label" : "Title",
        "placeholder" : "Case study title"
      }
    },
    "subtitle" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading2",
        "label" : "Subtitle",
        "placeholder" : "Subtitle"
      }
    },
    "content" : {
      "type" : "StructuredText",
      "config" : {
        "multi" : "paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, list-item, o-list-item",
        "label" : "content",
        "placeholder" : "Case study content"
      }
    }
  }
}

This is the exact same content type I used for the starter.

You need to define the API Key for your Prismic repository in gatsby-config.js. You can retrieve the key here:

  • You can generate an access token in the "API & Security" section of your repository settings. Setting a "Callback URL" is not necessary.
  • The token will be listed under "Permanent access tokens".

It's best to store the API Key in an environment variable. Create the file .env.development in the root dir of your project. Its content should be:

API_KEY=OIJSOJIO-YOURKEYHERE-EAJNALÖKND

If you deploy to Netlify you can also setup an environment variable.

More information on the source plugin: gatsby-source-prismic

Development

Before running the local development server you'll need to add Content to your Prismic site! Go to your documents (https://your-name.prismic.io/documents/) and create content with the newly created caseStudy type. Don't use the .gif image that Prismic has available (sharp can't process that) and use, e.g. an image from Unsplash. You have to publish the documents.

After that you can run the local server:

npm run dev

Adding new features/plugins

You can add other features by having a look at the official plugins page

Building your site

npm run build

Copy the content of the public folder to your webhost or use a website like Netlify which automates that for you.

Configuration

You can configure your setup in config/website:

module.exports = {
  pathPrefix: '/', // Prefix for all links. If you deploy your site to example.com/portfolio your pathPrefix should be "portfolio"

  siteTitle: 'Bella - Gatsby Starter Portfolio', // Navigation and Site Title
  siteTitleAlt: 'Bella', // Alternative Site title for SEO
  siteUrl: 'https://portfolio-bella.netlify.com', // Domain of your site. No trailing slash!
  siteLanguage: 'en', // Language Tag on <html> element
  siteLogo: '/logos/logo-1024.png', // Used for SEO and manifest
  siteDescription: 'A bright single-page portfolio starter with big typography & images for Gatsby.',
  author: 'LekoArts', // Author for schemaORGJSONLD

  // siteFBAppID: '123456789', // Facebook App ID - Optional
  userTwitter: '@bella', // Twitter Username
  ogSiteName: 'bella', // Facebook Site Name
  ogLanguage: 'en_US', // Facebook Language

  // Manifest and Progress color
  themeColor: '#b710a1',
  backgroundColor: '#350d27',
};

You can also change the colors, container widths and other stuff in config/theme:

const theme = {
  colors: {
    primary: '#b710a1', /* Used for the headings and image overlay */
    primaryLight: '#e456e9', /* Used for links */
    primaryDark: '#3d0435', /* Used for backgrounds */
    bg: '#fff',
    text: '#021212',
    textInvert: '#fff',
    greyLight: '#B4B9C1',
    greyMedium: '#414141',
    greyDark: '#2F2F2F',
  },
  fontFamily: {
    body: `'Open Sans', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', 'sans-serif', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`,
    heading: `'Bree Serif', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', 'sans-serif', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`,
  },
  maxWidth: '1800px',
  maxWidthText: '1000px',
  breakpoint: {
    xs: '400px',
    s: '600px',
    m: '900px',
    l: '1200px',
  },
};

You can change the fonts used in config/typography:

headerFontFamily: [
  'Bree Serif',
  '-apple-system',
  'BlinkMacSystemFont',
  'Segoe UI',
  'Roboto',
  'Helvetica',
  'Arial',
  'sans-serif',
  'Apple Color Emoji',
  'Segoe UI Emoji',
  'Segoe UI Symbol',
],
bodyFontFamily: [
  'Open Sans',
  '-apple-system',
  'BlinkMacSystemFont',
  'Segoe UI',
  'Roboto',
  'Helvetica',
  'Arial',
  'sans-serif',
  'Apple Color Emoji',
  'Segoe UI Emoji',
  'Segoe UI Symbol',
],
googleFonts: [
  {
    name: 'Bree Serif',
    styles: ['400'],
  },
  {
    name: 'Open Sans',
    styles: ['400'],
  },
],

Attention: You also need to edit static/robots.txt to include your domain!

gatsby-starter-portfolio-bella's People

Contributors

lekoarts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gatsby-starter-portfolio-bella's Issues

Set up instructions are not working for me

Hello,

Thanks for this great starter portfolio! It looks really great apart from the fact I'm having some trouble setting it up using your instructions.

I've followed your guide and have set up a prismic repo, added content, the API key etc. It does compile so that says to me that it is accessing the prismic repo. But it doesn't seem to retrieve the data in the index page.

I get lots of errors in the console but the first important one being...

The prop `data` is marked as required in `IndexPage`, but its value is `undefined`

And in the command line when compiling I get...

ℹ 「wdm」:
ℹ 「wdm」: Compiled successfully.
 WAIT  Compiling...                                                                                                                                                                                                                                                   3:13:51 PM

ℹ 「wdm」: Compiling...
GraphQL Error Unknown field `prismicCaseStudy` on type `Query`

  file: /Users/matinechabrier/Sites/gatsby-starter-portfolio-bella/src/templates/case.jsx

   1 |
   2 |   query CaseBySlug($uid: String!) {
>  3 |     prismicCaseStudy(uid: { eq: $uid }) {
     |     ^
   4 |       uid
   5 |       first_publication_date
   6 |       last_publication_date
   7 |       data {
   8 |         header_image {
   9 |           localFile {
  10 |             childImageSharp {
  11 |               sizes(maxWidth: 1920, quality: 90, traceSVG: { color: "#021212" }) {
  12 |                 ...GatsbyImageSharpSizes_withWebp_tracedSVG
  13 |               }

I'm wondering do I need more in my env file? I only have that API key in there. Otherwise I'm really not sure what it could be as it looks correct to me.

error GraphQL Error Unknown field `childImageSharp` on type `File`

I followed the instructions, copied the types to Prismic, didn't use a gif for a header image.

Still:

error GraphQL Error Unknown field `childImageSharp` on type `File`

   1 | 
   2 |   query IndexQuery {
   3 |     caseStudies: allPrismicCaseStudy(sort: { fields: [last_publication_date], order: DESC }) {
   4 |       edges {
   5 |         node {
   6 |           uid
   7 |           data {
   8 |             header_image {
   9 |               localFile {
> 10 |                 childImageSharp {
     |                 ^
  11 |                   fluid(
  12 |                     maxWidth: 900
  13 |                     maxHeight: 900
  14 |                     quality: 90
  15 |                     traceSVG: { color: "#021212" }
  16 |                     cropFocus: ENTROPY
  17 |                   ) {
  18 |                     ...GatsbyImageSharpFluid_withWebp_tracedSVG
  19 |                   }
  20 |                 }
➜  node -v
v10.20.1
➜  yarn -v
1.7.0
➜  gatsby -v
Gatsby CLI version: 2.11.22
Gatsby version: 2.0.59
➜  sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.4

GraphQL Error Unknown field `allPrismicCaseStudy` on type `Query`

Hi, I've followed exactly as you've written in the getting started guide and I still encounter this problem. Any fix for this?

   1 | 
   2 |   query IndexQuery {
>  3 |     caseStudies: allPrismicCaseStudy(sort: { fields: [last_publication_date], order: DESC }) {
     |                  ^
   4 |       edges {
   5 |         node {
   6 |           uid
   7 |           data {
   8 |             header_image {
   9 |               localFile {
  10 |                 childImageSharp {
  11 |                   fluid(
  12 |                     maxWidth: 900
  13 |                     maxHeight: 900

GraphQL Error Unknown field `childImageSharp` on type `File`

This is only a minor issue, and mostly posting this incase someone else has it and is stumped like I was.

Basically, I followed the instructions, but when I added my content into Prismic, I just used their default image - which was a gif file. Apparently the image-sharp tool doesn't like Gif files, and gave this error.

I didn't quite understand for a while, but eventually worked it out.

I suppose it's possible in Prismic to update the config so you can't pick a gif? I'll have to look into that.

TypeError: Cannot read property 'caseStudies' of undefined

Hi! Thank you very much for your theme, I was trying to develop for the first time, after setting up the Prismic.io. However, I got the following errors:

TypeError: Cannot read property 'caseStudies' of undefined

which points to the GraphQL error

GraphQL Error Unknown field localFileon typeheaderImage_2`

file: .../src/pages/index.jsx

1 |
2 | query IndexQuery {
3 | caseStudies: allPrismicCaseStudy(sort: { fields: [last_publication_date], order: DESC }) {
4 | edges {
5 | node {
6 | uid
7 | data {
8 | header_image {

9 | localFile {
| ^
10 | childImageSharp {
11 | sizes(
12 | maxWidth: 900
13 | maxHeight: 900
14 | quality: 90
15 | traceSVG: { color: "#021212" }
16 | cropFocus: ENTROPY
17 | ) {
18 | ...GatsbyImageSharpSizes_withWebp_tracedSVG`

Any idea why this would happen?

I have uploaded my source file on github
https://github.com/sparklesam/bella/tree/Develop-Portfolio/desktop

Uncaught TypeError: Cannot convert undefined or null to object

When I start the development server, it seems that fetching the prismic data is going well:

Starting to fetch data from Prismic
               Fetch Prismic data: 504.140ms

However, If I visit the site the console logs:

dist.js:32 Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object../node_modules/clean-tag/dist.js (dist.js:32)
    at __webpack_require__ (bootstrap:723)
    at fn (bootstrap:100)
    at Module../node_modules/grid-emotion/dist/index.es.js (index.es.js:1)
    at __webpack_require__ (bootstrap:723)
    at fn (bootstrap:100)
    at Module.<anonymous> (index.jsx:141)
    at Module../src/templates/post.jsx (post.jsx:135)
    at __webpack_require__ (bootstrap:723)
    at fn (bootstrap:100)
    at Object.<anonymous> (sync-requires.js:8)
    at Object../.cache/sync-requires.js (sync-requires.js:4)
    at __webpack_require__ (bootstrap:723)
    at fn (bootstrap:100)
    at Module../.cache/app.js (api-runner-browser.js:5)
    at __webpack_require__ (bootstrap:723)
    at fn (bootstrap:100)
    at Object.0 (randomNumber.js:1)
    at __webpack_require__ (bootstrap:723)
    at bootstrap:790
    at bootstrap:790

Any idea? What could I test?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.