blog/src/components/Footer.astro
radishzzz 2ddae5631e feat: add github repository card extension feature
- remove astro-compress to improve build speed
- add target and rel attributes to footer links
- rename unocss opacity utility from 'opacity' to 'op'
- update PostList component's page logic from 'isTag' to 'isHome'
- create extend.css file for markdown extended features
- reorganize and sort styles in heti.css
- fix inline code wrapping issue
2025-05-02 18:06:59 +01:00

48 lines
1.3 KiB
Text

---
import { defaultLocale, themeConfig } from '@/config'
import { getLangFromPath } from '@/i18n/lang'
const { author } = themeConfig.site
const { links: socialLinks, startYear } = themeConfig.footer
const currentYear = new Date().getFullYear()
const year = Number(startYear) === currentYear
? startYear
: `${startYear}-${currentYear}`
// i18n RSS Path
const currentLang = getLangFromPath(Astro.url.pathname)
const links = socialLinks.map((link) => {
if (link.name === 'RSS') {
return {
...link,
url: currentLang === defaultLocale ? link.url : `/${currentLang}${link.url}`,
}
}
return link
})
---
<footer
class="text-3 leading-4.75 font-navbar lg:text-3.5"
lg="uno-desktop-column bottom-20"
>
<p>
{links.map((link, index) => (
<>
<a class="transition-colors hover:c-primary" href={link.url} target="_blank" rel="noopener noreferrer">
{link.name}
</a>
{index < links.length - 1 && ' / '}
</>
))}
</p>
<p>
Powered by <a class="transition-colors hover:c-primary" href="https://astro.build/" target="_blank" rel="noopener noreferrer">Astro</a> and <a class="transition-colors hover:c-primary" href="https://github.com/radishzzz/astro-theme-retypeset" target="_blank" rel="noopener noreferrer">Retypeset</a>
</p>
<p>
© {year} {author}
</p>
</footer>