|
| 1 | +--- |
| 2 | +import CounterAnalytics from '@/components/analytics/CounterAnalytics.astro' |
| 3 | +import GoogleAnalytics from '@/components/analytics/GoogleAnalytics.astro' |
| 4 | +import Swetrix from '@/components/analytics/Swetrix.astro' |
| 5 | +import Icon from '@/components/Icon.astro' |
| 6 | +import siteConfig from '@/configs/site' |
| 7 | +import { getPluginConfig, isPluginEnabled } from '@/utils/plugin' |
| 8 | +
|
| 9 | +const { author } = siteConfig |
| 10 | +const { name, nickname, email, homepage, github, twitter, telegram, reddit } = |
| 11 | + author |
| 12 | +const socialNetworks: Record<string, string> = { |
| 13 | + github, |
| 14 | + twitter, |
| 15 | + telegram, |
| 16 | + reddit, |
| 17 | +} |
| 18 | +--- |
| 19 | + |
| 20 | +<footer class="my-9 text-primary"> |
| 21 | + <div class="flex justify-center items-center mb-3"> |
| 22 | + <a href={`mailto:${email}`} class="footer-icon"> |
| 23 | + <Icon name={'bi:envelope-fill'} size={32} /> |
| 24 | + </a> |
| 25 | + { |
| 26 | + Object.keys(socialNetworks).map((network: string) => ( |
| 27 | + <a href={socialNetworks[network]} class="footer-icon"> |
| 28 | + <Icon name={`bi:${network}`} size={32} /> |
| 29 | + </a> |
| 30 | + )) |
| 31 | + } |
| 32 | + </div> |
| 33 | + <div class="flex justify-center items-center"> |
| 34 | + Built with |
| 35 | + <span class="px-2"> |
| 36 | + <Icon name="bi:suit-heart-fill" /> |
| 37 | + </span> |
| 38 | + by |
| 39 | + <span class="px-2"> |
| 40 | + <a href={homepage}>{nickname} ({name})</a>. |
| 41 | + </span> |
| 42 | + </div> |
| 43 | +</footer> |
| 44 | +{ |
| 45 | + isPluginEnabled('googleAnalytics') ? ( |
| 46 | + <GoogleAnalytics {...getPluginConfig('googleAnalytics')} /> |
| 47 | + ) : ( |
| 48 | + '' |
| 49 | + ) |
| 50 | +} |
| 51 | +{isPluginEnabled('swetrix') ? <Swetrix {...getPluginConfig('swetrix')} /> : ''} |
| 52 | +{ |
| 53 | + isPluginEnabled('counterAnalytics') ? ( |
| 54 | + <CounterAnalytics {...getPluginConfig('counterAnalytics')} /> |
| 55 | + ) : ( |
| 56 | + '' |
| 57 | + ) |
| 58 | +} |
| 59 | + |
| 60 | +<style> |
| 61 | + a.footer-icon { |
| 62 | + @apply text-primary hover:text-secondary mx-1; |
| 63 | + } |
| 64 | +</style> |
0 commit comments