Skip to content

OrbitNTNU/orbitntnu-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netlify Status

orbitntnu-web

orbitntnu.com is a website for the student organization Orbit NTNU.

Project Status

Live @ orbitntnu.com

Development

Built with

  • Typescript
    • JavaScript with syntax for types 💪
  • React
    • Component based JavaScript library used for creating user interfaces 🌿
  • Gatsby
    • Blazing fast React framework 🚀
  • Tailwind
    • Utility-first CSS framework 💅
  • Sanity
    • CMS used to manage the websites content ✅

Dependencies

Installation

# Cloning the repository
git clone https://github.com/OrbitNTNU/orbitntnu-web.git
cd orbitntnu-web

# Installing frontend dependencies
cd frontend
yarn install

cd ..

# Installing sanity dependencies
cd sanity
yarn install

cd ..

Running locally

Gatsby Frontend

cd frontend
yarn start

Sanity

cd sanity
yarn start

Deploying

Any changes made to the main branch in the repository will automaticly be built and deployed.

Hosting

This project uses Netlify hosting.

Adding Sanity components

Add component

Find the schema to which you want to add a component in /sanity/schemas
Documentation for Sanity components

# Add your component
{
  name: "exampleName",
  type: "Text",
  title: "Title in Sanity"
}

Push and merge to the main branch.

Log in to Sanity

# Installing the Sanity CLI globally
npm install --global sanity@latest    # This worked for Windows
sanity login

# Alternatively
yarn global add sanity@latest
pnpm install --global sanity@latest
sanity login

# Running the CLI without global installation
npx -y sanity@latest login        # This worked for Linux

Deploy graphql

cd sanity
yarn run build
yarn run graphql-deploy

Add to code

Add exampleName to the graphql query at the bottom of the page you're changing in /frontend.

You can now use nameOfSanitySchema.exampleName in your code with the