From bbb6f55481aa81694ef1e3dd4ca1b5f4f8902501 Mon Sep 17 00:00:00 2001 From: Riley1101 Date: Wed, 22 Nov 2023 21:00:39 -0500 Subject: [PATCH 1/5] update on image design tweaks --- src/lib/components/common/Footer.svelte | 2 +- src/lib/sanity/image/SanityImage.svelte | 5 +++-- src/routes/donate/+page.svelte | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/components/common/Footer.svelte b/src/lib/components/common/Footer.svelte index fb5f3b3..18357ef 100644 --- a/src/lib/components/common/Footer.svelte +++ b/src/lib/components/common/Footer.svelte @@ -23,7 +23,7 @@

Contact Us

diff --git a/src/lib/sanity/image/SanityImage.svelte b/src/lib/sanity/image/SanityImage.svelte index b4a0803..6515934 100644 --- a/src/lib/sanity/image/SanityImage.svelte +++ b/src/lib/sanity/image/SanityImage.svelte @@ -27,15 +27,16 @@ diff --git a/src/routes/donate/+page.svelte b/src/routes/donate/+page.svelte index 62354d4..c8e63a6 100644 --- a/src/routes/donate/+page.svelte +++ b/src/routes/donate/+page.svelte @@ -12,9 +12,9 @@ -
+
-
+
Date: Wed, 22 Nov 2023 21:37:54 -0500 Subject: [PATCH 2/5] minor tweak on donate hero --- src/lib/components/common/DonateHero.svelte | 0 .../common/portableText/components.js | 64 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 src/lib/components/common/DonateHero.svelte diff --git a/src/lib/components/common/DonateHero.svelte b/src/lib/components/common/DonateHero.svelte new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/components/common/portableText/components.js b/src/lib/components/common/portableText/components.js index df2d1ce..c103ee2 100644 --- a/src/lib/components/common/portableText/components.js +++ b/src/lib/components/common/portableText/components.js @@ -9,36 +9,36 @@ import Em from './Em.svelte'; import CodeInput from './CodeInput.svelte'; export const components = { - types: { - code: CodeInput, - image: Image - }, - marks: { - em: Em, - link: Link, - strong: Strong - }, - block: { - normal: Paragraph, - // blockquote: Quote, - // Re-using the same component across multiple styles - h1: Heading, - h2: Heading, - h3: Heading, - h4: Heading - }, - list: { - // Swap only the list parts you need - bullet: List, - // Custom user-defined list type - normal: List, - number: List - // checklist: ChecklistWrapper - }, - listItem: { - number: ListItem, - bullet: ListItem, - normal: ListItem - // checklist: ChecklistItem - } + types: { + code: CodeInput, + image: Image + }, + marks: { + em: Em, + link: Link, + strong: Strong + }, + block: { + normal: Paragraph, + // blockquote: Quote, + // Re-using the same component across multiple styles + h1: Heading, + h2: Heading, + h3: Heading, + h4: Heading + }, + list: { + // Swap only the list parts you need + bullet: List, + // Custom user-defined list type + normal: List, + number: List + // checklist: ChecklistWrapper + }, + listItem: { + number: ListItem, + bullet: ListItem, + normal: ListItem + // checklist: ChecklistItem + } }; From 6d5c8ce0c5fd95ca5304e41a205989dcb4187d07 Mon Sep 17 00:00:00 2001 From: Riley1101 Date: Fri, 24 Nov 2023 10:51:25 -0500 Subject: [PATCH 3/5] update on homepage article sorting and cover image resize --- src/lib/components/page/home/Hero.svelte | 5 +++-- src/routes/+page.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/lib/components/page/home/Hero.svelte b/src/lib/components/page/home/Hero.svelte index 0462b31..b730cfc 100644 --- a/src/lib/components/page/home/Hero.svelte +++ b/src/lib/components/page/home/Hero.svelte @@ -6,11 +6,12 @@ export let data; -
+
diff --git a/src/routes/+page.js b/src/routes/+page.js index 82cffe7..a478043 100644 --- a/src/routes/+page.js +++ b/src/routes/+page.js @@ -20,13 +20,13 @@ const query = `{ }, }, }, - "events":*[_type =="event"][0...6]{ + "events":*[_type =="event"] | order(publishedAt desc) [0...6] { "slug":slug.current, title, description, publishedAt }, - "news":*[_type =="news"][0...6]{ + "news":*[_type =="news"] | order(publishedAt desc)[0...6] { "slug":slug.current, title, description, @@ -39,12 +39,12 @@ const query = `{ * @type {import('@sveltejs/kit').Load} */ export const load = async () => { - /** - * @type {import('$lib/types/homePage').HomePageData} - */ - const data = await getPageData(query); - if (!data.homePage) throw error(404, 'Not Found'); - return { - data - }; + /** + * @type {import('$lib/types/homePage').HomePageData} + */ + const data = await getPageData(query); + if (!data.homePage) throw error(404, 'Not Found'); + return { + data + }; }; From 3ed87e59ca2407d78dd3574ee56917d35233df1d Mon Sep 17 00:00:00 2001 From: Riley1101 Date: Fri, 24 Nov 2023 11:05:11 -0500 Subject: [PATCH 4/5] minor tweaks and news are blogs now --- src/lib/components/common/NewsCard.svelte | 2 +- src/lib/components/common/RelatedArticle.svelte | 2 +- src/lib/components/page/home/Highlight.svelte | 2 +- src/lib/components/page/nlp/NLPArticle.svelte | 2 +- src/lib/site/nav.js | 4 ++-- src/lib/utils/algolia.js | 4 ++-- src/routes/api/algolia/+server.js | 2 +- src/routes/{news => blogs}/+page.js | 0 src/routes/{news => blogs}/+page.svelte | 0 src/routes/{news => blogs}/[slug]/+page.js | 4 ++-- src/routes/{news => blogs}/[slug]/+page.svelte | 0 src/routes/faqs/+page.svelte | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) rename src/routes/{news => blogs}/+page.js (100%) rename src/routes/{news => blogs}/+page.svelte (100%) rename src/routes/{news => blogs}/[slug]/+page.js (96%) rename src/routes/{news => blogs}/[slug]/+page.svelte (100%) diff --git a/src/lib/components/common/NewsCard.svelte b/src/lib/components/common/NewsCard.svelte index 9fe877d..e531b15 100644 --- a/src/lib/components/common/NewsCard.svelte +++ b/src/lib/components/common/NewsCard.svelte @@ -7,7 +7,7 @@ export let data; - + 0}

Related Articles

-
+
{#each data as itm} {/each} diff --git a/src/lib/components/page/home/Highlight.svelte b/src/lib/components/page/home/Highlight.svelte index 5efaef7..bf055da 100644 --- a/src/lib/components/page/home/Highlight.svelte +++ b/src/lib/components/page/home/Highlight.svelte @@ -46,7 +46,7 @@

diff --git a/src/lib/site/nav.js b/src/lib/site/nav.js index d3222d6..b270abc 100644 --- a/src/lib/site/nav.js +++ b/src/lib/site/nav.js @@ -8,8 +8,8 @@ export const navs = [ path: '/' }, { - name: 'News', - path: '/news' + name: 'Blogs', + path: '/blogs' }, { name: 'Events', diff --git a/src/lib/utils/algolia.js b/src/lib/utils/algolia.js index b9b0be9..4b6acaa 100644 --- a/src/lib/utils/algolia.js +++ b/src/lib/utils/algolia.js @@ -23,13 +23,13 @@ export function init_autocomplete() { getSources({ query }) { return [ { - sourceId: 'news', + sourceId: 'blog', getItems() { return getAlgoliaResults({ searchClient, queries: [ { - indexName: 'news', + indexName: 'blogs', query, params: { hitsPerPage: 3, diff --git a/src/routes/api/algolia/+server.js b/src/routes/api/algolia/+server.js index 47aef77..861b3a7 100644 --- a/src/routes/api/algolia/+server.js +++ b/src/routes/api/algolia/+server.js @@ -28,7 +28,7 @@ export async function GET({ url }) { } try { const { news, events } = await sanityClient.fetch(query); - const newsIndex = searchClient.initIndex('news'); + const newsIndex = searchClient.initIndex('blogs'); const eventsIndex = searchClient.initIndex('events'); // @ts-ignore await newsIndex.saveObjects(news); diff --git a/src/routes/news/+page.js b/src/routes/blogs/+page.js similarity index 100% rename from src/routes/news/+page.js rename to src/routes/blogs/+page.js diff --git a/src/routes/news/+page.svelte b/src/routes/blogs/+page.svelte similarity index 100% rename from src/routes/news/+page.svelte rename to src/routes/blogs/+page.svelte diff --git a/src/routes/news/[slug]/+page.js b/src/routes/blogs/[slug]/+page.js similarity index 96% rename from src/routes/news/[slug]/+page.js rename to src/routes/blogs/[slug]/+page.js index 7a9cd9d..74f8287 100644 --- a/src/routes/news/[slug]/+page.js +++ b/src/routes/blogs/[slug]/+page.js @@ -2,7 +2,7 @@ import { error } from '@sveltejs/kit'; import { getPageData } from '$lib/sanity/query'; const query = `*[_type =="news" && slug.current==$slug][0]{ - ..., + ..., "authors":authors[]->{ _id, name, @@ -14,7 +14,7 @@ const query = `*[_type =="news" && slug.current==$slug][0]{ _id, "slug": slug.current, description, - coverImage + coverImage } }`; diff --git a/src/routes/news/[slug]/+page.svelte b/src/routes/blogs/[slug]/+page.svelte similarity index 100% rename from src/routes/news/[slug]/+page.svelte rename to src/routes/blogs/[slug]/+page.svelte diff --git a/src/routes/faqs/+page.svelte b/src/routes/faqs/+page.svelte index 4e5497e..4da1793 100644 --- a/src/routes/faqs/+page.svelte +++ b/src/routes/faqs/+page.svelte @@ -29,7 +29,7 @@ {#each item.qanda as itm} - + {itm.question} From 9a4e689b70aef3857b5e0a1051e166862b8aaa34 Mon Sep 17 00:00:00 2001 From: Riley1101 Date: Fri, 24 Nov 2023 11:17:14 -0500 Subject: [PATCH 5/5] update on precommit and formatting --- .husky/pre-commit | 7 + jsconfig.json | 4 +- package.json | 6 +- pnpm-lock.yaml | 9 + src/lib/studio/sanity.config.js | 34 ++-- src/lib/studio/schema/common/blockContent.jsx | 143 ++++++++------- src/lib/studio/schema/common/index.js | 30 ++-- src/lib/studio/utils/deskStructure.js | 164 +++++++++--------- src/lib/types/newsPage.ts | 4 +- src/lib/types/termPage.ts | 28 +-- src/routes/blogs/+page.svelte | 1 + tailwind.config.js | 30 ++-- 12 files changed, 237 insertions(+), 223 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..79f3e60 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run check +npm run format +npm run lint + diff --git a/jsconfig.json b/jsconfig.json index fe45e13..6b40d38 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,6 +1,7 @@ { "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": { + "jsx": "react", "allowJs": true, "checkJs": true, "esModuleInterop": true, @@ -9,7 +10,8 @@ "skipLibCheck": true, "sourceMap": true, "strict": true - } + }, + "exclude": ["./src/lib/studio/**/*"] // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files // // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes diff --git a/package.json b/package.json index e81a90e..c2b34f1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", "lint": "prettier --plugin-search-dir . --check . && eslint .", - "format": "prettier --plugin-search-dir . --write ." + "format": "prettier --plugin-search-dir . --write .", + "prepare": "husky install" }, "devDependencies": { "@flydotio/dockerfile": "^0.4.11", @@ -35,7 +36,8 @@ "svelte-check": "^3.5.2", "tailwindcss": "^3.3.3", "typescript": "^5.2.2", - "vite": "^4.4.9" + "vite": "^4.4.9", + "husky": "^8.0.0" }, "type": "module", "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4cfefc..adf6d1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,6 +127,9 @@ devDependencies: eslint-plugin-svelte: specifier: ^2.33.2 version: 2.33.2(eslint@8.50.0)(svelte@3.59.2) + husky: + specifier: ^8.0.0 + version: 8.0.3 postcss: specifier: ^8.4.31 version: 8.4.31 @@ -4654,6 +4657,12 @@ packages: resolution: {integrity: sha512-4+p3fCRF21oUqxhK0yZ6yaSP/H5/wZumc7q1fH99RkW7Q13aAxDeP78BKjoR+6y+kaHqKF/JWuQhsNuuI2NKtA==} dev: false + /husky@8.0.3: + resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} + engines: {node: '>=14'} + hasBin: true + dev: true + /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} diff --git a/src/lib/studio/sanity.config.js b/src/lib/studio/sanity.config.js index e874365..58676ea 100644 --- a/src/lib/studio/sanity.config.js +++ b/src/lib/studio/sanity.config.js @@ -8,21 +8,21 @@ import { newDeskStructure } from './utils/deskStructure'; import { contentGraphView } from 'sanity-plugin-graph-view'; export default defineConfig({ - name: 'default', - title: 'ShanIIT', - projectId: 'za3lzlmc', - dataset: 'live', - basePath: '/studio', - plugins: [ - deskTool({ - structure: newDeskStructure - }), - visionTool(), - contentGraphView({}), - unsplashImageAsset(), - codeInput() - ], - schema: { - types: schemaTypes - } + name: 'default', + title: 'ShanIIT', + projectId: 'za3lzlmc', + dataset: 'live', + basePath: '/studio', + plugins: [ + deskTool({ + structure: newDeskStructure + }), + visionTool(), + contentGraphView({}), + unsplashImageAsset(), + codeInput() + ], + schema: { + types: schemaTypes + } }); diff --git a/src/lib/studio/schema/common/blockContent.jsx b/src/lib/studio/schema/common/blockContent.jsx index 6b7ec95..39e4487 100644 --- a/src/lib/studio/schema/common/blockContent.jsx +++ b/src/lib/studio/schema/common/blockContent.jsx @@ -1,80 +1,73 @@ import { defineArrayMember, defineType } from 'sanity'; -import React from 'react'; - -const FontSizeIcon = () => T; - -const FontSizeComponent = (props) => ( - {props.children} -); export default defineType({ - title: 'Block Content', - name: 'blockContent', - type: 'array', - of: [ - defineArrayMember({ - type: 'code', - title: 'Code', - options: { - theme: 'github', - darkTheme: 'terminal' - } - }), - defineArrayMember({ - title: 'Image', - type: 'image', - fields: [ - { - name: 'alt', - type: 'string', - title: 'Alternative text' - } - ] - }), - defineArrayMember({ - title: 'Block', - type: 'block', - // Styles let you set what your user can mark up blocks with. These - // correspond with HTML tags, but you can set any title or value - // you want and decide how you want to deal with it where you want to - // use your content. - styles: [ - { title: 'Normal', value: 'normal' }, - { title: 'H1', value: 'h1' }, - { title: 'H2', value: 'h2' }, - { title: 'H3', value: 'h3' }, - { title: 'H4', value: 'h4' }, - { title: 'Quote', value: 'blockquote' } - ], - lists: [ - { title: 'Bullet', value: 'bullet' }, - { title: 'Numbered', value: 'number' } - ], + title: 'Block Content', + name: 'blockContent', + type: 'array', + of: [ + defineArrayMember({ + type: 'code', + title: 'Code', + options: { + theme: 'github', + darkTheme: 'terminal' + } + }), + defineArrayMember({ + title: 'Image', + type: 'image', + fields: [ + { + name: 'alt', + type: 'string', + title: 'Alternative text' + } + ] + }), + defineArrayMember({ + title: 'Block', + type: 'block', + // Styles let you set what your user can mark up blocks with. These + // correspond with HTML tags, but you can set any title or value + // you want and decide how you want to deal with it where you want to + // use your content. + styles: [ + { title: 'Normal', value: 'normal' }, + { title: 'H1', value: 'h1' }, + { title: 'H2', value: 'h2' }, + { title: 'H3', value: 'h3' }, + { title: 'H4', value: 'h4' }, + { title: 'Quote', value: 'blockquote' } + ], + lists: [ + { title: 'Bullet', value: 'bullet' }, + { title: 'Numbered', value: 'number' } + ], - // Marks let you mark up inline text in the block editor. - marks: { - // Decorators usually describe a single property – e.g. a typographic - // preference or highlighting by editors. - decorators: [ - { title: 'Strong', value: 'strong' }, - { title: 'Emphasis', value: 'em' } - ], - // Annotations can be any object structure – e.g. a link or a footnote. - annotations: [ - { - title: 'URL', - name: 'link', - type: 'object', - fields: [ - { - title: 'URL', - name: 'href', - type: 'url' - } - ] - } - ] - } - }) - ] + // Marks let you mark up inline text in the block editor. + marks: { + // Decorators usually describe a single property – e.g. a typographic + // preference or highlighting by editors. + decorators: [ + { title: 'Strong', value: 'strong' }, + { title: 'Emphasis', value: 'em' } + ], + // Annotations can be any object structure – e.g. a link or a footnote. + annotations: [ + { + title: 'URL', + name: 'link', + type: 'object', + fields: [ + { + title: 'URL', + name: 'href', + type: 'url' + } + ] + } + ] + } + }) + ] }); diff --git a/src/lib/studio/schema/common/index.js b/src/lib/studio/schema/common/index.js index 5d378e6..bc4bbda 100644 --- a/src/lib/studio/schema/common/index.js +++ b/src/lib/studio/schema/common/index.js @@ -15,19 +15,19 @@ import payment_method from './payment_method'; import donator from './donator'; export default [ - userguide, - payment_method, - keyboard_or_font, - faq, - banner, - link, - news, - baseSeo, - term, - category, - blockContent, - event, - author, - rowBanner, - donator + userguide, + payment_method, + keyboard_or_font, + faq, + banner, + link, + news, + baseSeo, + term, + category, + blockContent, + event, + author, + rowBanner, + donator ]; diff --git a/src/lib/studio/utils/deskStructure.js b/src/lib/studio/utils/deskStructure.js index 50172f1..5689083 100644 --- a/src/lib/studio/utils/deskStructure.js +++ b/src/lib/studio/utils/deskStructure.js @@ -3,92 +3,92 @@ * @param {{ schemaType: string, id: string, title: string }} param1 */ const documentItem = (S, { schemaType, id, title }) => { - return S.listItem() - .title(title) - .schemaType(schemaType) - .child(S.document().schemaType(schemaType).id(id).title(title)); + return S.listItem() + .title(title) + .schemaType(schemaType) + .child(S.document().schemaType(schemaType).id(id).title(title)); }; /** * @param {import('sanity/desk').StructureBuilder} S */ export function newDeskStructure(S) { - return S.list() - .title('Content') - .id('__root__') - .items([ - documentItem(S, { - title: 'Home', - id: 'homePage', - schemaType: 'homePage' - }), - documentItem(S, { - title: 'About', - id: 'aboutPage', - schemaType: 'aboutPage' - }), - documentItem(S, { - title: 'Faqs', - id: 'faqPage', - schemaType: 'faqPage' - }), - documentItem(S, { - title: 'NLP', - id: 'nlpPage', - schemaType: 'nlpPage' - }), - documentItem(S, { - title: 'Keyboards & Fonts', - id: 'keyboard_or_font_page', - schemaType: 'keyboard_or_font_page' - }), - documentItem(S, { - title: 'News Articles', - id: 'newsPage', - schemaType: 'newsPage' - }), - documentItem(S, { - title: 'Events Articles', - id: 'eventsPage', - schemaType: 'eventsPage' - }), - documentItem(S, { - title: 'UserGuides', - id: 'userGuidePage', - schemaType: 'userGuidePage' - }), - documentItem(S, { - title: 'Terms', - id: 'termsPage', - schemaType: 'termsPage' - }), - documentItem(S, { - title: 'Contact', - id: 'contactPage', - schemaType: 'contactPage' - }), - documentItem(S, { - title: 'Donate', - id: 'donatePage', - schemaType: 'donatePage' - }), - S.divider(), - ...S.documentTypeListItems().filter( - (item) => - ![ - 'site', - 'homePage', - 'faqPage', - 'keyboard_or_font_page', - 'nlpPage', - 'aboutPage', - 'newsPage', - 'termsPage', - 'contactPage', - 'eventsPage', - 'userGuidePage', - 'donatePage' - ].includes(item.getId() ?? '') - ) - ]); + return S.list() + .title('Content') + .id('__root__') + .items([ + documentItem(S, { + title: 'Home', + id: 'homePage', + schemaType: 'homePage' + }), + documentItem(S, { + title: 'About', + id: 'aboutPage', + schemaType: 'aboutPage' + }), + documentItem(S, { + title: 'Faqs', + id: 'faqPage', + schemaType: 'faqPage' + }), + documentItem(S, { + title: 'NLP', + id: 'nlpPage', + schemaType: 'nlpPage' + }), + documentItem(S, { + title: 'Keyboards & Fonts', + id: 'keyboard_or_font_page', + schemaType: 'keyboard_or_font_page' + }), + documentItem(S, { + title: 'News Articles', + id: 'newsPage', + schemaType: 'newsPage' + }), + documentItem(S, { + title: 'Events Articles', + id: 'eventsPage', + schemaType: 'eventsPage' + }), + documentItem(S, { + title: 'UserGuides', + id: 'userGuidePage', + schemaType: 'userGuidePage' + }), + documentItem(S, { + title: 'Terms', + id: 'termsPage', + schemaType: 'termsPage' + }), + documentItem(S, { + title: 'Contact', + id: 'contactPage', + schemaType: 'contactPage' + }), + documentItem(S, { + title: 'Donate', + id: 'donatePage', + schemaType: 'donatePage' + }), + S.divider(), + ...S.documentTypeListItems().filter( + (item) => + ![ + 'site', + 'homePage', + 'faqPage', + 'keyboard_or_font_page', + 'nlpPage', + 'aboutPage', + 'newsPage', + 'termsPage', + 'contactPage', + 'eventsPage', + 'userGuidePage', + 'donatePage' + ].includes(item.getId() ?? '') + ) + ]); } diff --git a/src/lib/types/newsPage.ts b/src/lib/types/newsPage.ts index 5dcadbc..f60e695 100644 --- a/src/lib/types/newsPage.ts +++ b/src/lib/types/newsPage.ts @@ -5,7 +5,7 @@ export interface NewsPage { title: string; news: News[]; categories: { - name: string; - slug: string; + title: string; + _id: string; }[]; } diff --git a/src/lib/types/termPage.ts b/src/lib/types/termPage.ts index 0ccb7df..1530bee 100644 --- a/src/lib/types/termPage.ts +++ b/src/lib/types/termPage.ts @@ -1,22 +1,22 @@ export interface Term { - seo: BaseMetaData; - _id: string; - description: string; - type: string; - _createdAt: string; - title: string; - body: PortableText; - character: string; - slug: { - current: string; - }; + seo: BaseMetaData; + _id: string; + description: string; + type: string; + _createdAt: string; + title: string; + body: PortableText; + character: string; + slug: { + current: string; + }; } export interface TermPageData { - seo: BaseMetaData; - terms: Term[]; + seo: BaseMetaData; + terms: Term[]; } export interface TermGroup { - [key: string]: Term[]; + [key: string]: Term[]; } diff --git a/src/routes/blogs/+page.svelte b/src/routes/blogs/+page.svelte index 04276e7..350376c 100644 --- a/src/routes/blogs/+page.svelte +++ b/src/routes/blogs/+page.svelte @@ -7,6 +7,7 @@ */ export let data; let { title, news, seo, categories } = data.data; + console.log(categories); diff --git a/tailwind.config.js b/tailwind.config.js index fd48573..80a6178 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,18 +1,18 @@ /** @type {import('tailwindcss').Config} */ export default { - content: ['./src/**/**/*.{html,js,svelte,ts}'], - theme: { - fontFamily: { - san: ['GreatHorKham Yangon', 'sans-serif'] - }, - extend: { - colors: { - 'theme-primary': '#D0E2FF', - 'theme-dark': '#161616', - 'theme-muted': '#e8e8e8', - 'theme-secondary': '#E8DAFF' - } - } - }, - plugins: [require('@tailwindcss/typography')] + content: ['./src/**/**/*.{html,js,svelte,ts}'], + theme: { + fontFamily: { + san: ['GreatHorKham Yangon', 'sans-serif'] + }, + extend: { + colors: { + 'theme-primary': '#D0E2FF', + 'theme-dark': '#161616', + 'theme-muted': '#e8e8e8', + 'theme-secondary': '#E8DAFF' + } + } + }, + plugins: [require('@tailwindcss/typography')] };