From c6ee40931ee89a1ff4eadf8b104b4254ea22ed4c Mon Sep 17 00:00:00 2001 From: Le Minh Tri Date: Fri, 24 Feb 2023 02:58:59 +0700 Subject: [PATCH] feat: update index page UI using TailwindCSS --- public/favicon.ico | Bin 0 -> 1150 bytes public/favicon.svg | 13 ------- src/components/Card.astro | 46 ++---------------------- src/components/SEOMeta.astro | 12 +++---- src/configs/site.ts | 7 ++++ src/layouts/AppLayout.astro | 28 +++++++++++++++ src/layouts/Layout.astro | 40 --------------------- src/pages/index.astro | 66 ++++++----------------------------- 8 files changed, 53 insertions(+), 159 deletions(-) create mode 100644 public/favicon.ico delete mode 100644 public/favicon.svg create mode 100644 src/configs/site.ts create mode 100644 src/layouts/AppLayout.astro delete mode 100644 src/layouts/Layout.astro diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..f9e7a94cb19947c0d09883f353d603799cec5cd1 GIT binary patch literal 1150 zcmd5+O-oc^6n;ywg?&uxYdkOD+NpK2BL(V|b=b~OtQa?)}7MzZ7!)VVGQ;Mj^Xd@Q(PoLBY zNQd+O0pm91W@ilHb=;|zFCIflag)!*Ta|m-vJ@J)U==>n0j`z+o$h}fX6ZNqM#=M1Gci3&9-`YIn zQ5)p-0QAFSh}CC|F27>V5eRF9u?e2pM(DSXz^_f{yK%@+1+eoK`gxJPE<=B;K**Oq zZ3nj5|6ITC$7-jJLwYYm7qh_6b?8Vnq`v|>MLwP+yiB&R7H2YA3!RRW*Nfycm)}k- zT?o0&9=e%pf}FHaPco-*8jr+g7I5yZ)<3y0{tYwkYzHhyigU90X3qPWW=g34CAJd* zYmz7Fz3S%~Vz&R5gS%kt=Dj`E#Cot|H=0If8em^ E9+2yvh5!Hn literal 0 HcmV?d00001 diff --git a/public/favicon.svg b/public/favicon.svg deleted file mode 100644 index 0f390629..00000000 --- a/public/favicon.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/Card.astro b/src/components/Card.astro index e36b8f09..859412c8 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -8,9 +8,9 @@ export interface Props { const { href, title, body } = Astro.props --- -
  • -

    +

    {title}

    @@ -19,45 +19,3 @@ const { href, title, body } = Astro.props

  • - diff --git a/src/components/SEOMeta.astro b/src/components/SEOMeta.astro index 5a7e882c..3fd181b2 100644 --- a/src/components/SEOMeta.astro +++ b/src/components/SEOMeta.astro @@ -1,12 +1,12 @@ --- interface Props { title: string - description: string | undefined - favicon: string | undefined - faviconMimeType: string | undefined - keywords: string | undefined - author: string | undefined - robots: string | undefined + description?: string + favicon?: string + faviconMimeType?: string + keywords?: string + author?: string + robots?: string } const { diff --git a/src/configs/site.ts b/src/configs/site.ts new file mode 100644 index 00000000..81f02f80 --- /dev/null +++ b/src/configs/site.ts @@ -0,0 +1,7 @@ +export default { + title: 'LeetCode Blog', + description: 'Solutions for LeetCode problems - Written by ansidev', + author: 'ansidev', + favicon: '/favicon.ico', + faviconMimeType: 'image/ico', +} diff --git a/src/layouts/AppLayout.astro b/src/layouts/AppLayout.astro new file mode 100644 index 00000000..32ee3a28 --- /dev/null +++ b/src/layouts/AppLayout.astro @@ -0,0 +1,28 @@ +--- +import SEOMeta from '@/components/SEOMeta.astro' +import siteConfig from '@/configs/site' + +export interface Props { + title: string + description: string + author: string +} + +const { title, author } = Astro.props +const { favicon, faviconMimeType } = siteConfig +--- + + + + + + + + + + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro deleted file mode 100644 index 575e9caa..00000000 --- a/src/layouts/Layout.astro +++ /dev/null @@ -1,40 +0,0 @@ ---- -export interface Props { - title: string -} - -const { title } = Astro.props ---- - - - - - - - - - {title} - - - - - - diff --git a/src/pages/index.astro b/src/pages/index.astro index c66ff95b..b1fc4987 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,17 +1,16 @@ --- import Card from '@/components/Card.astro' -import Layout from '@/layouts/Layout.astro' +import siteConfig from '@/configs/site' +import AppLayout from '@/layouts/AppLayout.astro' + +const { title, description, author } = siteConfig --- - -
    -

    Welcome to Astro

    -

    - To get started, open the directory src/pages in your project. -
    - Code Challenge: Tweak the "Welcome to Astro" message above. -

    -