Skip to content

Commit

Permalink
feat: add icons to the footer
Browse files Browse the repository at this point in the history
  • Loading branch information
lxchapu committed Apr 29, 2024
1 parent e906a36 commit 4d543db
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 26 deletions.
Binary file modified public/fonts/iconfont.ttf
Binary file not shown.
Binary file modified public/fonts/iconfont.woff
Binary file not shown.
Binary file modified public/fonts/iconfont.woff2
Binary file not shown.
21 changes: 11 additions & 10 deletions src/components/footer/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ThemeSwitch } from './ThemeSwitch'
import { siteConfig } from '@/config'
import { getAllPostsWordCount } from '@/utils/content'
import { RunningDays } from './RunningDays'
import { Link } from './Link'
import Link from './Link.astro'
const sinceYear = new Date(siteConfig.startTime).getFullYear()
const thisYear = new Date().getFullYear()
Expand All @@ -24,15 +24,16 @@ const wordCountStr = (wordCount / 1000).toFixed(1) + 'k'
& Designed by
<Link href="https://github.com/lxchapu/astro-gyoza">Gyoza</Link>
</div>
<div>
<span>
&copy;{copyDate}
<Link href="/">{siteConfig.author}</Link>.
</span>
<span class="select-none opacity-50">|</span>
<Link href="/rss.xml">RSS</Link>
<span class="select-none opacity-50">|</span>
<Link href="/sitemap-index.xml">站点地图</Link>
<div class="space-x-1">
<span>&copy;{copyDate} <Link href="/">{siteConfig.author}</Link>.</span>
<Link href="/rss.xml">
<i class="iconfont icon-rss"></i>
<span>RSS</span>
</Link>
<Link href="/sitemap-index.xml">
<i class="iconfont icon-map"></i>
<span>站点地图</span>
</Link>
</div>
<div>
<RunningDays client:only="react" />
Expand Down
16 changes: 16 additions & 0 deletions src/components/footer/Link.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
interface Props {
href: string
}
const { href } = Astro.props
const isExternal = href.startsWith('http')
---

<a
class="hover:text-accent/80"
href={href}
target={isExternal ? '_blank' : undefined}
rel={isExternal ? 'noopener noreferrer' : undefined}><slot /></a
>
13 changes: 0 additions & 13 deletions src/components/footer/Link.tsx

This file was deleted.

10 changes: 7 additions & 3 deletions src/styles/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@font-face {
font-family: 'iconfont'; /* Project id 4528205 */
src:
url('/fonts/iconfont.woff2?t=1714303009639') format('woff2'),
url('/fonts/iconfont.woff?t=1714303009639') format('woff'),
url('/fonts/iconfont.ttf?t=1714303009639') format('truetype');
url('/fonts/iconfont.woff2?t=1714373993383') format('woff2'),
url('/fonts/iconfont.woff?t=1714373993383') format('woff'),
url('/fonts/iconfont.ttf?t=1714373993383') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-map:before {
content: '\e7fa';
}

.icon-more:before {
content: '\e877';
}
Expand Down

0 comments on commit 4d543db

Please sign in to comment.