diff --git a/package.json b/package.json index 3ebce00..0f674dd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "private": true, "type": "module", "scripts": { - "validate": "node ./tests/ValidateServices.js", + "validate:images": "node ./tests/validateImages.js", + "validate:services": "node ./tests/ValidateServices.js", + "validate": "pnpm run validate:services && validate:images", "dev": "pnpm run validate && vite dev --mode development", "build": "pnpm run validate && vite build", "build-dev": "pnpm run validate && vite build --mode development", diff --git a/src/content/images.json b/src/content/images.json new file mode 100644 index 0000000..c519cf5 --- /dev/null +++ b/src/content/images.json @@ -0,0 +1,14 @@ +{ + "example_image": { + "publicId": "example_image", + "transformations": [ + { "width": 1200, "height": 627, "crop": "fill", "quality": "auto", "format": "auto" } + ] + }, + "another_image": { + "publicId": "another_image", + "transformations": [ + { "width": 800, "height": 600, "crop": "fill", "quality": "auto", "format": "auto" } + ] + } +} diff --git a/src/content/schema-categories.json b/src/content/schema-categories.json index 49df091..2c4b63e 100644 --- a/src/content/schema-categories.json +++ b/src/content/schema-categories.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Service category schema", "type": "object", - "required": ["title", "description", "id", "image", "services"], + "required": ["title", "description", "id", "services"], "additionalProperties": false, "properties": { "title": { @@ -26,8 +26,7 @@ "image": { "title": "Image", "description": "A featured image in previews and on top of page", - "type": "string", - "format": "uri" + "type": "string" }, "tags": { "title": "tags", @@ -41,7 +40,7 @@ "title": "services under the category", "type": "array", "items": { - "$ref": "./schema-services.json" + "$ref": "src/content/schema-services.json" } } } diff --git a/src/content/schema-services.json b/src/content/schema-services.json index 4d4b2d0..fba7982 100644 --- a/src/content/schema-services.json +++ b/src/content/schema-services.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Service schema", "type": "object", - "required": ["title", "description", "id", "image", "duration", "price"], + "required": ["title", "description", "id", "duration", "price"], "additionalProperties": false, "properties": { "title": { @@ -24,8 +24,7 @@ "image": { "title": "Image", "description": "A featured image in previews and on top of page", - "type": "string", - "format": "uri" + "type": "string" }, "price": { "title": "Price", diff --git a/src/content/dalsi-sluzby/dalsi-sluzby.json b/src/content/services/dalsi-sluzby/dalsi-sluzby.json similarity index 95% rename from src/content/dalsi-sluzby/dalsi-sluzby.json rename to src/content/services/dalsi-sluzby/dalsi-sluzby.json index dd99b23..db447dc 100644 --- a/src/content/dalsi-sluzby/dalsi-sluzby.json +++ b/src/content/services/dalsi-sluzby/dalsi-sluzby.json @@ -1,5 +1,5 @@ { - "$schema": "../schema-categories.json", + "$schema": "../../schema-categories.json", "title": "DALŠÍ VELMI OBLÍBENÉ SLUŽBY", "description": "A description of a description", "id": "depilace", diff --git a/src/content/depilace/depilace.json b/src/content/services/depilace/depilace.json similarity index 97% rename from src/content/depilace/depilace.json rename to src/content/services/depilace/depilace.json index cbb175f..dad810d 100644 --- a/src/content/depilace/depilace.json +++ b/src/content/services/depilace/depilace.json @@ -1,5 +1,5 @@ { - "$schema": "../schema-categories.json", + "$schema": "../../schema-categories.json", "title": "Depilace", "description": "A description of a description", "id": "depilace", diff --git a/src/content/kosmeticke-osetreni/kosmeticke-osetreni.json b/src/content/services/kosmeticke-osetreni/kosmeticke-osetreni.json similarity index 98% rename from src/content/kosmeticke-osetreni/kosmeticke-osetreni.json rename to src/content/services/kosmeticke-osetreni/kosmeticke-osetreni.json index 2e6b986..f71bd4a 100644 --- a/src/content/kosmeticke-osetreni/kosmeticke-osetreni.json +++ b/src/content/services/kosmeticke-osetreni/kosmeticke-osetreni.json @@ -1,5 +1,5 @@ { - "$schema": "../schema-categories.json", + "$schema": "../../schema-categories.json", "title": "Kosmetické ošetření", "description": "A description of a description", "id": "depilace", diff --git a/src/content/kosmeticke-osetreni/mikrodermabraze/mikrodermabraze.md b/src/content/services/kosmeticke-osetreni/mikrodermabraze/mikrodermabraze.md similarity index 100% rename from src/content/kosmeticke-osetreni/mikrodermabraze/mikrodermabraze.md rename to src/content/services/kosmeticke-osetreni/mikrodermabraze/mikrodermabraze.md diff --git a/src/content/permanentni-make-up/permanentni-make-up.json b/src/content/services/permanentni-make-up/permanentni-make-up.json similarity index 97% rename from src/content/permanentni-make-up/permanentni-make-up.json rename to src/content/services/permanentni-make-up/permanentni-make-up.json index 2df1c8e..61dad1e 100644 --- a/src/content/permanentni-make-up/permanentni-make-up.json +++ b/src/content/services/permanentni-make-up/permanentni-make-up.json @@ -1,5 +1,5 @@ { - "$schema": "../schema-categories.json", + "$schema": "../../schema-categories.json", "title": "Permanentní make-up", "description": "A description of a description", "id": "pmu", diff --git a/src/content/permanentni-make-up/pmu-linky/pmu-linky.md b/src/content/services/permanentni-make-up/pmu-linky/pmu-linky.md similarity index 100% rename from src/content/permanentni-make-up/pmu-linky/pmu-linky.md rename to src/content/services/permanentni-make-up/pmu-linky/pmu-linky.md diff --git a/src/content/permanentni-make-up/pmu-oboci/pmu-oboci.md b/src/content/services/permanentni-make-up/pmu-oboci/pmu-oboci.md similarity index 100% rename from src/content/permanentni-make-up/pmu-oboci/pmu-oboci.md rename to src/content/services/permanentni-make-up/pmu-oboci/pmu-oboci.md diff --git a/src/content/permanentni-make-up/pmu-rty/pmu-rty.md b/src/content/services/permanentni-make-up/pmu-rty/pmu-rty.md similarity index 100% rename from src/content/permanentni-make-up/pmu-rty/pmu-rty.md rename to src/content/services/permanentni-make-up/pmu-rty/pmu-rty.md diff --git a/src/content/permanentni-make-up/pmu/pmu.md b/src/content/services/permanentni-make-up/pmu/pmu.md similarity index 100% rename from src/content/permanentni-make-up/pmu/pmu.md rename to src/content/services/permanentni-make-up/pmu/pmu.md diff --git a/src/content/vakuslim/vakuslim.json b/src/content/services/vakuslim/vakuslim.json similarity index 96% rename from src/content/vakuslim/vakuslim.json rename to src/content/services/vakuslim/vakuslim.json index 0c4d193..500fac2 100644 --- a/src/content/vakuslim/vakuslim.json +++ b/src/content/services/vakuslim/vakuslim.json @@ -1,5 +1,5 @@ { - "$schema": "../schema-categories.json", + "$schema": "../../schema-categories.json", "title": "Vakuslim 48 - zeštíhlující procedura", "description": "A description of a description", "id": "depilace", diff --git a/src/lib/components/services/ProductLayout.svelte b/src/lib/components/services/ProductLayout.svelte deleted file mode 100644 index 65519e4..0000000 --- a/src/lib/components/services/ProductLayout.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - -
-
- `${product.name}` -
- -
-
diff --git a/src/lib/components/services/ServiceCard.svelte b/src/lib/components/services/ServiceCard.svelte index a25bde3..fa2c4f6 100644 --- a/src/lib/components/services/ServiceCard.svelte +++ b/src/lib/components/services/ServiceCard.svelte @@ -3,26 +3,27 @@ import type { Service } from '$lib/types/service'; import convertMinutesToHours from '$lib/utils/minToH'; - export let item: Service['items'][number]; + export let service: Service[][number]; - +
- Post + // getImageLink maps all image links based on the services id, needs cloudinary implementation to work. +
- +
-

{item.name}

+

{service.title}

...Zjistěte více @@ -32,11 +33,11 @@