diff --git a/.frontmatter/database/mediaDb.json b/.frontmatter/database/mediaDb.json index 8df1a728..8dc2132f 100644 --- a/.frontmatter/database/mediaDb.json +++ b/.frontmatter/database/mediaDb.json @@ -1 +1 @@ -{"assets":{"images":{}},"src":{"assets":{"images":{}},"components":{"card":{}},"content":{"page":{"en":{}}}}} \ No newline at end of file +{"assets":{"images":{}},"src":{"assets":{"images":{}},"components":{"card":{}},"content":{"page":{"en":{}}},"lib":{"unified":{"plugins":{}}}}} \ No newline at end of file diff --git a/astro.config.ts b/astro.config.ts index 9624a15c..d2d4d3a8 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -21,23 +21,22 @@ 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 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({ @@ -50,7 +49,7 @@ export default defineConfig({ }, }), image: { - service: passthroughImageService(), + service: passthroughImageService() }, integrations: [ mdx(), @@ -131,7 +130,6 @@ export default defineConfig({ rehypePlugins: [ rehypeKatex, rehypeSlug, - rehypeImageFigure, [ rehypeAutolinkHeadings, { diff --git a/biome.json b/biome.json index b4cbf2b3..ae85313c 100644 --- a/biome.json +++ b/biome.json @@ -24,6 +24,7 @@ "indentStyle": "space" }, "javascript": { + "globals": ["Astro"], "formatter": { "enabled": true, "semicolons": "always", diff --git a/bun.lockb b/bun.lockb index 03c3f5a9..7a7ecc6b 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/frontmatter.json b/frontmatter.json index d69104a4..1e88b845 100644 --- a/frontmatter.json +++ b/frontmatter.json @@ -152,6 +152,11 @@ "step": 1 } }, + { + "title": "Hero Image", + "name": "image", + "type": "image" + }, { "title": "type", "name": "type", diff --git a/package.json b/package.json index 71132c16..52d08a8a 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@solid-primitives/event-listener": "^2.3.3", "@solid-primitives/keyboard": "^1.2.8", "@unocss/reset": "^0.60.0", + "@unpic/placeholder": "^0.1.2", "astro": "^4.12.2", "astro-purgecss": "4.1.0", "drizzle-orm": "^0.31.1", @@ -47,24 +48,30 @@ "solid-js": "^1.8.17", "solid-motionone": "^1.0.0", "solid-toast": "^0.5.0", + "unpic": "^3.18.0", "valibot": "^0.31.1", "wretch": "^2.9.0" }, "devDependencies": { + "@astrojs/ts-plugin": "^1.10.3", "@biomejs/biome": "1.8.3", "@cloudflare/workers-types": "^4.20240603.0", + "@mdx-js/typescript-plugin": "^0.0.6", "@nanostores/solid": "^0.4.2", "@pagefind/default-ui": "^1.0.4", "@types/better-sqlite3": "^7.6.10", + "@types/bun": "^1.1.11", "@types/hast": "^3.0.4", "@types/katex": "0.16.7", "@types/mdast": "^4.0.4", "@types/node": "^22.0.0", "@types/unist": "^3.0.2", + "@unpic/pixels": "^1.2.2", "@vanilla-extract/css": "^1.15.2", "@vanilla-extract/css-utils": "^0.1.4", "@vanilla-extract/vite-plugin": "^4.0.10", "better-sqlite3": "^11.1.2", + "blurhash": "^2.0.5", "browserslist": "^4.23.0", "danger": "^12.3.3", "drizzle-kit": "^0.23.0", diff --git a/src/assets/images/ik-multimedia-iloud-mtm-mkii.avif b/src/assets/images/ik-multimedia-iloud-mtm-mkii.avif new file mode 100644 index 00000000..d10e4b7c Binary files /dev/null and b/src/assets/images/ik-multimedia-iloud-mtm-mkii.avif differ diff --git a/src/components/BaseHead/BaseHead.astro b/src/components/common/BaseHead/BaseHead.astro similarity index 100% rename from src/components/BaseHead/BaseHead.astro rename to src/components/common/BaseHead/BaseHead.astro diff --git a/src/components/BaseHead/index.ts b/src/components/common/BaseHead/index.ts similarity index 100% rename from src/components/BaseHead/index.ts rename to src/components/common/BaseHead/index.ts diff --git a/src/components/Footer/Footer.astro b/src/components/common/Footer/Footer.astro similarity index 98% rename from src/components/Footer/Footer.astro rename to src/components/common/Footer/Footer.astro index cdc60156..94306eda 100644 --- a/src/components/Footer/Footer.astro +++ b/src/components/common/Footer/Footer.astro @@ -1,6 +1,6 @@ --- import { getEntry } from 'astro:content'; -import { Icon } from '@/components/Icon'; +import { Icon } from '@/components/ui/Icon'; import { ACCOUNT_ID, GITHUB_BASE_URL, UNSPLASH_BASE_URL } from '@/lib/consts'; import { getLocaleFromUrl, useTranslatedPath } from '@/utils/i18n/utils'; diff --git a/src/components/Footer/index.ts b/src/components/common/Footer/index.ts similarity index 100% rename from src/components/Footer/index.ts rename to src/components/common/Footer/index.ts diff --git a/src/components/LocalePicker/LocalePicker.tsx b/src/components/common/LocalePicker/LocalePicker.tsx similarity index 87% rename from src/components/LocalePicker/LocalePicker.tsx rename to src/components/common/LocalePicker/LocalePicker.tsx index fdf44a23..ccdcb33c 100644 --- a/src/components/LocalePicker/LocalePicker.tsx +++ b/src/components/common/LocalePicker/LocalePicker.tsx @@ -1,5 +1,5 @@ -import { locale } from '@/components/LocaleStore/locale-store'; -import { url } from '@/components/UrlStore/url-store'; +import { locale } from '@/components/functional/LocaleStore/locale-store'; +import { url } from '@/components/functional/UrlStore/url-store'; import { defaultLang, languages } from '@/utils/i18n/data'; import { getTargetLocaleSlug } from '@/utils/i18n/utils'; import { useStore } from '@nanostores/solid'; diff --git a/src/components/LocalePicker/locale-picker.css.ts b/src/components/common/LocalePicker/locale-picker.css.ts similarity index 100% rename from src/components/LocalePicker/locale-picker.css.ts rename to src/components/common/LocalePicker/locale-picker.css.ts diff --git a/src/components/Navigation/NavLink.astro b/src/components/common/Navigation/NavLink.astro similarity index 100% rename from src/components/Navigation/NavLink.astro rename to src/components/common/Navigation/NavLink.astro diff --git a/src/components/Navigation/NavMenuContainer.astro b/src/components/common/Navigation/NavMenuContainer.astro similarity index 100% rename from src/components/Navigation/NavMenuContainer.astro rename to src/components/common/Navigation/NavMenuContainer.astro diff --git a/src/components/Navigation/Navigation.astro b/src/components/common/Navigation/Navigation.astro similarity index 95% rename from src/components/Navigation/Navigation.astro rename to src/components/common/Navigation/Navigation.astro index 027fe744..0b2909b4 100644 --- a/src/components/Navigation/Navigation.astro +++ b/src/components/common/Navigation/Navigation.astro @@ -1,10 +1,10 @@ --- import '@/styles/pixelmplus.css'; import { getEntry } from 'astro:content'; -import { Icon } from '@/components/Icon'; -import { LocalePicker } from '@/components/LocalePicker/LocalePicker'; -import { Modal } from '@/components/Modal/Modal'; -import { Search } from '@/components/Search/Search'; +import { LocalePicker } from '@/components/common/LocalePicker/LocalePicker'; +import { Search } from '@/components/common/Search/Search'; +import { Icon } from '@/components/ui/Icon'; +import { Modal } from '@/components/ui/Modal/Modal'; import { transparentButton } from '@/styles/styles.css'; import { getLocaleFromUrl, useTranslatedPath } from '@/utils/i18n/utils'; import NavLink from './NavLink.astro'; diff --git a/src/components/Navigation/index.ts b/src/components/common/Navigation/index.ts similarity index 100% rename from src/components/Navigation/index.ts rename to src/components/common/Navigation/index.ts diff --git a/src/components/Search/Search.tsx b/src/components/common/Search/Search.tsx similarity index 100% rename from src/components/Search/Search.tsx rename to src/components/common/Search/Search.tsx diff --git a/src/components/Search/SearchIcon.tsx b/src/components/common/Search/SearchIcon.tsx similarity index 100% rename from src/components/Search/SearchIcon.tsx rename to src/components/common/Search/SearchIcon.tsx diff --git a/src/components/Search/search.css.ts b/src/components/common/Search/search.css.ts similarity index 100% rename from src/components/Search/search.css.ts rename to src/components/common/Search/search.css.ts diff --git a/src/components/Search/types.ts b/src/components/common/Search/types.ts similarity index 100% rename from src/components/Search/types.ts rename to src/components/common/Search/types.ts diff --git a/src/components/elements/Callout/CalloutTitle.astro b/src/components/elements/Callout/CalloutTitle.astro index 61f315e7..80078064 100644 --- a/src/components/elements/Callout/CalloutTitle.astro +++ b/src/components/elements/Callout/CalloutTitle.astro @@ -1,5 +1,5 @@ --- -import { Icon } from '@/components/Icon'; +import { Icon } from '@/components/ui/Icon'; import { generateUniqueId } from '@/utils/generate-unique-id'; import { toBoolean } from '@/utils/to-boolean'; import type { Props as CalloutProps } from './Callout.astro'; diff --git a/src/components/elements/Callout/types.ts b/src/components/elements/Callout/types.ts index 5cb372f6..1de9ff3a 100644 --- a/src/components/elements/Callout/types.ts +++ b/src/components/elements/Callout/types.ts @@ -1,4 +1,4 @@ -import type { IconName } from '@/components/Icon/types'; +import type { IconName } from '@/components/ui/Icon/types'; import type { callouts } from './callouts'; type Callout = { diff --git a/src/components/Card/Card.astro b/src/components/elements/Card/Card.astro similarity index 92% rename from src/components/Card/Card.astro rename to src/components/elements/Card/Card.astro index d18e4764..157a6fdf 100644 --- a/src/components/Card/Card.astro +++ b/src/components/elements/Card/Card.astro @@ -46,11 +46,20 @@ if (isElementCard(Astro.props)) { padding: 0.25rem; display: flex; justify-content: center; + & :global(figure) { + margin: 0 auto; + } + & :global(figcaption) { + display: none; + } & :global(img) { object-fit: contain; width: 100%; height: 100%; } + & :global(a) { + display: flex; + } @media (min-width: 640px) { max-height: 8.75rem; min-height: 6.75rem; diff --git a/src/components/Card/CardGrid.astro b/src/components/elements/Card/CardGrid.astro similarity index 100% rename from src/components/Card/CardGrid.astro rename to src/components/elements/Card/CardGrid.astro diff --git a/src/components/Card/card.ts b/src/components/elements/Card/card.ts similarity index 100% rename from src/components/Card/card.ts rename to src/components/elements/Card/card.ts diff --git a/src/components/Card/index.ts b/src/components/elements/Card/index.ts similarity index 100% rename from src/components/Card/index.ts rename to src/components/elements/Card/index.ts diff --git a/src/components/elements/Figure/Figure.astro b/src/components/elements/Figure/Figure.astro index f436536a..3a20cfdf 100644 --- a/src/components/elements/Figure/Figure.astro +++ b/src/components/elements/Figure/Figure.astro @@ -1,16 +1,13 @@ --- import type { HTMLAttributes } from 'astro/types'; import AstroCode from './Code.astro'; -import AstroImage from './Image.astro'; type Props = HTMLAttributes<'figure'> & { - 'data-image-figure'?: ''; 'data-rehype-pretty-code-figure'?: ''; }; const props = Astro.props; const isCodeFigure = Object.hasOwn(props, 'data-rehype-pretty-code-figure'); -const isImageFigure = Object.hasOwn(props, 'data-image-figure'); --- { @@ -18,10 +15,6 @@ const isImageFigure = Object.hasOwn(props, 'data-image-figure'); - ) : isImageFigure ? ( - - - ) : (
diff --git a/src/components/elements/Figure/Image.astro b/src/components/elements/Figure/Image.astro index ff4c4fc8..c0e33356 100644 --- a/src/components/elements/Figure/Image.astro +++ b/src/components/elements/Figure/Image.astro @@ -1,48 +1,57 @@ --- +import { Picture } from 'astro:assets'; import type { HTMLAttributes } from 'astro/types'; -type Props = HTMLAttributes<'figure'> & { - 'data-image-alt'?: string; - 'data-image-aspect-ratio'?: string; - 'data-image-blur-url'?: string; +type Props = Omit, 'alt' | 'src'> & { + alt: string; + placeholder: string; + src: string | ImageMetadata; }; -const { - 'data-image-alt': alt, - 'data-image-aspect-ratio': aspectRatio, - 'data-image-blur-url': blurUrl, - ...props -} = Astro.props; +const { alt, placeholder, src, ...props } = Astro.props; --- -
-
- -
-
{alt}
-
- diff --git a/src/components/elements/Figure/index.ts b/src/components/elements/Figure/index.ts index d75bba75..d0123510 100644 --- a/src/components/elements/Figure/index.ts +++ b/src/components/elements/Figure/index.ts @@ -1 +1,2 @@ export { default as Figure } from './Figure.astro'; +export { default as Image } from './Image.astro'; diff --git a/src/components/elements/Link/LinkCard.astro b/src/components/elements/Link/LinkCard.astro index 5f24ed2f..2fa56b8b 100644 --- a/src/components/elements/Link/LinkCard.astro +++ b/src/components/elements/Link/LinkCard.astro @@ -1,6 +1,6 @@ --- import { getEntry } from 'astro:content'; -import { Icon } from '@/components/Icon'; +import { Icon } from '@/components/ui/Icon'; import { getLocaleFromUrl } from '@/utils/i18n/utils'; import type { HTMLAttributes } from 'astro/types'; import { unfurl } from 'unfurl.js'; diff --git a/src/components/LocaleStore/LocaleStore.tsx b/src/components/functional/LocaleStore/LocaleStore.tsx similarity index 100% rename from src/components/LocaleStore/LocaleStore.tsx rename to src/components/functional/LocaleStore/LocaleStore.tsx diff --git a/src/components/LocaleStore/locale-store.ts b/src/components/functional/LocaleStore/locale-store.ts similarity index 100% rename from src/components/LocaleStore/locale-store.ts rename to src/components/functional/LocaleStore/locale-store.ts diff --git a/src/components/UrlStore/UrlStore.tsx b/src/components/functional/UrlStore/UrlStore.tsx similarity index 100% rename from src/components/UrlStore/UrlStore.tsx rename to src/components/functional/UrlStore/UrlStore.tsx diff --git a/src/components/UrlStore/url-store.ts b/src/components/functional/UrlStore/url-store.ts similarity index 100% rename from src/components/UrlStore/url-store.ts rename to src/components/functional/UrlStore/url-store.ts diff --git a/src/components/Article/Article.astro b/src/components/models/Article/Article.astro similarity index 100% rename from src/components/Article/Article.astro rename to src/components/models/Article/Article.astro diff --git a/src/components/Article/article.css.ts b/src/components/models/Article/article.css.ts similarity index 100% rename from src/components/Article/article.css.ts rename to src/components/models/Article/article.css.ts diff --git a/src/components/Article/index.ts b/src/components/models/Article/index.ts similarity index 100% rename from src/components/Article/index.ts rename to src/components/models/Article/index.ts diff --git a/src/components/BlogList/BlogList.astro b/src/components/models/BlogList/BlogList.astro similarity index 96% rename from src/components/BlogList/BlogList.astro rename to src/components/models/BlogList/BlogList.astro index c96b6fc7..7ec5f273 100644 --- a/src/components/BlogList/BlogList.astro +++ b/src/components/models/BlogList/BlogList.astro @@ -1,8 +1,8 @@ --- import type { CollectionEntry } from 'astro:content'; -import { FormattedDate } from '@/components/FormattedDate'; -import { Icon } from '@/components/Icon'; -import { Taxonomy } from '@/components/Taxonomy'; +import { FormattedDate } from '@/components/models/FormattedDate'; +import { Taxonomy } from '@/components/models/Taxonomy'; +import { Icon } from '@/components/ui/Icon'; import { getBlogCategory, getBlogTags } from '@/lib/collections/data'; import { getLocaleFromUrl, useTranslatedPath } from '@/utils/i18n/utils'; diff --git a/src/components/BlogList/index.ts b/src/components/models/BlogList/index.ts similarity index 100% rename from src/components/BlogList/index.ts rename to src/components/models/BlogList/index.ts diff --git a/src/components/FormattedDate/FormattedDate.astro b/src/components/models/FormattedDate/FormattedDate.astro similarity index 100% rename from src/components/FormattedDate/FormattedDate.astro rename to src/components/models/FormattedDate/FormattedDate.astro diff --git a/src/components/FormattedDate/format-date.ts b/src/components/models/FormattedDate/format-date.ts similarity index 100% rename from src/components/FormattedDate/format-date.ts rename to src/components/models/FormattedDate/format-date.ts diff --git a/src/components/FormattedDate/index.ts b/src/components/models/FormattedDate/index.ts similarity index 100% rename from src/components/FormattedDate/index.ts rename to src/components/models/FormattedDate/index.ts diff --git a/src/components/OgImage/index.tsx b/src/components/models/OgImage/index.tsx similarity index 100% rename from src/components/OgImage/index.tsx rename to src/components/models/OgImage/index.tsx diff --git a/src/components/Pager/Pager.astro b/src/components/models/Pager/Pager.astro similarity index 98% rename from src/components/Pager/Pager.astro rename to src/components/models/Pager/Pager.astro index cf4dfcde..15158e6a 100644 --- a/src/components/Pager/Pager.astro +++ b/src/components/models/Pager/Pager.astro @@ -1,9 +1,9 @@ --- import { type CollectionEntry, getEntry } from 'astro:content'; +import { Icon } from '@/components/ui/Icon'; import { DEFAULT_PAGINATION_WIDTH } from '@/lib/consts'; import { getLocaleFromUrl } from '@/utils/i18n/utils'; import type { Page } from 'astro'; -import { Icon } from '../Icon'; type Props = { page?: Page>; diff --git a/src/components/Pager/index.ts b/src/components/models/Pager/index.ts similarity index 100% rename from src/components/Pager/index.ts rename to src/components/models/Pager/index.ts diff --git a/src/components/Taxonomy/Taxonomy.astro b/src/components/models/Taxonomy/Taxonomy.astro similarity index 100% rename from src/components/Taxonomy/Taxonomy.astro rename to src/components/models/Taxonomy/Taxonomy.astro diff --git a/src/components/Taxonomy/index.ts b/src/components/models/Taxonomy/index.ts similarity index 100% rename from src/components/Taxonomy/index.ts rename to src/components/models/Taxonomy/index.ts diff --git a/src/components/Taxonomy/taxonomy.css.ts b/src/components/models/Taxonomy/taxonomy.css.ts similarity index 100% rename from src/components/Taxonomy/taxonomy.css.ts rename to src/components/models/Taxonomy/taxonomy.css.ts diff --git a/src/components/Taxonomy/taxonomy.ts b/src/components/models/Taxonomy/taxonomy.ts similarity index 100% rename from src/components/Taxonomy/taxonomy.ts rename to src/components/models/Taxonomy/taxonomy.ts diff --git a/src/components/Toc/Toc.astro b/src/components/models/Toc/Toc.astro similarity index 100% rename from src/components/Toc/Toc.astro rename to src/components/models/Toc/Toc.astro diff --git a/src/components/Toc/TocDrawer.astro b/src/components/models/Toc/TocDrawer.astro similarity index 96% rename from src/components/Toc/TocDrawer.astro rename to src/components/models/Toc/TocDrawer.astro index 1e89bab1..bec639b3 100644 --- a/src/components/Toc/TocDrawer.astro +++ b/src/components/models/Toc/TocDrawer.astro @@ -1,6 +1,6 @@ --- import { getEntry } from 'astro:content'; -import { Icon } from '@/components/Icon'; +import { Icon } from '@/components/ui/Icon'; import { getLocaleFromUrl } from '@/utils/i18n/utils'; const locale = getLocaleFromUrl(Astro.url); diff --git a/src/components/Toc/index.ts b/src/components/models/Toc/index.ts similarity index 100% rename from src/components/Toc/index.ts rename to src/components/models/Toc/index.ts diff --git a/src/components/Balloon/Balloon.astro b/src/components/ui/Balloon/Balloon.astro similarity index 98% rename from src/components/Balloon/Balloon.astro rename to src/components/ui/Balloon/Balloon.astro index 58c4613c..573e2e4e 100644 --- a/src/components/Balloon/Balloon.astro +++ b/src/components/ui/Balloon/Balloon.astro @@ -1,7 +1,7 @@ --- import { getEntry } from 'astro:content'; import profileImage from '@/assets/images/profile.png'; -import { ProfileIcon } from '@/components/ProfileIcon'; +import { ProfileIcon } from '@/components/ui/ProfileIcon'; import { getLocaleFromUrl } from '@/utils/i18n/utils'; import type { ImageMetadata } from 'astro'; diff --git a/src/components/Balloon/index.ts b/src/components/ui/Balloon/index.ts similarity index 100% rename from src/components/Balloon/index.ts rename to src/components/ui/Balloon/index.ts diff --git a/src/components/BulletinBoard/BulletinBoard.astro b/src/components/ui/BulletinBoard/BulletinBoard.astro similarity index 100% rename from src/components/BulletinBoard/BulletinBoard.astro rename to src/components/ui/BulletinBoard/BulletinBoard.astro diff --git a/src/components/BulletinBoard/index.ts b/src/components/ui/BulletinBoard/index.ts similarity index 100% rename from src/components/BulletinBoard/index.ts rename to src/components/ui/BulletinBoard/index.ts diff --git a/src/components/BuyMeACoffee/BuyMeACoffee.astro b/src/components/ui/BuyMeACoffee/BuyMeACoffee.astro similarity index 91% rename from src/components/BuyMeACoffee/BuyMeACoffee.astro rename to src/components/ui/BuyMeACoffee/BuyMeACoffee.astro index 8715da0d..69af30ce 100644 --- a/src/components/BuyMeACoffee/BuyMeACoffee.astro +++ b/src/components/ui/BuyMeACoffee/BuyMeACoffee.astro @@ -1,7 +1,7 @@ --- import { getEntry } from 'astro:content'; -import { Icon } from '@/components/Icon'; -import { Modal } from '@/components/Modal/Modal'; +import { Icon } from '@/components/ui/Icon'; +import { Modal } from '@/components/ui/Modal/Modal'; import { ACCOUNT_ID } from '@/lib/consts'; import { getLocaleFromUrl } from '@/utils/i18n/utils'; import { diff --git a/src/components/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/BuyMeACoffee/buy-me-a-coffee.css.ts rename to src/components/ui/BuyMeACoffee/buy-me-a-coffee.css.ts diff --git a/src/components/BuyMeACoffee/index.ts b/src/components/ui/BuyMeACoffee/index.ts similarity index 100% rename from src/components/BuyMeACoffee/index.ts rename to src/components/ui/BuyMeACoffee/index.ts diff --git a/src/components/ContactForm/Checkbox/CheckIcon.tsx b/src/components/ui/ContactForm/Checkbox/CheckIcon.tsx similarity index 100% rename from src/components/ContactForm/Checkbox/CheckIcon.tsx rename to src/components/ui/ContactForm/Checkbox/CheckIcon.tsx diff --git a/src/components/ContactForm/Checkbox/Checkbox.tsx b/src/components/ui/ContactForm/Checkbox/Checkbox.tsx similarity index 96% rename from src/components/ContactForm/Checkbox/Checkbox.tsx rename to src/components/ui/ContactForm/Checkbox/Checkbox.tsx index 40f4ea22..7b95f887 100644 --- a/src/components/ContactForm/Checkbox/Checkbox.tsx +++ b/src/components/ui/ContactForm/Checkbox/Checkbox.tsx @@ -1,11 +1,11 @@ import { Checkbox as KCheckbox, Root as KRoot } from '@kobalte/core/checkbox'; import { type Component, type JSX, splitProps } from 'solid-js'; -import { CheckIcon } from '../Checkbox/CheckIcon'; import { contactFormError, contactLabel, fieldGroup, } from '../contact-form.css'; +import { CheckIcon } from './CheckIcon'; import { checkboxArea, checkboxControl } from './checkbox.css'; type Props = { diff --git a/src/components/ContactForm/Checkbox/checkbox.css.ts b/src/components/ui/ContactForm/Checkbox/checkbox.css.ts similarity index 100% rename from src/components/ContactForm/Checkbox/checkbox.css.ts rename to src/components/ui/ContactForm/Checkbox/checkbox.css.ts diff --git a/src/components/ContactForm/ContactForm.tsx b/src/components/ui/ContactForm/ContactForm.tsx similarity index 98% rename from src/components/ContactForm/ContactForm.tsx rename to src/components/ui/ContactForm/ContactForm.tsx index f7aa5149..cc0d1ca0 100644 --- a/src/components/ContactForm/ContactForm.tsx +++ b/src/components/ui/ContactForm/ContactForm.tsx @@ -1,4 +1,4 @@ -import { locale } from '@/components/LocaleStore/locale-store'; +import { locale } from '@/components/functional/LocaleStore/locale-store'; import type { I18nData } from '@/lib/collections/types'; import { FORM_TEXTAREA_MINLENGTH } from '@/lib/consts'; import { useTranslatedPath } from '@/utils/i18n/utils'; diff --git a/src/components/ContactForm/SubmitButton/SubmitButton.tsx b/src/components/ui/ContactForm/SubmitButton/SubmitButton.tsx similarity index 100% rename from src/components/ContactForm/SubmitButton/SubmitButton.tsx rename to src/components/ui/ContactForm/SubmitButton/SubmitButton.tsx diff --git a/src/components/ContactForm/SubmitButton/submit-button.css.ts b/src/components/ui/ContactForm/SubmitButton/submit-button.css.ts similarity index 100% rename from src/components/ContactForm/SubmitButton/submit-button.css.ts rename to src/components/ui/ContactForm/SubmitButton/submit-button.css.ts diff --git a/src/components/ContactForm/TextField/TextField.tsx b/src/components/ui/ContactForm/TextField/TextField.tsx similarity index 100% rename from src/components/ContactForm/TextField/TextField.tsx rename to src/components/ui/ContactForm/TextField/TextField.tsx diff --git a/src/components/ContactForm/TextField/text-field.css.ts b/src/components/ui/ContactForm/TextField/text-field.css.ts similarity index 100% rename from src/components/ContactForm/TextField/text-field.css.ts rename to src/components/ui/ContactForm/TextField/text-field.css.ts diff --git a/src/components/ContactForm/Turnstile/Turnstile.tsx b/src/components/ui/ContactForm/Turnstile/Turnstile.tsx similarity index 100% rename from src/components/ContactForm/Turnstile/Turnstile.tsx rename to src/components/ui/ContactForm/Turnstile/Turnstile.tsx diff --git a/src/components/ContactForm/Turnstile/turnstile.css.ts b/src/components/ui/ContactForm/Turnstile/turnstile.css.ts similarity index 100% rename from src/components/ContactForm/Turnstile/turnstile.css.ts rename to src/components/ui/ContactForm/Turnstile/turnstile.css.ts diff --git a/src/components/ContactForm/contact-form.css.ts b/src/components/ui/ContactForm/contact-form.css.ts similarity index 100% rename from src/components/ContactForm/contact-form.css.ts rename to src/components/ui/ContactForm/contact-form.css.ts diff --git a/src/components/ContactForm/error-is.ts b/src/components/ui/ContactForm/error-is.ts similarity index 100% rename from src/components/ContactForm/error-is.ts rename to src/components/ui/ContactForm/error-is.ts diff --git a/src/components/Icon/Icon.astro b/src/components/ui/Icon/Icon.astro similarity index 100% rename from src/components/Icon/Icon.astro rename to src/components/ui/Icon/Icon.astro diff --git a/src/components/Icon/icons/bmc.svg b/src/components/ui/Icon/icons/bmc.svg similarity index 100% rename from src/components/Icon/icons/bmc.svg rename to src/components/ui/Icon/icons/bmc.svg diff --git a/src/components/Icon/icons/check.svg b/src/components/ui/Icon/icons/check.svg similarity index 100% rename from src/components/Icon/icons/check.svg rename to src/components/ui/Icon/icons/check.svg diff --git a/src/components/Icon/icons/failure.svg b/src/components/ui/Icon/icons/failure.svg similarity index 100% rename from src/components/Icon/icons/failure.svg rename to src/components/ui/Icon/icons/failure.svg diff --git a/src/components/Icon/icons/github.svg b/src/components/ui/Icon/icons/github.svg similarity index 100% rename from src/components/Icon/icons/github.svg rename to src/components/ui/Icon/icons/github.svg diff --git a/src/components/Icon/icons/hand-heart-filled.svg b/src/components/ui/Icon/icons/hand-heart-filled.svg similarity index 100% rename from src/components/Icon/icons/hand-heart-filled.svg rename to src/components/ui/Icon/icons/hand-heart-filled.svg diff --git a/src/components/Icon/icons/hand-heart.svg b/src/components/ui/Icon/icons/hand-heart.svg similarity index 100% rename from src/components/Icon/icons/hand-heart.svg rename to src/components/ui/Icon/icons/hand-heart.svg diff --git a/src/components/Icon/icons/info.svg b/src/components/ui/Icon/icons/info.svg similarity index 100% rename from src/components/Icon/icons/info.svg rename to src/components/ui/Icon/icons/info.svg diff --git a/src/components/Icon/icons/language.svg b/src/components/ui/Icon/icons/language.svg similarity index 100% rename from src/components/Icon/icons/language.svg rename to src/components/ui/Icon/icons/language.svg diff --git a/src/components/Icon/icons/left-arrow.svg b/src/components/ui/Icon/icons/left-arrow.svg similarity index 100% rename from src/components/Icon/icons/left-arrow.svg rename to src/components/ui/Icon/icons/left-arrow.svg diff --git a/src/components/Icon/icons/link.svg b/src/components/ui/Icon/icons/link.svg similarity index 100% rename from src/components/Icon/icons/link.svg rename to src/components/ui/Icon/icons/link.svg diff --git a/src/components/Icon/icons/magnifier.svg b/src/components/ui/Icon/icons/magnifier.svg similarity index 100% rename from src/components/Icon/icons/magnifier.svg rename to src/components/ui/Icon/icons/magnifier.svg diff --git a/src/components/Icon/icons/mail.svg b/src/components/ui/Icon/icons/mail.svg similarity index 100% rename from src/components/Icon/icons/mail.svg rename to src/components/ui/Icon/icons/mail.svg diff --git a/src/components/Icon/icons/moon.svg b/src/components/ui/Icon/icons/moon.svg similarity index 100% rename from src/components/Icon/icons/moon.svg rename to src/components/ui/Icon/icons/moon.svg diff --git a/src/components/Icon/icons/new.svg b/src/components/ui/Icon/icons/new.svg similarity index 100% rename from src/components/Icon/icons/new.svg rename to src/components/ui/Icon/icons/new.svg diff --git a/src/components/Icon/icons/pencil.svg b/src/components/ui/Icon/icons/pencil.svg similarity index 100% rename from src/components/Icon/icons/pencil.svg rename to src/components/ui/Icon/icons/pencil.svg diff --git a/src/components/Icon/icons/point.svg b/src/components/ui/Icon/icons/point.svg similarity index 100% rename from src/components/Icon/icons/point.svg rename to src/components/ui/Icon/icons/point.svg diff --git a/src/components/Icon/icons/publish.svg b/src/components/ui/Icon/icons/publish.svg similarity index 100% rename from src/components/Icon/icons/publish.svg rename to src/components/ui/Icon/icons/publish.svg diff --git a/src/components/Icon/icons/question.svg b/src/components/ui/Icon/icons/question.svg similarity index 100% rename from src/components/Icon/icons/question.svg rename to src/components/ui/Icon/icons/question.svg diff --git a/src/components/Icon/icons/quote.svg b/src/components/ui/Icon/icons/quote.svg similarity index 100% rename from src/components/Icon/icons/quote.svg rename to src/components/ui/Icon/icons/quote.svg diff --git a/src/components/Icon/icons/right-arrow.svg b/src/components/ui/Icon/icons/right-arrow.svg similarity index 100% rename from src/components/Icon/icons/right-arrow.svg rename to src/components/ui/Icon/icons/right-arrow.svg diff --git a/src/components/Icon/icons/rss.svg b/src/components/ui/Icon/icons/rss.svg similarity index 100% rename from src/components/Icon/icons/rss.svg rename to src/components/ui/Icon/icons/rss.svg diff --git a/src/components/Icon/icons/sun.svg b/src/components/ui/Icon/icons/sun.svg similarity index 100% rename from src/components/Icon/icons/sun.svg rename to src/components/ui/Icon/icons/sun.svg diff --git a/src/components/Icon/icons/toc.svg b/src/components/ui/Icon/icons/toc.svg similarity index 100% rename from src/components/Icon/icons/toc.svg rename to src/components/ui/Icon/icons/toc.svg diff --git a/src/components/Icon/icons/unsplash.svg b/src/components/ui/Icon/icons/unsplash.svg similarity index 100% rename from src/components/Icon/icons/unsplash.svg rename to src/components/ui/Icon/icons/unsplash.svg diff --git a/src/components/Icon/icons/update.svg b/src/components/ui/Icon/icons/update.svg similarity index 100% rename from src/components/Icon/icons/update.svg rename to src/components/ui/Icon/icons/update.svg diff --git a/src/components/Icon/icons/warning.svg b/src/components/ui/Icon/icons/warning.svg similarity index 100% rename from src/components/Icon/icons/warning.svg rename to src/components/ui/Icon/icons/warning.svg diff --git a/src/components/Icon/index.ts b/src/components/ui/Icon/index.ts similarity index 100% rename from src/components/Icon/index.ts rename to src/components/ui/Icon/index.ts diff --git a/src/components/Icon/types.ts b/src/components/ui/Icon/types.ts similarity index 100% rename from src/components/Icon/types.ts rename to src/components/ui/Icon/types.ts diff --git a/src/components/Likes/LikeIcon.tsx b/src/components/ui/Likes/LikeIcon.tsx similarity index 100% rename from src/components/Likes/LikeIcon.tsx rename to src/components/ui/Likes/LikeIcon.tsx diff --git a/src/components/Likes/Likes.tsx b/src/components/ui/Likes/Likes.tsx similarity index 96% rename from src/components/Likes/Likes.tsx rename to src/components/ui/Likes/Likes.tsx index eb86ff1c..2e9737fa 100644 --- a/src/components/Likes/Likes.tsx +++ b/src/components/ui/Likes/Likes.tsx @@ -1,4 +1,4 @@ -import { locale } from '@/components/LocaleStore/locale-store'; +import { locale } from '@/components/functional/LocaleStore/locale-store'; import type { I18nData } from '@/lib/collections/types'; import type { Language } from '@/utils/i18n/data'; import { useTranslatedPath } from '@/utils/i18n/utils'; diff --git a/src/components/Likes/likes.css.ts b/src/components/ui/Likes/likes.css.ts similarity index 100% rename from src/components/Likes/likes.css.ts rename to src/components/ui/Likes/likes.css.ts diff --git a/src/components/Modal/Modal.tsx b/src/components/ui/Modal/Modal.tsx similarity index 100% rename from src/components/Modal/Modal.tsx rename to src/components/ui/Modal/Modal.tsx diff --git a/src/components/Modal/modal-data.ts b/src/components/ui/Modal/modal-data.ts similarity index 100% rename from src/components/Modal/modal-data.ts rename to src/components/ui/Modal/modal-data.ts diff --git a/src/components/Modal/modal.css.ts b/src/components/ui/Modal/modal.css.ts similarity index 95% rename from src/components/Modal/modal.css.ts rename to src/components/ui/Modal/modal.css.ts index 81a8e5be..ef714594 100644 --- a/src/components/Modal/modal.css.ts +++ b/src/components/ui/Modal/modal.css.ts @@ -1,4 +1,4 @@ -import { contactForm } from '@/components/ContactForm/contact-form.css'; +import { contactForm } from '@/components/ui/ContactForm/contact-form.css'; import { createVar, style } from '@vanilla-extract/css'; const fgColor = createVar(); diff --git a/src/components/PhotoGallery/PhotoGallery.astro b/src/components/ui/PhotoGallery/PhotoGallery.astro similarity index 96% rename from src/components/PhotoGallery/PhotoGallery.astro rename to src/components/ui/PhotoGallery/PhotoGallery.astro index d05b2881..f1c0e95c 100644 --- a/src/components/PhotoGallery/PhotoGallery.astro +++ b/src/components/ui/PhotoGallery/PhotoGallery.astro @@ -1,6 +1,6 @@ --- import { getEntry } from 'astro:content'; -import { CardGrid } from '@/components/Card'; +import { CardGrid } from '@/components/elements/Card'; import { ACCOUNT_ID, UNSPLASH_BASE_URL } from '@/lib/consts'; import { getPhotographer } from '@/lib/unsplash/contents'; import type { UnsplashPhotoData } from '@/lib/unsplash/types'; diff --git a/src/components/PhotoGallery/PhotoGalleryItem.astro b/src/components/ui/PhotoGallery/PhotoGalleryItem.astro similarity index 83% rename from src/components/PhotoGallery/PhotoGalleryItem.astro rename to src/components/ui/PhotoGallery/PhotoGalleryItem.astro index e831d7eb..ffd6919b 100644 --- a/src/components/PhotoGallery/PhotoGalleryItem.astro +++ b/src/components/ui/PhotoGallery/PhotoGalleryItem.astro @@ -1,12 +1,13 @@ --- -import { Image } from 'astro:assets'; import { getEntry } from 'astro:content'; -import { Card } from '@/components/Card'; -import { ProfileIcon } from '@/components/ProfileIcon'; +import { Card } from '@/components/elements/Card'; +import { Image } from '@/components/elements/Figure'; +import { ProfileIcon } from '@/components/ui/ProfileIcon'; import type { UnsplashPhoto } from '@/lib/unsplash/types'; import { getTimeDiff } from '@/utils/get-time-diff'; import { getLocaleFromUrl } from '@/utils/i18n/utils'; import { toSnakeCase } from '@/utils/to-snake-case'; +import { blurhashToDataUri } from '@unpic/placeholder'; type Props = { photo: UnsplashPhoto; @@ -19,16 +20,18 @@ const meta = await getEntry('meta', 'en/site-data'); const { photo, order } = Astro.props; const { alt_description, + blur_hash, description, created_at, links, urls, user, - height, - width, + // height, + // width, } = photo; const createdAt = new Date(created_at); const dateDiff = getTimeDiff(createdAt, locale); +const placeholder = blurhashToDataUri(blur_hash ?? ''); --- @@ -39,12 +42,9 @@ const dateDiff = getTimeDiff(createdAt, locale); > {alt_description