Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: initielle Sanity-setup for ny portal #4599

Merged
merged 5 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ny-portal/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
DATABASE_URI=postgresql://localhost/jokul-portal
PAYLOAD_SECRET=YOUR_SECRET_HERE
NEXT_PUBLIC_SANITY_STUDIO_PROJECT_ID=<project_id>
NEXT_PUBLIC_SANITY_STUDIO_DATASET=<dataset>
SANITY_API_READ_TOKEN=<api_read_token>
7 changes: 5 additions & 2 deletions ny-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"type": "module",
"scripts": {
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev",
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev -p 3333",
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
"start": "cross-env NODE_OPTIONS=--no-deprecation next start -p 3333"
},
"dependencies": {
"@aws-sdk/client-sts": "^3.731.1",
Expand All @@ -25,15 +25,18 @@
"@payloadcms/next": "latest",
"@payloadcms/richtext-lexical": "latest",
"@payloadcms/ui": "latest",
"@sanity/vision": "^3.76.3",
"@types/mdx": "^2.0.13",
"clsx": "^2.1.1",
"cross-env": "^7.0.3",
"graphql": "^16.8.1",
"next": "15.1.0",
"next-sanity": "^9.8.59",
"payload": "latest",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-live": "^4.1.8",
"sanity": "^3.76.3",
"sharp": "0.32.6"
},
"devDependencies": {
Expand Down
16 changes: 16 additions & 0 deletions ny-portal/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { visionTool } from "@sanity/vision";
import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { schemaTypes } from "./sanity/schemas";

export default defineConfig({
name: "default",
basePath: "/studio",
title: "Jøkul Portal Studio",
projectId: process.env.NEXT_PUBLIC_SANITY_STUDIO_PROJECT_ID || "",
dataset: process.env.NEXT_PUBLIC_SANITY_STUDIO_DATASET || "test",
plugins: [structureTool(), visionTool()],
schema: {
types: schemaTypes,
},
});
1 change: 1 addition & 0 deletions ny-portal/sanity/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const schemaTypes = [];
8 changes: 8 additions & 0 deletions ny-portal/src/app/studio/[[...index]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client";

import { NextStudio } from "next-sanity/studio";
import config from "../../../../sanity.config";

export default function Studio() {
return <NextStudio config={config} />;
}
17 changes: 17 additions & 0 deletions ny-portal/src/app/studio/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const metadata = {
title: "Jøkul Portal Studio",
description:
"Velkommen til Jøkul Portal Studio. Her kan du redigere innholdet på Portalen.",
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
Loading
Loading