This repo host updated webpages for Teknologihuset.
Teknologihuset Web has to main parts:
- Teknologihuset Web: This is the root project and contains the main React/TypeScript application.
- Teknologihuset Sanity Studio: Contains the source code for the headless CMS in the
teknologihusetweb
folder. All content on Teknologihuset.no, including images, is served from Sanity. The CMS is custom-built using the schema's in the schema folder.
The production edition of Teknologihuset Sanity Studio runs at https://teknologihuset.sanity.studio/.
The Sanity Studio interface is custom-built to fit the needs of Teknologihuset. When developing and extending the main application, Teknologihuset Web, you must also make the necessary changes to Sanity Studio in order to reflect how the content is supposed to be served.
- Make sure you have Node & NPM installed:
npm -v
- Install the main application from the root folder:
npm install
- Install the Sanity CLI:
npm install -g @sanity/cli
- Install the Sanity Studio application:
cd teknologihusetweb && sanity install
- Add a
.env
file:touch .env
- Add the following content to it:
SANITY_STUDIO_API_PROJECT_ID=q7ujq3cx
SANITY_STUDIO_API_DATASET=development
SANITY_TOKEN=###
Replace ###
with the read-only Sanity token for Teknologihuset Web.
- Run the dev server locally:
npm run dev
With the above .env
file, your local instance of Teknologihuset Web is served content from the development
dataset.
- Add a new schema to the
schemas
folder within theteknologihusetweb
folder. - If you are also changing the menu layout, make the necessary changes to the
sanity-structure
.js file. - If you need to make changes to the Sanity Studio settings, then edit the
sanity.config.js
file. - To see your changes in dev, run
sanity dev
. - To deploy a new version to production, first run
sanity build
and thensanity deploy
It's possible to change the dataset from within Sanity Studio once the application is started.