diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2023-02-19 14:08:33 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2023-02-19 14:08:33 +0100 |
| commit | 54bbc06bd84437c6b38e2f6c57060f21a8318720 (patch) | |
| tree | a0f9beb425829e304cdf239709e7d23a13b0fcc8 /sanity | |
| parent | 06ce8fbab52c5c25a67a1518f1888b083b5edde3 (diff) | |
| download | auroraklinikken.no-54bbc06bd84437c6b38e2f6c57060f21a8318720.tar.xz auroraklinikken.no-54bbc06bd84437c6b38e2f6c57060f21a8318720.zip | |
.
Diffstat (limited to 'sanity')
| -rw-r--r-- | sanity/package.json | 2 | ||||
| -rw-r--r-- | sanity/sanity.cli.ts | 6 | ||||
| -rw-r--r-- | sanity/sanity.config.ts | 20 | ||||
| -rw-r--r-- | sanity/schemas/_locales.ts | 8 | ||||
| -rw-r--r-- | sanity/schemas/contact.ts | 64 | ||||
| -rw-r--r-- | sanity/schemas/description.ts | 40 | ||||
| -rw-r--r-- | sanity/schemas/hero.ts | 58 | ||||
| -rw-r--r-- | sanity/schemas/index.ts | 2 | ||||
| -rw-r--r-- | sanity/schemas/localized-string.ts | 36 | ||||
| -rw-r--r-- | sanity/tailwind.config.js | 8 |
10 files changed, 119 insertions, 125 deletions
diff --git a/sanity/package.json b/sanity/package.json index 1782223..e79536c 100644 --- a/sanity/package.json +++ b/sanity/package.json @@ -35,4 +35,4 @@ "bracketSpacing": false, "singleQuote": false } -}
\ No newline at end of file +} diff --git a/sanity/sanity.cli.ts b/sanity/sanity.cli.ts index d4f037d..290d8cd 100644 --- a/sanity/sanity.cli.ts +++ b/sanity/sanity.cli.ts @@ -1,8 +1,8 @@ -import { defineCliConfig } from 'sanity/cli' +import {defineCliConfig} from "sanity/cli"; export default defineCliConfig({ api: { projectId: process.env.SANITY_STUDIO_API_PROJECT_ID ?? "", dataset: process.env.SANITY_STUDIO_API_DATASET ?? "", - } -})
\ No newline at end of file + }, +}); diff --git a/sanity/sanity.config.ts b/sanity/sanity.config.ts index 07c650b..0aa425e 100644 --- a/sanity/sanity.config.ts +++ b/sanity/sanity.config.ts @@ -1,19 +1,19 @@ -import { defineConfig } from 'sanity' -import { visionTool } from '@sanity/vision' -import { schemaTypes } from './schemas' -import { withDocumentI18nPlugin } from '@sanity/document-internationalization' -import { baseLanguage, supportedLanguages } from './schemas/_locales' +import {defineConfig} from "sanity"; +import {visionTool} from "@sanity/vision"; +import {schemaTypes} from "./schemas"; +import {withDocumentI18nPlugin} from "@sanity/document-internationalization"; +import {baseLanguage, supportedLanguages} from "./schemas/_locales"; export default defineConfig({ - name: 'default', - title: 'auroraklinikken.no', + name: "default", + title: "auroraklinikken.no", projectId: process.env.SANITY_STUDIO_API_PROJECT_ID ?? "", dataset: process.env.SANITY_STUDIO_API_DATASET ?? "", plugins: withDocumentI18nPlugin([visionTool()], { - languages: supportedLanguages.map(el => el.iso), - fallbackLanguageSelect: supportedLanguages.find(l => l.isDefault)?.iso as any + languages: supportedLanguages.map((el) => el.iso), + fallbackLanguageSelect: supportedLanguages.find((l) => l.isDefault)?.iso as any, }), schema: { types: schemaTypes, }, -}) +}); diff --git a/sanity/schemas/_locales.ts b/sanity/schemas/_locales.ts index 8baca54..20273bd 100644 --- a/sanity/schemas/_locales.ts +++ b/sanity/schemas/_locales.ts @@ -1,5 +1,5 @@ export const supportedLanguages = [ - { id: 'en', iso: "en-GB", title: 'English' }, - { id: 'nb', iso: "nb-NO", title: 'Norwegian', isDefault: true }, -] -export const baseLanguage = supportedLanguages.find(l => l.isDefault) as { id: string, title: string };
\ No newline at end of file + {id: "en", iso: "en-GB", title: "English"}, + {id: "nb", iso: "nb-NO", title: "Norwegian", isDefault: true}, +]; +export const baseLanguage = supportedLanguages.find((l) => l.isDefault) as {id: string; title: string}; diff --git a/sanity/schemas/contact.ts b/sanity/schemas/contact.ts index 33bda69..1543e07 100644 --- a/sanity/schemas/contact.ts +++ b/sanity/schemas/contact.ts @@ -1,35 +1,35 @@ -import { baseLanguage } from "./_locales"; +import {baseLanguage} from "./_locales"; export default { - name: 'contact', - type: 'document', - title: 'Contact section', - preview: { - select: { - title: `title.${baseLanguage.id}` - } + name: "contact", + type: "document", + title: "Contact section", + preview: { + select: { + title: `title.${baseLanguage.id}`, }, - fields: [ - { - title: "Address lines", - name: 'addressLines', - type: 'array', - of: [{ type: 'localizedString' }] - }, - { - title: "Email", - name: "email", - type: "string", - }, - { - title: "Phone", - name: "phone", - type: "string" - }, - { - title: "Phone hours", - name: "phoneHours", - type: "localizedString" - } - ] -}
\ No newline at end of file + }, + fields: [ + { + title: "Address lines", + name: "addressLines", + type: "array", + of: [{type: "localizedString"}], + }, + { + title: "Email", + name: "email", + type: "string", + }, + { + title: "Phone", + name: "phone", + type: "string", + }, + { + title: "Phone hours", + name: "phoneHours", + type: "localizedString", + }, + ], +}; diff --git a/sanity/schemas/description.ts b/sanity/schemas/description.ts index d5d5ff3..f3fac23 100644 --- a/sanity/schemas/description.ts +++ b/sanity/schemas/description.ts @@ -1,23 +1,21 @@ -import { defineType } from "sanity"; +import {defineType} from "sanity"; export default defineType({ - name: 'description', - type: 'document', - title: 'Description section', - i18n: true, - fields: [ - { - title: "Title", - name: 'title', - type: 'string', - }, - { - title: "Content", - name: "content", - type: "array", - of: [ - { type: "block" } - ] - } - ] -})
\ No newline at end of file + name: "description", + type: "document", + title: "Description section", + i18n: true, + fields: [ + { + title: "Title", + name: "title", + type: "string", + }, + { + title: "Content", + name: "content", + type: "array", + of: [{type: "block"}], + }, + ], +}); diff --git a/sanity/schemas/hero.ts b/sanity/schemas/hero.ts index 8534675..30abd1c 100644 --- a/sanity/schemas/hero.ts +++ b/sanity/schemas/hero.ts @@ -1,33 +1,33 @@ -import { defineType } from "sanity"; +import {defineType} from "sanity"; export default defineType({ - name: 'hero', - type: 'document', - title: 'Hero section', - i18n: true, - fields: [ + name: "hero", + type: "document", + title: "Hero section", + i18n: true, + fields: [ + { + title: "Title", + name: "title", + type: "string", + }, + { + title: "Content", + name: "content", + type: "array", + of: [{type: "block"}], + }, + { + title: "Image", + name: "image", + type: "image", + fields: [ { - title: "Title", - name: 'title', - type: 'string', + title: "Alternative text", + name: "alt", + type: "string", }, - { - title: "Content", - name: "content", - type: "array", - of: [{ type: "block" }] - }, - { - title: "Image", - name: "image", - type: "image", - fields: [ - { - title: "Alternative text", - name: 'alt', - type: 'string', - } - ] - } - ] -})
\ No newline at end of file + ], + }, + ], +}); diff --git a/sanity/schemas/index.ts b/sanity/schemas/index.ts index 9dfc403..76072e5 100644 --- a/sanity/schemas/index.ts +++ b/sanity/schemas/index.ts @@ -3,4 +3,4 @@ import description from "./description"; import hero from "./hero"; import localizedString from "./localized-string"; -export const schemaTypes = [contact, localizedString, description, hero]
\ No newline at end of file +export const schemaTypes = [contact, localizedString, description, hero]; diff --git a/sanity/schemas/localized-string.ts b/sanity/schemas/localized-string.ts index 6ff7424..e4bcff6 100644 --- a/sanity/schemas/localized-string.ts +++ b/sanity/schemas/localized-string.ts @@ -1,20 +1,20 @@ -import { supportedLanguages } from "./_locales"; +import {supportedLanguages} from "./_locales"; export default { - title: 'Localized string', - name: 'localizedString', - type: 'object', - fieldsets: [ - { - title: 'Translations', - name: 'translations', - options: { collapsible: true } - } - ], - fields: supportedLanguages.map(lang => ({ - title: lang.title, - name: lang.id, - type: 'string', - fieldset: lang.isDefault ? null : 'translations' - })) -} + title: "Localized string", + name: "localizedString", + type: "object", + fieldsets: [ + { + title: "Translations", + name: "translations", + options: {collapsible: true}, + }, + ], + fields: supportedLanguages.map((lang) => ({ + title: lang.title, + name: lang.id, + type: "string", + fieldset: lang.isDefault ? null : "translations", + })), +}; diff --git a/sanity/tailwind.config.js b/sanity/tailwind.config.js index 92a1e3a..d05f283 100644 --- a/sanity/tailwind.config.js +++ b/sanity/tailwind.config.js @@ -1,11 +1,7 @@ module.exports = { - content: [ - './pages/**/*.{js,ts,jsx,tsx}', - './components/**/*.{js,ts,jsx,tsx}', - './app/**/*.{js,ts,jsx,tsx}', - ], + content: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", "./app/**/*.{js,ts,jsx,tsx}"], theme: { extend: {}, }, plugins: [], -} +}; |
