From 139ca46a9c01f6c95f06a5e32e25604eda494cb7 Mon Sep 17 00:00:00 2001 From: prototypa Date: Thu, 27 Jul 2023 06:36:12 -0400 Subject: [PATCH] Migrate to astro-icon v1 --- astro.config.mjs | 8 ++++++++ package.json | 7 ++++++- src/components/blog/ListItem.astro | 2 +- src/components/blog/Pagination.astro | 2 +- src/components/blog/SinglePost.astro | 2 +- src/components/blog/ToBlogLink.astro | 2 +- src/components/common/SocialShare.astro | 2 +- src/components/common/ToggleMenu.astro | 2 +- src/components/common/ToggleTheme.astro | 2 +- src/components/widgets/CallToAction.astro | 2 +- src/components/widgets/Content.astro | 2 +- src/components/widgets/FAQs.astro | 2 +- src/components/widgets/Features.astro | 2 +- src/components/widgets/Features2.astro | 2 +- src/components/widgets/Footer.astro | 2 +- src/components/widgets/Header.astro | 2 +- src/components/widgets/Hero.astro | 2 +- src/components/widgets/Hero2.astro | 2 +- src/components/widgets/Note.astro | 2 +- src/components/widgets/Steps.astro | 2 +- src/components/widgets/Steps2.astro | 2 +- src/pages/index.astro | 4 ++-- 22 files changed, 35 insertions(+), 22 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index b04b0e7..9946ed0 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -7,6 +7,7 @@ import tailwind from '@astrojs/tailwind'; import sitemap from '@astrojs/sitemap'; import image from '@astrojs/image'; import mdx from '@astrojs/mdx'; +import icon from "astro-icon"; import partytown from '@astrojs/partytown'; import compress from 'astro-compress'; import { readingTimeRemarkPlugin } from './src/utils/frontmatter.mjs'; @@ -40,6 +41,13 @@ export default defineConfig({ serviceEntryPoint: '@astrojs/image/sharp', }), mdx(), + icon({ + include: { + tabler: ["*"], + "flat-color-icons": ["template", "gallery", "approval", "document", "advertising", "currency-exchange", "voice-presentation", "business-contact", "database"], + ri: ["twitter-fill", "facebook-box-fill", "linkedin-box-fill", "whatsapp-fill", "mail-fill"], + }, + }), ...whenExternalScripts(() => partytown({ diff --git a/package.json b/package.json index 299477c..df51548 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@typescript-eslint/parser": "^6.2.0", "astro": "^2.9.3", "astro-compress": "^1.1.49", - "astro-icon": "^0.8.1", + "astro-icon": "^1.0.0-next.2", "eslint": "^8.45.0", "eslint-plugin-astro": "^0.27.2", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -43,5 +43,10 @@ }, "engines": { "node": ">=16.12.0" + }, + "dependencies": { + "@iconify-json/flat-color-icons": "^1.1.6", + "@iconify-json/ri": "^1.1.10", + "@iconify-json/tabler": "^1.1.85" } } diff --git a/src/components/blog/ListItem.astro b/src/components/blog/ListItem.astro index 0504aae..d2365e3 100644 --- a/src/components/blog/ListItem.astro +++ b/src/components/blog/ListItem.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; import PostTags from '~/components/blog/Tags.astro'; diff --git a/src/components/blog/Pagination.astro b/src/components/blog/Pagination.astro index fbad4e3..058e363 100644 --- a/src/components/blog/Pagination.astro +++ b/src/components/blog/Pagination.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { getPermalink } from '~/utils/permalinks'; export interface Props { diff --git a/src/components/blog/SinglePost.astro b/src/components/blog/SinglePost.astro index e0d306a..6694c97 100644 --- a/src/components/blog/SinglePost.astro +++ b/src/components/blog/SinglePost.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; import PostTags from '~/components/blog/Tags.astro'; diff --git a/src/components/blog/ToBlogLink.astro b/src/components/blog/ToBlogLink.astro index 522201f..e35ed0d 100644 --- a/src/components/blog/ToBlogLink.astro +++ b/src/components/blog/ToBlogLink.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { getBlogPermalink } from '~/utils/permalinks'; --- diff --git a/src/components/common/SocialShare.astro b/src/components/common/SocialShare.astro index 91282c9..b477c2c 100644 --- a/src/components/common/SocialShare.astro +++ b/src/components/common/SocialShare.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; export interface Props { text: string; diff --git a/src/components/common/ToggleMenu.astro b/src/components/common/ToggleMenu.astro index 73d3473..8408ff9 100644 --- a/src/components/common/ToggleMenu.astro +++ b/src/components/common/ToggleMenu.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; export interface Props { label?: string; diff --git a/src/components/common/ToggleTheme.astro b/src/components/common/ToggleTheme.astro index 5591ad0..31bfec2 100644 --- a/src/components/common/ToggleTheme.astro +++ b/src/components/common/ToggleTheme.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { SITE } from '~/config.mjs'; diff --git a/src/components/widgets/CallToAction.astro b/src/components/widgets/CallToAction.astro index 0e14118..f02c008 100644 --- a/src/components/widgets/CallToAction.astro +++ b/src/components/widgets/CallToAction.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; export interface CallToAction { text: string; diff --git a/src/components/widgets/Content.astro b/src/components/widgets/Content.astro index 455a7f1..3993cc7 100644 --- a/src/components/widgets/Content.astro +++ b/src/components/widgets/Content.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; interface Item { diff --git a/src/components/widgets/FAQs.astro b/src/components/widgets/FAQs.astro index 50718fc..7dec748 100644 --- a/src/components/widgets/FAQs.astro +++ b/src/components/widgets/FAQs.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; interface Item { question: string; diff --git a/src/components/widgets/Features.astro b/src/components/widgets/Features.astro index 8a5e309..59edd25 100644 --- a/src/components/widgets/Features.astro +++ b/src/components/widgets/Features.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; interface Item { title: string; diff --git a/src/components/widgets/Features2.astro b/src/components/widgets/Features2.astro index db65bb4..8ab1f4a 100644 --- a/src/components/widgets/Features2.astro +++ b/src/components/widgets/Features2.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; interface Item { title?: string; diff --git a/src/components/widgets/Footer.astro b/src/components/widgets/Footer.astro index 7045e16..7504bc6 100644 --- a/src/components/widgets/Footer.astro +++ b/src/components/widgets/Footer.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { SITE } from '~/config.mjs'; import { getHomePermalink } from '~/utils/permalinks'; diff --git a/src/components/widgets/Header.astro b/src/components/widgets/Header.astro index 77608b9..11e1330 100644 --- a/src/components/widgets/Header.astro +++ b/src/components/widgets/Header.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import Logo from '~/components/Logo.astro'; import ToggleTheme from '~/components/common/ToggleTheme.astro'; import ToggleMenu from '~/components/common/ToggleMenu.astro'; diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro index 123a0f8..bf9316e 100644 --- a/src/components/widgets/Hero.astro +++ b/src/components/widgets/Hero.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; import type { CallToAction } from '~/components/widgets/CallToAction.astro'; diff --git a/src/components/widgets/Hero2.astro b/src/components/widgets/Hero2.astro index e1d50c2..9f68674 100644 --- a/src/components/widgets/Hero2.astro +++ b/src/components/widgets/Hero2.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; import type { CallToAction } from '~/components/widgets/CallToAction.astro'; diff --git a/src/components/widgets/Note.astro b/src/components/widgets/Note.astro index 4d86f9a..6543b4f 100644 --- a/src/components/widgets/Note.astro +++ b/src/components/widgets/Note.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; ---
diff --git a/src/components/widgets/Steps.astro b/src/components/widgets/Steps.astro index 0931478..60e470d 100644 --- a/src/components/widgets/Steps.astro +++ b/src/components/widgets/Steps.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import { Picture } from '@astrojs/image/components'; interface Item { diff --git a/src/components/widgets/Steps2.astro b/src/components/widgets/Steps2.astro index 797162b..b93d3d0 100644 --- a/src/components/widgets/Steps2.astro +++ b/src/components/widgets/Steps2.astro @@ -1,5 +1,5 @@ --- -import { Icon } from 'astro-icon'; +import { Icon } from 'astro-icon/components'; import type { CallToAction } from '~/components/widgets/CallToAction.astro'; interface Item { diff --git a/src/pages/index.astro b/src/pages/index.astro index 5a2d2be..b9efb44 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -218,7 +218,7 @@ const meta = { title: 'Features', description: 'Display your product in action and how the Features actually create a solution for your target customer.', - icon: 'flat-color-icons:todo-list', + icon: 'flat-color-icons:approval', }, { title: 'Content', @@ -254,7 +254,7 @@ const meta = { title: 'Footers', description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', - icon: 'icon-park:page-template', + icon: 'flat-color-icons:database', }, ]} />