Skip to content

支持设置并替换网站logo#8

Open
wxt2rr wants to merge 1 commit intoguangzhengli:mainfrom
wxt2rr:site-logo-config
Open

支持设置并替换网站logo#8
wxt2rr wants to merge 1 commit intoguangzhengli:mainfrom
wxt2rr:site-logo-config

Conversation

@wxt2rr
Copy link

@wxt2rr wxt2rr commented Sep 7, 2025

  1. 功能概述
    添加可配置的网站 Logo 支持,允许用户通过配置文件灵活设置网站 Logo,支持多种格式和自定义尺寸。

  2. 用户按需配置 Logo 类型和样式
    在 lib/config.ts 中添加 logo 配置:

logo: {
  type: "img", // 支持三种类型:icon(Lucide图标) | svg(SVG文件) | img(图片文件)
  icon: "SquareTerminal", // 当 type 为 "icon" 时使用的 Lucide 图标名称
  svg: "/logo.svg", // 当 type 为 "svg" 时使用的 SVG 文件路径
  img: "/favicon.png", // 当 type 为 "img" 时使用的图片文件路径
  alt: "wangxiaotao's blog", // 图片的 alt 文本
  width: 40, // logo 宽度(像素)
  height: 40, // logo 高度(像素)
},

用户可以根据需求选择不同的 Logo 类型:

  • 设置 type: "icon" 使用 Lucide 图标库中的图标
  • 设置 type: "svg" 使用自定义 SVG 文件
  • 设置 type: "img" 使用图片文件(PNG、JPG 等)

3.修改的文件:
src/lib/config.ts - 添加了 logo 配置
src/components/header/index.tsx - 更新使用新的 Logo 组件
src/components/logo.tsx - 新创建的 Logo 组件

@vercel
Copy link

vercel bot commented Sep 7, 2025

Someone is attempting to deploy a commit to the guangzhengli's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant