Giter Club home page Giter Club logo

gatsby-sanity-developer-portfolio-starter's Introduction

Gatsby Sanity

Gatsby + Sanity Developer Portfolio

Get your development portfolio off the ground with this deployment-ready Gatsby + Sanity CMS Starter. This project ships with everything you need built into Gatsby and Sanity, just plug in your Sanity API credentials, commit, and deploy your Gatsby and Sanity site!

This starter also utilizes TailwindCSS, SCSS, and Typescript.

๐Ÿš€ Quick start

These instructions assume you already have a development environment set up with Gatsby and Sanity installed. If not, please follow their set up instructions here: Gatsby and Sanity.

  1. Clone the repository and install dependencies

    Using the command line:

    # clone the repository
    git clone https://github.com/jneterer/gatsby-sanity-developer-portfolio.git
    # install dependencies
    cd gatsby-sanity-developer-portfolio
    npm install
    cd sanity-developer-portfolio
    npm install
  2. Configure Sanity

    Now you are going to set up your Sanity CMS and start its local instance.

    # ensure you're in the sanity-developer-portfolio directory
    sanity init
    # it might ask you if you want to override the existing configuration, type 'y' for yes
    # name your project
    # use the default dataset configuration: 'y' for yes
    # deploy your graphql schema
    sanity graphql deploy
    # you can optionally enable the graphql playground but this is not required
    # start your local Sanity CMS instance
    sanity start
    # go to http://localhost:3333 and login

    If you want to go ahead and deploy your Sanity instance, you can do the following:

    # ensure you're in the sanity-developer-portfolio directory
    sanity deploy
    # provide your studio host name, can be the same as your project name
    # once Sanity has completed deploying your studio, it will give you your production sanity url
  3. Create content for your porfolio

    Here, you will create some basic content for your portfolio.

    1. Go into the About section
    2. Click the + sign to create a new About and fill out the fields
      1. Title - something like: "I'm a developer!"
      2. Description - provide a short bio about yourself, what you like to do, frameworks you use, etc.
      3. Main Image - this can be a self portrait or any other image you want to display in your About section
    3. Publish your new About
    4. Go to the Tag section
    5. Click the + sign to create a new Tag and fill out the fields
      1. Title - the title of the tag, something like: "Gatsby" or "Sanity"
      2. Description - this is a non-user facing field. Provide any description for the tag that you find helpful
      3. Selected - you can toggle this property to set whether a tag is by default selected as a filter on the home page. This should, at a minimum, be used in conjunction with the Is View All property.
      4. Is View All - defines whether a tag is the view all tag. Only one tag should have this property set to true.
    6. Publish your new Tag
    7. Go to the Project section
    8. Click the + sign to create a new Project and fill out the fields
      1. Title - the title of the project
      2. Slug - choose generate once having provided the title. This will create a url based on the title to /project/{slug}
      3. Description - a short description of the project. This will display on the project's card in the Projects section of the home page
      4. Body - a long description of the project. This will display on the project's page
      5. Github Url - the url to your project's github repo
      6. Site Url - the url to your project's site
      7. Main Image - a screenshot of your project. I recommend using the same size image for each project
      8. Tags - any tags associated with the project
    9. Publish your new Project
  4. Configure Gatsby

    In this section, you are going to connect your Gatsby project with your Sanity CMS.

    1. Rename your .env-example file to .env

    2. Replace {your-sanity-project-id} with your project id and {your-dataset-name} with your dataset name. These can both be found in the sanity-developer-portfolio/sanity.json file under the api property.

    3. Optional - set up Sanity draft previews in your Gatsby site

      1. Login to Sanity: Login
      2. Choose your Sanity project
      3. Go to settings > API
      4. Scroll to Tokens and Add New Token
      5. Give your token a label like: "Unpublished Changes Viewer" with Read permissions and Add New Token
      6. Copy the token and replace the {your-sanity-read-token} with your new read token in your .env file
    4. Start Gatsby!

    gatsby develop

    Your site is now running at http://localhost:8000!

    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.

๐Ÿง What's inside and what you should know for this project

.
โ””โ”€โ”€ sanity-developer-portfolio
    โ”œโ”€โ”€ schemas
    โ””โ”€โ”€ sanity.json
โ””โ”€โ”€ src
    โ”œโ”€โ”€ components
    โ”œโ”€โ”€ contracts
    โ”œโ”€โ”€ hooks
    โ”œโ”€โ”€ pages
    โ””โ”€โ”€ templates
โ”œโ”€โ”€ gatsby-config.js
โ””โ”€โ”€ gatsby-node.js
  1. /sanity-developer-portfolio: This directory contains your sanity CMS code.

    1. /schemas: This directory contains all schemas for your project, including the About, Project, and Tag schemas.
    2. .sanity.json: This file contains your sanity configuration, including your API credentials.
  2. /src: This directory contains all of the modules of code that your project depends on.

    1. /components This directory contains any components that might be reused in either a page, template, or other component.
    2. /contracts These are typescript interface contracts that define types for graphql queries to sanity, component props, etc.
    3. /hooks This directory contains any reusable useStaticQuery hooks to sanity.
    4. /pages This directory contains any pages that are not created programmatically in our ./gatsby-node.js file.
    5. /templates This directory contains any templates for pages created in our ./gatsby-node.js file.
  3. .gatsby-config.js: This is the main configuration file for a Gatsby site. In this file we define the title and description of the project and any plugins we use including Typescript (gatsby-plugin-typescript), Sanity (gatsby-source-sanity), TailwindCSS and SASS (gatsby-plugin-sass). (Check out the config docs for more detail).

  4. .gatsby-node.js: This is where we build all of our project files dynamically on at build time. (Check out the docs for this file here Gatsby Node APIs).

๐Ÿ’ซ Deploy

Deploy to Netlify

gatsby-sanity-developer-portfolio-starter's People

Contributors

jneterer avatar

Stargazers

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

gatsby-sanity-developer-portfolio-starter's Issues

Installation issue

I have not found a single thing about this, so it might be my computer or versions, but when I try to npm install this starter. I get

2 warnings generated. c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.4"' -I/Users/bora.alap/.node-gyp/14.5.0/include/node -I/Users/bora.alap/.node-gyp/14.5.0/src -I/Users/bora.alap/.node-gyp/14.5.0/deps/openssl/config -I/Users/bora.alap/.node-gyp/14.5.0/deps/openssl/openssl/include -I/Users/bora.alap/.node-gyp/14.5.0/deps/uv/include -I/Users/bora.alap/.node-gyp/14.5.0/deps/zlib -I/Users/bora.alap/.node-gyp/14.5.0/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/file.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/file.o ../src/libsass/src/file.cpp In file included from ../src/libsass/src/file.cpp:23: In file included from ../src/libsass/src/sass_functions.hpp:6: In file included from ../src/libsass/src/functions.hpp:4: In file included from ../src/libsass/src/listize.hpp:7: ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis] for (const auto numerator : numerators) ^ ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying for (const auto numerator : numerators) ^~~~~~~~~~~~~~~~~~~~~~ & ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis] for (const auto denominator : denominators) ^ ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying for (const auto denominator : denominators) ^~~~~~~~~~~~~~~~~~~~~~~~ & 2 warnings generated. c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.4"' -I/Users/bora.alap/.node-gyp/14.5.0/include/node -I/Users/bora.alap/.node-gyp/14.5.0/src -I/Users/bora.alap/.node-gyp/14.5.0/deps/openssl/config -I/Users/bora.alap/.node-gyp/14.5.0/deps/openssl/openssl/include -I/Users/bora.alap/.node-gyp/14.5.0/deps/uv/include -I/Users/bora.alap/.node-gyp/14.5.0/deps/zlib -I/Users/bora.alap/.node-gyp/14.5.0/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/functions.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/functions.o ../src/libsass/src/functions.cpp In file included from ../src/libsass/src/functions.cpp:2: In file included from ../src/libsass/src/functions.hpp:4: In file included from ../src/libsass/src/listize.hpp:7: ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis] for (const auto numerator : numerators) ^ ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying for (const auto numerator : numerators) ^~~~~~~~~~~~~~~~~~~~~~ & ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis] for (const auto denominator : denominators) ^ ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying for (const auto denominator : denominators) ^~~~~~~~~~~~~~~~~~~~~~~~ & 2 warnings generated. c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.4"' -I/Users/bora.alap/.node-gyp/14.5.0/include/node -I/Users/bora.alap/.node-gyp/14.5.0/src -I/Users/bora.alap/.node-gyp/14.5.0/deps/openssl/config -I/Users/bora.alap/.node-gyp/14.5.0/deps/openssl/openssl/include -I/Users/bora.alap/.node-gyp/14.5.0/deps/uv/include -I/Users/bora.alap/.node-gyp/14.5.0/deps/zlib -I/Users/bora.alap/.node-gyp/14.5.0/deps/v8/include -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/inspect.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/inspect.o ../src/libsass/src/inspect.cpp In file included from ../src/libsass/src/inspect.cpp:9: ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis] for (const auto numerator : numerators) ^ ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying for (const auto numerator : numerators) ^~~~~~~~~~~~~~~~~~~~~~ & ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis] for (const auto denominator : denominators) ^ ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying for (const auto denominator : denominators) ^~~~~~~~~~~~~~~~~~~~~~~~ &

This keeps repeating like 40 times, then as result, it shows
57 packages are looking for funding run npm fund` for details

found 446 vulnerabilities (400 low, 46 high)
run npm audit fix to fix them, or npm audit for details`

is this normal?
Thanks,

Version of this starter that uses markdown files instead of sanity?

Hello, I absolutely love this starter! I have been looking for a starter that allows me to toggle multiple tags on/off to filter the results from the home page like this does.

My only issue with it is that all the content needs to be added through sanity instead of using markdown files. I would be able to add projects much quicker and easier if I were able to use markdown files instead because I could use scripts and such to automate aspects of it to speed up the process. Plus I never understood the point of using a CMS like sanity which requires developer knowledge to even be able to login to it to add the content(I know how to do it but I would never expect one of my clients to).

If I wanted to use a CMS for one of my personal sites, I would much prefer Netlify CMS which works with Markdown files. Or if I wanted to use a CMS that was easy for clients to go in and add/edit content themselves, I would use a headless CMS like Flotiq.

Right now I just want to use this starter for one of my personal sites so I would prefer a markdown file solution but I do feel like this starter could be used for multiple different projects, so it would be nice to also have a version that works with Flotiq eventually. If you haven't heard of Flotiq yet, I highly recommend checking them out. They are fairly new but I think they are miles ahead of the other headless CMS options because of how easy it is for clients to use and doesn't require them to enable draft mode before saving any changes to avoid triggering a build every single time like Forestry does.

But back to markdown files lol...

Do you think you might create a version of this starter that works with markdown files instead of sanity for adding/editing the content on the site? I know I would greatly appreciate it if you did =). Bonus points if you also make it compatible with NetlifyCMS.

Thanks!

Add a search box for additional way to filter results.

I think it would be nice if this starter had a search box in addition to the tag filters that instantly filtered the results as you type to only show projects that have whatever you type anywhere within them. Like this one does. But that one doesn't let me select more than one tag at a time, which is a deal breaker for me.

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.