diff --git a/astro.config.ts b/astro.config.ts index 0f145cb..6713af8 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -4,6 +4,7 @@ import tailwind from '@astrojs/tailwind' import sitemap from '@astrojs/sitemap' import mdx from '@astrojs/mdx' import remarkLinkCard from 'remark-link-card' +import preact from '@astrojs/preact' const { SITE_URL } = loadEnv(process.env.NODE_ENV!, process.cwd(), '') @@ -36,5 +37,5 @@ export default defineConfig({ markdown: { remarkPlugins: [remarkLinkCard], }, - integrations: [tailwind(), sitemap(), mdx()], + integrations: [tailwind(), sitemap(), mdx(), preact()], }) diff --git a/package-lock.json b/package-lock.json index c23a404..394f335 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,13 @@ "dependencies": { "@astrojs/check": "^0.3.1", "@astrojs/mdx": "^2.0.1", + "@astrojs/preact": "^3.0.1", "@astrojs/sitemap": "^3.0.3", "@astrojs/tailwind": "^5.0.3", "@tailwindcss/typography": "^0.5.10", "astro": "^4.0.4", "polished": "^4.2.2", + "preact": "^10.19.3", "remark-link-card": "^1.3.1", "satori": "^0.10.11", "sharp": "^0.33.0", @@ -192,6 +194,25 @@ "astro": "^4.0.0" } }, + "node_modules/@astrojs/preact": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@astrojs/preact/-/preact-3.0.1.tgz", + "integrity": "sha512-pAfN+U7J4hw7qijqkBx1ZBpPO+ooa+MkKIgshCozfqsHTp18uPflxQUviz0TEzB5nn7hSndzncWuc3pz/HbtJw==", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.22.5", + "@babel/plugin-transform-react-jsx-development": "^7.22.5", + "@preact/preset-vite": "^2.5.0", + "@preact/signals": "^1.2.1", + "babel-plugin-transform-hook-names": "^1.0.2", + "preact-render-to-string": "^6.2.1" + }, + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "preact": "^10.6.5" + } + }, "node_modules/@astrojs/prism": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.0.0.tgz", @@ -545,6 +566,20 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.22.5.tgz", + "integrity": "sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/runtime": { "version": "7.23.6", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.6.tgz", @@ -1588,6 +1623,100 @@ "node": ">= 8" } }, + "node_modules/@preact/preset-vite": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@preact/preset-vite/-/preset-vite-2.7.0.tgz", + "integrity": "sha512-m5N0FVtxbCCDxNk55NGhsRpKJChYcupcuQHzMJc/Bll07IKZKn8amwYciyKFS9haU6AgzDAJ/ewvApr6Qg1DHw==", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.22.15", + "@babel/plugin-transform-react-jsx-development": "^7.22.5", + "@prefresh/vite": "^2.4.1", + "@rollup/pluginutils": "^4.1.1", + "babel-plugin-transform-hook-names": "^1.0.2", + "debug": "^4.3.4", + "kolorist": "^1.8.0", + "resolve": "^1.22.8" + }, + "peerDependencies": { + "@babel/core": "7.x", + "vite": "2.x || 3.x || 4.x || 5.x" + } + }, + "node_modules/@preact/signals": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@preact/signals/-/signals-1.2.2.tgz", + "integrity": "sha512-ColCqdo4cRP18bAuIR4Oik5rDpiyFtPIJIygaYPMEAwTnl4buWkBOflGBSzhYyPyJfKpkwlekrvK+1pzQ2ldWw==", + "dependencies": { + "@preact/signals-core": "^1.4.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + }, + "peerDependencies": { + "preact": "10.x" + } + }, + "node_modules/@preact/signals-core": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@preact/signals-core/-/signals-core-1.5.1.tgz", + "integrity": "sha512-dE6f+WCX5ZUDwXzUIWNMhhglmuLpqJhuy3X3xHrhZYI0Hm2LyQwOu0l9mdPiWrVNsE+Q7txOnJPgtIqHCYoBVA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/@prefresh/babel-plugin": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@prefresh/babel-plugin/-/babel-plugin-0.5.1.tgz", + "integrity": "sha512-uG3jGEAysxWoyG3XkYfjYHgaySFrSsaEb4GagLzYaxlydbuREtaX+FTxuIidp241RaLl85XoHg9Ej6E4+V1pcg==" + }, + "node_modules/@prefresh/core": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@prefresh/core/-/core-1.5.2.tgz", + "integrity": "sha512-A/08vkaM1FogrCII5PZKCrygxSsc11obExBScm3JF1CryK2uDS3ZXeni7FeKCx1nYdUkj4UcJxzPzc1WliMzZA==", + "peerDependencies": { + "preact": "^10.0.0" + } + }, + "node_modules/@prefresh/utils": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@prefresh/utils/-/utils-1.2.0.tgz", + "integrity": "sha512-KtC/fZw+oqtwOLUFM9UtiitB0JsVX0zLKNyRTA332sqREqSALIIQQxdUCS1P3xR/jT1e2e8/5rwH6gdcMLEmsQ==" + }, + "node_modules/@prefresh/vite": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@prefresh/vite/-/vite-2.4.5.tgz", + "integrity": "sha512-iForDVJ2M8gQYnm5pHumvTEJjGGc7YNYC0GVKnHFL+GvFfKHfH9Rpq67nUAzNbjuLEpqEOUuQVQajMazWu2ZNQ==", + "dependencies": { + "@babel/core": "^7.22.1", + "@prefresh/babel-plugin": "0.5.1", + "@prefresh/core": "^1.5.1", + "@prefresh/utils": "^1.2.0", + "@rollup/pluginutils": "^4.2.1" + }, + "peerDependencies": { + "preact": "^10.4.0", + "vite": ">=2.0.0" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.9.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.0.tgz", @@ -2387,6 +2516,14 @@ "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", "optional": true }, + "node_modules/babel-plugin-transform-hook-names": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-hook-names/-/babel-plugin-transform-hook-names-1.0.2.tgz", + "integrity": "sha512-5gafyjyyBTTdX/tQQ0hRgu4AhNHG/hqWi0ZZmg2xvs2FgRkJXzDNKBZCyoYqgFkovfDrgM8OoKg8karoUvWeCw==", + "peerDependencies": { + "@babel/core": "^7.12.10" + } + }, "node_modules/bail": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", @@ -4737,6 +4874,11 @@ "node": ">=6" } }, + "node_modules/kolorist": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==" + }, "node_modules/lilconfig": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", @@ -6786,6 +6928,26 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "node_modules/preact": { + "version": "10.19.3", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.3.tgz", + "integrity": "sha512-nHHTeFVBTHRGxJXKkKu5hT8C/YWBkPso4/Gad6xuj5dbptt9iF9NZr9pHbPhBrnT2klheu7mHTxTZ/LjwJiEiQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/preact-render-to-string": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.3.1.tgz", + "integrity": "sha512-NQ28WrjLtWY6lKDlTxnFpKHZdpjfF+oE6V4tZ0rTrunHrtZp6Dm0oFrcJalt/5PNeqJz4j1DuZDS0Y6rCBoqDA==", + "dependencies": { + "pretty-format": "^3.8.0" + }, + "peerDependencies": { + "preact": ">=10" + } + }, "node_modules/prebuild-install": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", @@ -7025,6 +7187,11 @@ } } }, + "node_modules/pretty-format": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", + "integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==" + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", diff --git a/package.json b/package.json index 3e5bdb3..3185fae 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,13 @@ "dependencies": { "@astrojs/check": "^0.3.1", "@astrojs/mdx": "^2.0.1", + "@astrojs/preact": "^3.0.1", "@astrojs/sitemap": "^3.0.3", "@astrojs/tailwind": "^5.0.3", "@tailwindcss/typography": "^0.5.10", "astro": "^4.0.4", "polished": "^4.2.2", + "preact": "^10.19.3", "remark-link-card": "^1.3.1", "satori": "^0.10.11", "sharp": "^0.33.0", diff --git a/src/assets/icons/search.svg b/src/assets/icons/search.svg new file mode 100644 index 0000000..5ad95f5 --- /dev/null +++ b/src/assets/icons/search.svg @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/components/blog/BlogListSection.astro b/src/components/blog/BlogListSection.astro index df31567..7b53c10 100644 --- a/src/components/blog/BlogListSection.astro +++ b/src/components/blog/BlogListSection.astro @@ -1,17 +1,27 @@ --- import type { CollectionEntry } from 'astro:content' import BlogList from './BlogList.astro' -import Section from '../common/Section.astro' +import Section from '@/components/common/Section.astro' interface Props { - title: string + title?: string blogs: CollectionEntry<'blogs'>[] } const { title, blogs } = Astro.props --- -
- {title} - -
+ + { + title ? ( +
+ {title} + +
+ ) : ( +
+ +
+ ) + } +
diff --git a/src/components/blog/ListViewTab.astro b/src/components/blog/ListViewTab.astro new file mode 100644 index 0000000..7d383c1 --- /dev/null +++ b/src/components/blog/ListViewTab.astro @@ -0,0 +1,48 @@ +--- +interface Props { + current: Item['path'] +} + +interface Item { + path: '/blog/' | '/blog/tags/' + text: string +} + +const items: Item[] = [ + { + path: '/blog/', + text: 'ブログ一覧', + }, + { + path: '/blog/tags/', + text: 'タグ一覧', + }, +] + +const { current } = Astro.props +--- + +
+
+ +
+
diff --git a/src/components/blog/author/AuthorAboutSection.astro b/src/components/blog/author/AuthorAboutSection.astro index 3da49c2..52c7977 100644 --- a/src/components/blog/author/AuthorAboutSection.astro +++ b/src/components/blog/author/AuthorAboutSection.astro @@ -1,6 +1,6 @@ --- import type { CollectionEntry } from 'astro:content' -import Section from '../../common/Section.astro' +import Section from '@/components/common/Section.astro' import InlineLink from '@/components/common/InlineLink.astro' interface Props { diff --git a/src/components/blog/icon/TagIcon.preact.tsx b/src/components/blog/icon/TagIcon.preact.tsx new file mode 100644 index 0000000..c94d51f --- /dev/null +++ b/src/components/blog/icon/TagIcon.preact.tsx @@ -0,0 +1,20 @@ +import type { ClientTag } from '@/content/config' + +interface Props { + tag: Pick + + size: number + fullSizeImage?: boolean +} + +export default function TagIcon({ tag, size }: Props) { + return ( + {`${tag.name} + ) +} diff --git a/src/components/blog/tag/TagAboutSection.astro b/src/components/blog/tag/TagAboutSection.astro index e769b92..31d402c 100644 --- a/src/components/blog/tag/TagAboutSection.astro +++ b/src/components/blog/tag/TagAboutSection.astro @@ -1,6 +1,6 @@ --- import type { CollectionEntry } from 'astro:content' -import Section from '../../common/Section.astro' +import Section from '@/components/common/Section.astro' import InlineLink from '@/components/common/InlineLink.astro' interface Props { diff --git a/src/components/blog/tag/TagList.astro b/src/components/blog/tag/TagList.astro deleted file mode 100644 index dcaebc9..0000000 --- a/src/components/blog/tag/TagList.astro +++ /dev/null @@ -1,22 +0,0 @@ ---- -import type { CollectionEntry } from 'astro:content' -import TagListItemCard from './TagListItemCard.astro' - -interface Props { - tags: (CollectionEntry<'tags'> & { articleCount: number })[] -} - -const { tags } = Astro.props ---- - - diff --git a/src/components/blog/tag/TagList.tsx b/src/components/blog/tag/TagList.tsx new file mode 100644 index 0000000..b62087a --- /dev/null +++ b/src/components/blog/tag/TagList.tsx @@ -0,0 +1,16 @@ +import TagListItemCard from './TagListItemCard' +import type { TagSearchObj } from './TagSearchSection' + +interface Props { + tags: TagSearchObj[] +} + +export default function TagList({ tags }: Props) { + return ( + + ) +} diff --git a/src/components/blog/tag/TagListItemCard.astro b/src/components/blog/tag/TagListItemCard.astro deleted file mode 100644 index 72a9289..0000000 --- a/src/components/blog/tag/TagListItemCard.astro +++ /dev/null @@ -1,24 +0,0 @@ ---- -import type { CollectionEntry } from 'astro:content' -import TagIcon from '../icon/TagIcon.astro' -type Props = CollectionEntry<'tags'>['data'] & { - id: CollectionEntry<'tags'>['id'] - articleCount: number -} - -const { id, articleCount, ...tag } = Astro.props ---- - -
  • - - -
    -

    - {tag.name} -

    -

    記事数 : {articleCount}

    -
    -
    -
  • diff --git a/src/components/blog/tag/TagListItemCard.tsx b/src/components/blog/tag/TagListItemCard.tsx new file mode 100644 index 0000000..9aebff1 --- /dev/null +++ b/src/components/blog/tag/TagListItemCard.tsx @@ -0,0 +1,22 @@ +import TagIcon from '../icon/TagIcon.preact' +import type { TagSearchObj } from './TagSearchSection' + +export default function TagListItemCard({ + id, + articleCount, + ...tag +}: TagSearchObj) { + return ( +
  • + + +
    +

    + {tag.name} +

    +

    記事数 : {articleCount}

    +
    +
    +
  • + ) +} diff --git a/src/components/blog/tag/TagListSection.astro b/src/components/blog/tag/TagListSection.astro deleted file mode 100644 index 04efdd3..0000000 --- a/src/components/blog/tag/TagListSection.astro +++ /dev/null @@ -1,17 +0,0 @@ ---- -import type { CollectionEntry } from 'astro:content' -import Section from '@/components/common/Section.astro' -import TagList from './TagList.astro' - -interface Props { - title: string - tags: (CollectionEntry<'tags'> & { articleCount: number })[] -} - -const { title, tags } = Astro.props ---- - -
    - {title} - -
    diff --git a/src/components/blog/tag/TagListSection.tsx b/src/components/blog/tag/TagListSection.tsx new file mode 100644 index 0000000..b239635 --- /dev/null +++ b/src/components/blog/tag/TagListSection.tsx @@ -0,0 +1,16 @@ +import Section from '@/components/common/Section.preact' +import TagList from './TagList' +import type { TagSearchObj } from './TagSearchSection' + +interface Props { + title?: string + tags: TagSearchObj[] +} + +export default function TagListSection({ title, tags }: Props) { + return ( +
    + +
    + ) +} diff --git a/src/components/blog/tag/TagSearchSection.tsx b/src/components/blog/tag/TagSearchSection.tsx new file mode 100644 index 0000000..a47b467 --- /dev/null +++ b/src/components/blog/tag/TagSearchSection.tsx @@ -0,0 +1,45 @@ +import { useState } from 'preact/hooks' +import TagListSection from './TagListSection' +import type { ClientTag } from '@/content/config' +import Section from '@/components/common/Section.preact' +import Icon from '@/components/common/Icon.preact' +import SearchIcon from '@/assets/icons/search.svg' + +export type TagSearchObj = ClientTag & { + articleCount: number +} + +export default function TagSearchSection({ tags }: { tags: TagSearchObj[] }) { + const [displayingTags, setDisplayingTags] = useState(tags) + + return ( +
    +
    +
    + + { + if (e.currentTarget.value === '') setDisplayingTags(tags) + else + setDisplayingTags( + tags.filter((t) => + t.name + .toLowerCase() + .includes(e.currentTarget.value.toLowerCase()), + ), + ) + }} + /> +
    +
    + +
    + ) +} diff --git a/src/components/common/Heading1.preact.tsx b/src/components/common/Heading1.preact.tsx new file mode 100644 index 0000000..071f8f4 --- /dev/null +++ b/src/components/common/Heading1.preact.tsx @@ -0,0 +1,24 @@ +import { unreachable } from '@/utils/unreachable' +import type { ReactNode } from 'preact/compat' + +export default function Heading1({ + children, + variant = 'primary', +}: { + children: ReactNode + variant?: 'primary' | 'secondary' +}) { + return ( +

    + {children} +

    + ) +} diff --git a/src/components/common/Icon.preact.tsx b/src/components/common/Icon.preact.tsx new file mode 100644 index 0000000..f861845 --- /dev/null +++ b/src/components/common/Icon.preact.tsx @@ -0,0 +1,42 @@ +/** + * /assets/icons にあるアイコンを単色で表示する。 + * + * 色には現在の文字色(`currentColor`)が使われる。これはCSSの`color`で変更できる。 + * + * CSSで幅または高さを指定しないと、大きさが0pxとなり表示されない。 + * また、この要素は``と同様にデフォルトで`display: inline-block`となっている。要素の下に意図せず余白が生じる場合は`vertical-align: top`で調整できる。cf. https://stackoverflow.com/q/27536428 + */ + +import type { HTMLAttributes } from 'preact/compat' + +type Props = Omit, 'name' | 'alt' | 'style'> & { + image: ImageMetadata + + // 代替テキスト(``の`alt`属性と同じ) + alt: string + + style?: string +} + +export default function Icon({ + image, + alt, + class: className, + ...attrs +}: Props) { + return ( + + ) +} diff --git a/src/components/common/Section.preact.tsx b/src/components/common/Section.preact.tsx new file mode 100644 index 0000000..530fd34 --- /dev/null +++ b/src/components/common/Section.preact.tsx @@ -0,0 +1,38 @@ +import { unreachable } from '@/utils/unreachable' +import Heading1 from './Heading1.preact' +import type { ReactNode } from 'preact/compat' + +export default function Section({ + background, + title, + children, +}: { + background: 'white' | 'primary' | 'secondary' + title?: string + children: ReactNode +}) { + return ( +
    +
    + {title && ( + + {title} + + )} +
    {children}
    +
    +
    + ) +} diff --git a/src/content/config.ts b/src/content/config.ts index ad3b39b..5ee88a4 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,4 +1,10 @@ -import { z, defineCollection, reference } from 'astro:content' +import { + z, + defineCollection, + reference, + type CollectionEntry, +} from 'astro:content' +import defaultTagImage from '@/assets/hashtag.svg' const blogsCollection = defineCollection({ type: 'content', @@ -42,6 +48,17 @@ const authorsCollection = defineCollection({ }), }) +export type ClientTag = ReturnType + +/** クライアントで使用するタグオブジェクトを取得します */ +export function getClientTag(tag: CollectionEntry<'tags'>) { + return { + id: tag.id, + ...tag.data, + image: tag.data.image?.src ?? defaultTagImage.src, + } +} + const tagsCollection = defineCollection({ type: 'data', schema: ({ image }) => diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 74010de..ffc3372 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -2,12 +2,14 @@ import BlogLayout from '@/layouts/BlogLayout.astro' import { getCollection } from 'astro:content' import BlogListSection from '@/components/blog/BlogListSection.astro' +import ListViewTab from '@/components/blog/ListViewTab.astro' const blogEntries = await getCollection('blogs') --- +
    - +
    diff --git a/src/pages/blog/tags/index.astro b/src/pages/blog/tags/index.astro index 5206717..7e91112 100644 --- a/src/pages/blog/tags/index.astro +++ b/src/pages/blog/tags/index.astro @@ -2,7 +2,9 @@ import BlogLayout from '@/layouts/BlogLayout.astro' import { getCollection } from 'astro:content' import { getTagStatistics } from '@/content/_blog-statistics' -import TagListSection from '@/components/blog/tag/TagListSection.astro' +import TagSearchSection from '@/components/blog/tag/TagSearchSection' +import { getClientTag } from '@/content/config' +import ListViewTab from '@/components/blog/ListViewTab.astro' const tagEntries = await getCollection('tags') const statistics = await getTagStatistics() @@ -28,7 +30,14 @@ tags.sort((tag1, tag2) => --- +
    - + ({ + ...getClientTag(tag), + articleCount: tag.articleCount, + }))} + client:load + />
    diff --git a/tsconfig.json b/tsconfig.json index ba1910a..3aae236 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,8 @@ "baseUrl": ".", "paths": { "@/*": ["src/*"] - } + }, + "jsx": "react-jsx", + "jsxImportSource": "preact" } }