blog-footer.tsx 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /**
  2. * 博客底部组件
  3. *
  4. * @author CodeBuddy
  5. * @date 2025-09-18
  6. */
  7. import { Link } from 'react-router-dom'
  8. import { Heart, Github, Mail, Rss } from 'lucide-react'
  9. import { Button } from '@/components/ui/button'
  10. /**
  11. * 博客底部组件
  12. * 包含版权信息、ICP备案号、友情链接等
  13. */
  14. export function BlogFooter() {
  15. const currentYear = new Date().getFullYear()
  16. return (
  17. <footer className="bg-transparent mt-auto">
  18. <div className="container mx-auto px-4 py-8">
  19. {/* 主要内容区域 */}
  20. <div className="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
  21. {/* 网站信息 */}
  22. <div className="space-y-4">
  23. <h3 className="text-lg font-semibold">我的博客</h3>
  24. <p className="text-sm text-muted-foreground">
  25. 分享技术心得,记录成长足迹。专注于前端开发、全栈技术和编程思考。
  26. </p>
  27. <div className="flex space-x-2">
  28. <Button variant="ghost" size="sm" asChild>
  29. <a href="https://github.com" target="_blank" rel="noopener noreferrer">
  30. <Github className="h-4 w-4" />
  31. <span className="sr-only">GitHub</span>
  32. </a>
  33. </Button>
  34. <Button variant="ghost" size="sm" asChild>
  35. <a href="mailto:contact@example.com">
  36. <Mail className="h-4 w-4" />
  37. <span className="sr-only">邮箱</span>
  38. </a>
  39. </Button>
  40. <Button variant="ghost" size="sm" asChild>
  41. <Link to="/rss">
  42. <Rss className="h-4 w-4" />
  43. <span className="sr-only">RSS订阅</span>
  44. </Link>
  45. </Button>
  46. </div>
  47. </div>
  48. {/* 快速导航 */}
  49. <div className="space-y-4">
  50. <h3 className="text-lg font-semibold">快速导航</h3>
  51. <nav className="flex flex-col space-y-2">
  52. <Link
  53. to="/"
  54. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  55. >
  56. 首页
  57. </Link>
  58. <Link
  59. to="/categories"
  60. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  61. >
  62. 分类
  63. </Link>
  64. <Link
  65. to="/tags"
  66. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  67. >
  68. 标签
  69. </Link>
  70. <Link
  71. to="/archive"
  72. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  73. >
  74. 归档
  75. </Link>
  76. <Link
  77. to="/about"
  78. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  79. >
  80. 关于
  81. </Link>
  82. </nav>
  83. </div>
  84. {/* 技术栈 */}
  85. <div className="space-y-4">
  86. <h3 className="text-lg font-semibold">技术栈</h3>
  87. <div className="flex flex-col space-y-2 text-sm text-muted-foreground">
  88. <span>React 19</span>
  89. <span>TypeScript</span>
  90. <span>Tailwind CSS</span>
  91. <span>Vite</span>
  92. <span>shadcn/ui</span>
  93. </div>
  94. </div>
  95. {/* 友情链接 */}
  96. <div className="space-y-4">
  97. <h3 className="text-lg font-semibold">友情链接</h3>
  98. <nav className="flex flex-col space-y-2">
  99. <a
  100. href="https://react.dev"
  101. target="_blank"
  102. rel="noopener noreferrer"
  103. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  104. >
  105. React 官网
  106. </a>
  107. <a
  108. href="https://www.typescriptlang.org"
  109. target="_blank"
  110. rel="noopener noreferrer"
  111. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  112. >
  113. TypeScript
  114. </a>
  115. <a
  116. href="https://tailwindcss.com"
  117. target="_blank"
  118. rel="noopener noreferrer"
  119. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  120. >
  121. Tailwind CSS
  122. </a>
  123. <a
  124. href="https://ui.shadcn.com"
  125. target="_blank"
  126. rel="noopener noreferrer"
  127. className="text-sm text-muted-foreground hover:text-foreground transition-colors"
  128. >
  129. shadcn/ui
  130. </a>
  131. </nav>
  132. </div>
  133. </div>
  134. {/* 底部版权和备案信息 */}
  135. <div className="flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0">
  136. {/* 版权信息 */}
  137. <div className="flex items-center space-x-2 text-sm text-muted-foreground">
  138. <span>© {currentYear} 我的博客</span>
  139. <span>•</span>
  140. <span className="flex items-center">
  141. Made with <Heart className="h-3 w-3 mx-1 text-red-500" /> by xxh
  142. </span>
  143. </div>
  144. {/* ICP备案信息 */}
  145. <div className="flex flex-col md:flex-row items-center space-y-2 md:space-y-0 md:space-x-4 text-sm text-muted-foreground">
  146. {/* ICP备案号 */}
  147. <a
  148. href="https://beian.miit.gov.cn"
  149. target="_blank"
  150. rel="noopener noreferrer"
  151. className="hover:text-foreground transition-colors"
  152. >
  153. 桂ICP备2025066931号-1
  154. </a>
  155. {/* 公安备案号 */}
  156. <div className="flex items-center space-x-1">
  157. <img
  158. src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
  159. alt="公安备案"
  160. className="w-3 h-3"
  161. />
  162. <a
  163. href="http://www.beian.gov.cn/portal/registerSystemInfo"
  164. target="_blank"
  165. rel="noopener noreferrer"
  166. className="hover:text-foreground transition-colors"
  167. >
  168. 京公网安备 11010802012345号
  169. </a>
  170. </div>
  171. </div>
  172. </div>
  173. {/* 额外的法律声明 */}
  174. <div className="mt-4 pt-4 text-center">
  175. <p className="text-xs text-muted-foreground">
  176. 本站内容仅供学习交流使用,如有侵权请联系删除 |
  177. <Link to="/privacy" className="hover:text-foreground transition-colors ml-1">
  178. 隐私政策
  179. </Link>
  180. <span className="mx-1">|</span>
  181. <Link to="/terms" className="hover:text-foreground transition-colors">
  182. 使用条款
  183. </Link>
  184. </p>
  185. </div>
  186. </div>
  187. </footer>
  188. )
  189. }