From 0152a3775b8eca10f2e50b69bc3fb970c76a9d0d Mon Sep 17 00:00:00 2001 From: ansidev Date: Mon, 26 Feb 2024 18:55:07 +0700 Subject: [PATCH 1/3] fix: update taiwindcss classes --- src/components/LeetCodeDifficulty.astro | 2 +- tailwind.config.cjs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/LeetCodeDifficulty.astro b/src/components/LeetCodeDifficulty.astro index 71a71287..0b152da0 100644 --- a/src/components/LeetCodeDifficulty.astro +++ b/src/components/LeetCodeDifficulty.astro @@ -34,7 +34,7 @@ const getDifficultyCssClass: (difficulty: string) => string = ( ({ DEFAULT: { css: { - color: theme('textColor.style.primary'), - '--tw-prose-headings': theme('textColor.style.primary'), - '--tw-prose-bold': theme('textColor.style.primary'), - '--tw-prose-quotes': theme('textColor.style.primary'), + color: 'rgb(var(--textColor-style-primary))', + '--tw-prose-headings': 'rgb(var(--textColor-style-primary))', + '--tw-prose-bold': 'rgb(var(--textColor-style-primary))', + '--tw-prose-quotes': 'rgb(var(--textColor-style-primary))', '--tw-prose-pre-bg': '#0d1117', code: { - backgroundColor: theme('backgroundColor.style.primary'), + backgroundColor: 'rgb(var(--backgroundColor-style-primary))', padding: '5px', borderRadius: '3px', }, From e6babd3390846c4311954e7647393bb6a3a443c8 Mon Sep 17 00:00:00 2001 From: ansidev Date: Mon, 26 Feb 2024 19:18:43 +0700 Subject: [PATCH 2/3] chore: minor changes --- src/content/leetcode-solutions/0231-power-of-two.md | 2 +- src/pages/[slug].astro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/leetcode-solutions/0231-power-of-two.md b/src/content/leetcode-solutions/0231-power-of-two.md index f178f245..c1ac8e00 100644 --- a/src/content/leetcode-solutions/0231-power-of-two.md +++ b/src/content/leetcode-solutions/0231-power-of-two.md @@ -103,7 +103,7 @@ For `i > 0`, we have:
 n - 1 = 2i10 - 1 ≥ 0
 n & (n-1) = 2i10 & 2i10 - 1 = 100...002 & 011...112 = 0
-                 |__i__|     |__i__|
+                             |___i___|   |__i__|
 
``` diff --git a/src/pages/[slug].astro b/src/pages/[slug].astro index 6cc0c1fc..57391635 100644 --- a/src/pages/[slug].astro +++ b/src/pages/[slug].astro @@ -1,5 +1,5 @@ --- -import { CollectionEntry, getCollection } from 'astro:content' +import { type CollectionEntry, getCollection } from 'astro:content' import Disqus from '@/components/Disqus.astro' import PostLayout from '@/layouts/PostLayout.astro' From a8294fb15c1cc381d7c2edd9a20dd97757ddff52 Mon Sep 17 00:00:00 2001 From: ansidev Date: Mon, 26 Feb 2024 19:20:17 +0700 Subject: [PATCH 3/3] chore: delete ignored file --- .astro/types.d.ts | 159 ---------------------------------------------- 1 file changed, 159 deletions(-) delete mode 100644 .astro/types.d.ts diff --git a/.astro/types.d.ts b/.astro/types.d.ts deleted file mode 100644 index 48f2a4a3..00000000 --- a/.astro/types.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -declare module 'astro:content' { - interface Render { - '.md': Promise<{ - Content: import('astro').MarkdownInstance<{}>['Content']; - headings: import('astro').MarkdownHeading[]; - remarkPluginFrontmatter: Record; - }>; - } -} - -declare module 'astro:content' { - export { z } from 'astro/zod'; - export type CollectionEntry = - (typeof entryMap)[C][keyof (typeof entryMap)[C]]; - - // TODO: Remove this when having this fallback is no longer relevant. 2.3? 3.0? - erika, 2023-04-04 - /** - * @deprecated - * `astro:content` no longer provide `image()`. - * - * Please use it through `schema`, like such: - * ```ts - * import { defineCollection, z } from "astro:content"; - * - * defineCollection({ - * schema: ({ image }) => - * z.object({ - * image: image(), - * }), - * }); - * ``` - */ - export const image: never; - - // This needs to be in sync with ImageMetadata - export type ImageFunction = () => import('astro/zod').ZodObject<{ - src: import('astro/zod').ZodString; - width: import('astro/zod').ZodNumber; - height: import('astro/zod').ZodNumber; - format: import('astro/zod').ZodUnion< - [ - import('astro/zod').ZodLiteral<'png'>, - import('astro/zod').ZodLiteral<'jpg'>, - import('astro/zod').ZodLiteral<'jpeg'>, - import('astro/zod').ZodLiteral<'tiff'>, - import('astro/zod').ZodLiteral<'webp'>, - import('astro/zod').ZodLiteral<'gif'>, - import('astro/zod').ZodLiteral<'svg'> - ] - >; - }>; - - type BaseSchemaWithoutEffects = - | import('astro/zod').AnyZodObject - | import('astro/zod').ZodUnion - | import('astro/zod').ZodDiscriminatedUnion - | import('astro/zod').ZodIntersection< - import('astro/zod').AnyZodObject, - import('astro/zod').AnyZodObject - >; - - type BaseSchema = - | BaseSchemaWithoutEffects - | import('astro/zod').ZodEffects; - - export type SchemaContext = { image: ImageFunction }; - - type BaseCollectionConfig = { - schema?: S | ((context: SchemaContext) => S); - }; - export function defineCollection( - input: BaseCollectionConfig - ): BaseCollectionConfig; - - type EntryMapKeys = keyof typeof entryMap; - type AllValuesOf = T extends any ? T[keyof T] : never; - type ValidEntrySlug = AllValuesOf<(typeof entryMap)[C]>['slug']; - - export function getEntryBySlug< - C extends keyof typeof entryMap, - E extends ValidEntrySlug | (string & {}) - >( - collection: C, - // Note that this has to accept a regular string too, for SSR - entrySlug: E - ): E extends ValidEntrySlug - ? Promise> - : Promise | undefined>; - export function getCollection>( - collection: C, - filter?: (entry: CollectionEntry) => entry is E - ): Promise; - export function getCollection( - collection: C, - filter?: (entry: CollectionEntry) => unknown - ): Promise[]>; - - type ReturnTypeOrOriginal = T extends (...args: any[]) => infer R ? R : T; - type InferEntrySchema = import('astro/zod').infer< - ReturnTypeOrOriginal['schema']> - >; - - const entryMap: { - "leetcode-solutions": { -"0003-longest-substring-without-repeating-characters.md": { - id: "0003-longest-substring-without-repeating-characters.md", - slug: "0003-longest-substring-without-repeating-characters", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -"0008-string-to-integer-atoi.md": { - id: "0008-string-to-integer-atoi.md", - slug: "0008-string-to-integer-atoi", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -"0053-maximum-subarray.md": { - id: "0053-maximum-subarray.md", - slug: "0053-maximum-subarray", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -"0231-power-of-two.md": { - id: "0231-power-of-two.md", - slug: "0231-power-of-two", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -"0628-maximum-product-of-three-numbers.md": { - id: "0628-maximum-product-of-three-numbers.md", - slug: "0628-maximum-product-of-three-numbers", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -"2400-number-of-ways-to-reach-a-position-after-exactly-k-steps.md": { - id: "2400-number-of-ways-to-reach-a-position-after-exactly-k-steps.md", - slug: "2400-number-of-ways-to-reach-a-position-after-exactly-k-steps", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -"2464-split-message-based-on-limit.md": { - id: "2464-split-message-based-on-limit.md", - slug: "2468-split-message-based-on-limit", - body: string, - collection: "leetcode-solutions", - data: InferEntrySchema<"leetcode-solutions"> -} & { render(): Render[".md"] }, -}, - - }; - - type ContentConfig = typeof import("../src/content/config"); -}