diff --git a/astro.config.ts b/astro.config.ts index ada93571..ea7b93ac 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -21,23 +21,23 @@ import remarkMath from 'remark-math'; import { iconNameTypes } from './src/lib/astro-integrations/icon-name-type'; import { pagefind } from './src/lib/astro-integrations/pagefind'; import { SITE_URL } from './src/lib/consts'; -import rehypeImageFigure from './src/plugins/rehype-image-figure'; -import rehypePagefindIgnore from './src/plugins/rehype-pagefind-ignore'; -import remarkAstroImageAssets from './src/plugins/remark-astro-image-assets'; -import remarkCallout from './src/plugins/remark-callout'; +import rehypeImageFigure from './src/lib/unified/plugins/rehype-image-figure'; +import rehypePagefindIgnore from './src/lib/unified/plugins/rehype-pagefind-ignore'; +import remarkAstroImageAssets from './src/lib/unified/plugins/remark-astro-image-assets'; +import remarkCallout from './src/lib/unified/plugins/remark-callout'; import remarkEmbed, { type RemarkEmbedOptions, -} from './src/plugins/remark-embed'; -import remarkFootnote from './src/plugins/remark-footnote'; -import remarkLineBreaks from './src/plugins/remark-line-breaks'; -import remarkLinkCard from './src/plugins/remark-link-card'; +} from './src/lib/unified/plugins/remark-embed'; +import remarkFootnote from './src/lib/unified/plugins/remark-footnote'; +import remarkLineBreaks from './src/lib/unified/plugins/remark-line-breaks'; +import remarkLinkCard from './src/lib/unified/plugins/remark-link-card'; import { canvaTransformer, googleSlidesTransformer, oEmbedTransformer, youTubeTransformer, -} from './src/plugins/transformers'; -import remarkCard from './src/plugins/remark-card'; +} from './src/lib/unified/transformers'; +import remarkCard from './src/lib/unified/plugins/remark-card'; // https://astro.build/config export default defineConfig({ diff --git a/src/components/models/BulletinBoard/BulletinBoard.astro b/src/components/ui/BulletinBoard/BulletinBoard.astro similarity index 100% rename from src/components/models/BulletinBoard/BulletinBoard.astro rename to src/components/ui/BulletinBoard/BulletinBoard.astro diff --git a/src/components/models/BulletinBoard/index.ts b/src/components/ui/BulletinBoard/index.ts similarity index 100% rename from src/components/models/BulletinBoard/index.ts rename to src/components/ui/BulletinBoard/index.ts diff --git a/src/components/models/BuyMeACoffee/BuyMeACoffee.astro b/src/components/ui/BuyMeACoffee/BuyMeACoffee.astro similarity index 100% rename from src/components/models/BuyMeACoffee/BuyMeACoffee.astro rename to src/components/ui/BuyMeACoffee/BuyMeACoffee.astro diff --git a/src/components/models/BuyMeACoffee/buy-me-a-coffee.css.ts b/src/components/ui/BuyMeACoffee/buy-me-a-coffee.css.ts similarity index 100% rename from src/components/models/BuyMeACoffee/buy-me-a-coffee.css.ts rename to src/components/ui/BuyMeACoffee/buy-me-a-coffee.css.ts diff --git a/src/components/models/BuyMeACoffee/index.ts b/src/components/ui/BuyMeACoffee/index.ts similarity index 100% rename from src/components/models/BuyMeACoffee/index.ts rename to src/components/ui/BuyMeACoffee/index.ts diff --git a/src/components/models/ContactForm/Checkbox/CheckIcon.tsx b/src/components/ui/ContactForm/Checkbox/CheckIcon.tsx similarity index 100% rename from src/components/models/ContactForm/Checkbox/CheckIcon.tsx rename to src/components/ui/ContactForm/Checkbox/CheckIcon.tsx diff --git a/src/components/models/ContactForm/Checkbox/Checkbox.tsx b/src/components/ui/ContactForm/Checkbox/Checkbox.tsx similarity index 100% rename from src/components/models/ContactForm/Checkbox/Checkbox.tsx rename to src/components/ui/ContactForm/Checkbox/Checkbox.tsx diff --git a/src/components/models/ContactForm/Checkbox/checkbox.css.ts b/src/components/ui/ContactForm/Checkbox/checkbox.css.ts similarity index 100% rename from src/components/models/ContactForm/Checkbox/checkbox.css.ts rename to src/components/ui/ContactForm/Checkbox/checkbox.css.ts diff --git a/src/components/models/ContactForm/ContactForm.tsx b/src/components/ui/ContactForm/ContactForm.tsx similarity index 100% rename from src/components/models/ContactForm/ContactForm.tsx rename to src/components/ui/ContactForm/ContactForm.tsx diff --git a/src/components/models/ContactForm/SubmitButton/SubmitButton.tsx b/src/components/ui/ContactForm/SubmitButton/SubmitButton.tsx similarity index 100% rename from src/components/models/ContactForm/SubmitButton/SubmitButton.tsx rename to src/components/ui/ContactForm/SubmitButton/SubmitButton.tsx diff --git a/src/components/models/ContactForm/SubmitButton/submit-button.css.ts b/src/components/ui/ContactForm/SubmitButton/submit-button.css.ts similarity index 100% rename from src/components/models/ContactForm/SubmitButton/submit-button.css.ts rename to src/components/ui/ContactForm/SubmitButton/submit-button.css.ts diff --git a/src/components/models/ContactForm/TextField/TextField.tsx b/src/components/ui/ContactForm/TextField/TextField.tsx similarity index 100% rename from src/components/models/ContactForm/TextField/TextField.tsx rename to src/components/ui/ContactForm/TextField/TextField.tsx diff --git a/src/components/models/ContactForm/TextField/text-field.css.ts b/src/components/ui/ContactForm/TextField/text-field.css.ts similarity index 100% rename from src/components/models/ContactForm/TextField/text-field.css.ts rename to src/components/ui/ContactForm/TextField/text-field.css.ts diff --git a/src/components/models/ContactForm/Turnstile/Turnstile.tsx b/src/components/ui/ContactForm/Turnstile/Turnstile.tsx similarity index 100% rename from src/components/models/ContactForm/Turnstile/Turnstile.tsx rename to src/components/ui/ContactForm/Turnstile/Turnstile.tsx diff --git a/src/components/models/ContactForm/Turnstile/turnstile.css.ts b/src/components/ui/ContactForm/Turnstile/turnstile.css.ts similarity index 100% rename from src/components/models/ContactForm/Turnstile/turnstile.css.ts rename to src/components/ui/ContactForm/Turnstile/turnstile.css.ts diff --git a/src/components/models/ContactForm/contact-form.css.ts b/src/components/ui/ContactForm/contact-form.css.ts similarity index 100% rename from src/components/models/ContactForm/contact-form.css.ts rename to src/components/ui/ContactForm/contact-form.css.ts diff --git a/src/components/models/ContactForm/error-is.ts b/src/components/ui/ContactForm/error-is.ts similarity index 100% rename from src/components/models/ContactForm/error-is.ts rename to src/components/ui/ContactForm/error-is.ts diff --git a/src/components/models/Likes/LikeIcon.tsx b/src/components/ui/Likes/LikeIcon.tsx similarity index 100% rename from src/components/models/Likes/LikeIcon.tsx rename to src/components/ui/Likes/LikeIcon.tsx diff --git a/src/components/models/Likes/Likes.tsx b/src/components/ui/Likes/Likes.tsx similarity index 100% rename from src/components/models/Likes/Likes.tsx rename to src/components/ui/Likes/Likes.tsx diff --git a/src/components/models/Likes/likes.css.ts b/src/components/ui/Likes/likes.css.ts similarity index 100% rename from src/components/models/Likes/likes.css.ts rename to src/components/ui/Likes/likes.css.ts diff --git a/src/components/models/PhotoGallery/PhotoGallery.astro b/src/components/ui/PhotoGallery/PhotoGallery.astro similarity index 100% rename from src/components/models/PhotoGallery/PhotoGallery.astro rename to src/components/ui/PhotoGallery/PhotoGallery.astro diff --git a/src/components/models/PhotoGallery/PhotoGalleryItem.astro b/src/components/ui/PhotoGallery/PhotoGalleryItem.astro similarity index 100% rename from src/components/models/PhotoGallery/PhotoGalleryItem.astro rename to src/components/ui/PhotoGallery/PhotoGalleryItem.astro diff --git a/src/components/models/PhotoGallery/index.ts b/src/components/ui/PhotoGallery/index.ts similarity index 100% rename from src/components/models/PhotoGallery/index.ts rename to src/components/ui/PhotoGallery/index.ts diff --git a/src/layouts/BlogLayout.astro b/src/layouts/BlogLayout.astro index b2bede63..89a0e6a2 100644 --- a/src/layouts/BlogLayout.astro +++ b/src/layouts/BlogLayout.astro @@ -3,9 +3,9 @@ import 'katex/dist/katex.min.css'; import type { CollectionEntry } from 'astro:content'; import { getEntry } from 'astro:content'; import { Article } from '@/components/models/Article'; -import { BuyMeACoffee } from '@/components/models/BuyMeACoffee'; +import { BuyMeACoffee } from '@/components/ui/BuyMeACoffee'; import { FormattedDate } from '@/components/models/FormattedDate'; -import { Likes } from '@/components/models/Likes/Likes'; +import { Likes } from '@/components/ui/Likes/Likes'; import { Taxonomy } from '@/components/models/Taxonomy'; import { Toc } from '@/components/models/Toc'; import { Icon } from '@/components/ui/Icon'; diff --git a/src/layouts/NewsLayout.astro b/src/layouts/NewsLayout.astro index b2acddfc..416dc692 100644 --- a/src/layouts/NewsLayout.astro +++ b/src/layouts/NewsLayout.astro @@ -1,7 +1,7 @@ --- import type { CollectionEntry } from 'astro:content'; import { Article } from '@/components/models/Article'; -import { BuyMeACoffee } from '@/components/models/BuyMeACoffee'; +import { BuyMeACoffee } from '@/components/ui/BuyMeACoffee'; import { FormattedDate } from '@/components/models/FormattedDate'; import { Icon } from '@/components/ui/Icon'; import BaseLayout from '@/layouts/BaseLayout.astro'; diff --git a/src/plugins/mdast-is.ts b/src/lib/unified/mdast-is.ts similarity index 100% rename from src/plugins/mdast-is.ts rename to src/lib/unified/mdast-is.ts diff --git a/src/plugins/rehype-image-figure.ts b/src/lib/unified/plugins/rehype-image-figure.ts similarity index 100% rename from src/plugins/rehype-image-figure.ts rename to src/lib/unified/plugins/rehype-image-figure.ts diff --git a/src/plugins/rehype-pagefind-ignore.ts b/src/lib/unified/plugins/rehype-pagefind-ignore.ts similarity index 100% rename from src/plugins/rehype-pagefind-ignore.ts rename to src/lib/unified/plugins/rehype-pagefind-ignore.ts diff --git a/src/plugins/remark-astro-image-assets.ts b/src/lib/unified/plugins/remark-astro-image-assets.ts similarity index 100% rename from src/plugins/remark-astro-image-assets.ts rename to src/lib/unified/plugins/remark-astro-image-assets.ts diff --git a/src/plugins/remark-callout.ts b/src/lib/unified/plugins/remark-callout.ts similarity index 98% rename from src/plugins/remark-callout.ts rename to src/lib/unified/plugins/remark-callout.ts index 78843177..513b0fe2 100644 --- a/src/plugins/remark-callout.ts +++ b/src/lib/unified/plugins/remark-callout.ts @@ -2,7 +2,7 @@ import type { RemarkPlugin } from '@astrojs/markdown-remark'; import type { BlockContent, DefinitionContent, Paragraph, Root } from 'mdast'; import type { Plugin } from 'unified'; import { visit } from 'unist-util-visit'; -import { isParagraph, isParent, isText } from './mdast-is'; +import { isParagraph, isParent, isText } from '../mdast-is'; type Callout = { type: string; diff --git a/src/plugins/remark-card.ts b/src/lib/unified/plugins/remark-card.ts similarity index 99% rename from src/plugins/remark-card.ts rename to src/lib/unified/plugins/remark-card.ts index e116470b..4f4b118c 100644 --- a/src/plugins/remark-card.ts +++ b/src/lib/unified/plugins/remark-card.ts @@ -2,7 +2,7 @@ import type { RemarkPlugin } from '@astrojs/markdown-remark'; import type { BlockContent, DefinitionContent, Image, Link, Root } from 'mdast'; import type { Plugin } from 'unified'; import { visit } from 'unist-util-visit'; -import { isLink, isList, isParagraph, isParent, isText } from './mdast-is'; +import { isLink, isList, isParagraph, isParent, isText } from '../mdast-is'; const parseSign = (sign: string | undefined): string | undefined => { if (sign === undefined || sign === '') return; diff --git a/src/plugins/remark-embed.ts b/src/lib/unified/plugins/remark-embed.ts similarity index 93% rename from src/plugins/remark-embed.ts rename to src/lib/unified/plugins/remark-embed.ts index ffe36848..b36a12a0 100644 --- a/src/plugins/remark-embed.ts +++ b/src/lib/unified/plugins/remark-embed.ts @@ -2,8 +2,8 @@ import type { RemarkPlugin } from '@astrojs/markdown-remark'; import type { Parent, Root } from 'mdast'; import type { Plugin } from 'unified'; import { visit } from 'unist-util-visit'; -import { isBareLink, isParent } from './mdast-is'; -import { type Transformer, getHName, getHProperties } from './transformers'; +import { isBareLink, isParent } from '../mdast-is'; +import { type Transformer, getHName, getHProperties } from '../transformers'; export type RemarkEmbedOptions = { transformers: Transformer[]; diff --git a/src/plugins/remark-footnote.ts b/src/lib/unified/plugins/remark-footnote.ts similarity index 97% rename from src/plugins/remark-footnote.ts rename to src/lib/unified/plugins/remark-footnote.ts index e19158ee..f9212659 100644 --- a/src/plugins/remark-footnote.ts +++ b/src/lib/unified/plugins/remark-footnote.ts @@ -6,7 +6,7 @@ import { isFootnoteDefinition, isFootnoteReference, isTextOrInlineCode, -} from './mdast-is'; +} from '../mdast-is'; const remarkFootnote: Plugin<[], Root> = (): ReturnType => { return (tree) => { diff --git a/src/plugins/remark-line-breaks.ts b/src/lib/unified/plugins/remark-line-breaks.ts similarity index 100% rename from src/plugins/remark-line-breaks.ts rename to src/lib/unified/plugins/remark-line-breaks.ts diff --git a/src/plugins/remark-link-card.ts b/src/lib/unified/plugins/remark-link-card.ts similarity index 93% rename from src/plugins/remark-link-card.ts rename to src/lib/unified/plugins/remark-link-card.ts index 1577024b..c8706b91 100644 --- a/src/plugins/remark-link-card.ts +++ b/src/lib/unified/plugins/remark-link-card.ts @@ -2,7 +2,7 @@ import type { RemarkPlugin } from '@astrojs/markdown-remark'; import type { Parent, Root } from 'mdast'; import type { Plugin } from 'unified'; import { visit } from 'unist-util-visit'; -import { isBareLink, isParent } from './mdast-is'; +import { isBareLink, isParent } from '../mdast-is'; const remarkLinkCard: Plugin<[], Root> = (): ReturnType => { return (tree) => { diff --git a/src/plugins/transformers.ts b/src/lib/unified/transformers.ts similarity index 100% rename from src/plugins/transformers.ts rename to src/lib/unified/transformers.ts diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro index d30f3abb..2c558bad 100644 --- a/src/pages/[locale]/index.astro +++ b/src/pages/[locale]/index.astro @@ -1,7 +1,7 @@ --- import { getEntry } from 'astro:content'; import { BlogList } from '@/components/models/BlogList'; -import { BulletinBoard } from '@/components/models/BulletinBoard'; +import { BulletinBoard } from '@/components/ui/BulletinBoard'; import { PhotoGallery } from '@/components/models/PhotoGallery'; import { Icon } from '@/components/ui/Icon'; import BaseLayout from '@/layouts/BaseLayout.astro'; diff --git a/src/pages/index.astro b/src/pages/index.astro index 85ecb70a..3dc8c26f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,7 +1,7 @@ --- import { getEntry } from 'astro:content'; import { BlogList } from '@/components/models/BlogList'; -import { BulletinBoard } from '@/components/models/BulletinBoard'; +import { BulletinBoard } from '@/components/ui/BulletinBoard'; import { PhotoGallery } from '@/components/models/PhotoGallery'; import { Icon } from '@/components/ui/Icon'; import BaseLayout from '@/layouts/BaseLayout.astro';