Skip to content

风格徽章

🕒 Published at:

一、Shields

免费的SVG徽章生成器,靠URL传参就能生成各种状态、版本、技术栈小牌子,直接插Markdown就能用 不用装插件、不用写CSS、不用管跨域——复制链接、粘贴到md,部署完直接生效,省心到离谱。

官网:https://shields.io/

二、基础玩法:30秒插一个能用的徽章

1️⃣ 静态徽章(固定文字/颜色,最常用)

格式:![标签](https://img.shields.io/badge/左侧文字-右侧文字-颜色?参数) 举个栗子,直接复制到你的VitePress md里:

markdown
![VitePress](https://img.shields.io/badge/框架-VitePress-646CFF?logo=vite&logoColor=white)
![Node](https://img.shields.io/badge/运行时-Node.js-339933?logo=node.js&logoColor=white)
![License](https://img.shields.io/badge/协议-MIT-blue)

效果: VitePress

Node

License

2️⃣ 动态徽章(自动拉取数据,比如版本、下载量)

不用手动改,自动同步npm/GitHub数据:

markdown
![npm version](https://img.shields.io/npm/v/vitepress)
![npm downloads](https://img.shields.io/npm/dm/vitepress)
![GitHub stars](https://img.shields.io/github/stars/vuejs/vitepress)

效果: npm version

npm downloads

GitHub stars

3️⃣ 可点击徽章(加链接,跳转到对应页面)

套一层Markdown链接语法,点击徽章直接跳转:

markdown
[![VitePress官网](https://img.shields.io/badge/VitePress-官网-646CFF?logo=vite)](https://vitepress.dev)
[![GitHub](https://img.shields.io/badge/GitHub-源码-181717?logo=github)](https://github.com/vuejs/vitepress)

效果: VitePress官网

GitHub

三、进阶骚操作:让徽章颜值拉满

✨ 样式自由切换(style参数)

默认太普通?加?style=,常用这4种:

  • flat(默认,简约)
  • flat-square(方角,干净)
  • plastic(塑料质感,复古)
  • for-the-badge(大字体,醒目)
markdown
![默认](https://img.shields.io/badge/样式-默认-blue)
![flat-square](https://img.shields.io/badge/样式-flat--square-green?style=flat-square)
![for-the-badge](https://img.shields.io/badge/样式-for--the--badge-orange?style=for-the-badge)

效果: 默认

flat-square

for-the-badge

🎨 自定义颜色+Logo(逼格核心)

  • labelColor:左侧背景色
  • color:右侧背景色(支持十六进制,比如#646CFF
  • logo:加技术图标(去Simple Icons查名称)
  • logoColor:图标颜色
markdown
![技术栈](https://img.shields.io/badge/技术栈-Vue3+Vite+TS-41B883?logo=vue.js&logoColor=white&labelColor=35495E)
![部署](https://img.shields.io/badge/部署-Vercel-black?logo=vercel&logoColor=white)

效果: 技术栈

部署

🧩 排版优化(VitePress里更好看)

别堆成一团,用空格/换行分组,清爽不杂乱:

markdown
### 项目信息

![VitePress](https://img.shields.io/badge/框架-VitePress-646CFF?logo=vite)
![Node](https://img.shields.io/badge/Node-18+-339933?logo=node.js)
![License](https://img.shields.io/badge/License-MIT-blue)

### 技术栈

![Vue3](https://img.shields.io/badge/Vue-3-4FC08D?logo=vue.js)
![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript)
![Markdown](https://img.shields.io/badge/Markdown-支持-000000?logo=markdown)

四、VitePress实战:直接复制就能用的模板

放到你的index.md或文档首页顶部,直接出效果:

markdown
---
title: 我的技术博客
---

# 我的VitePress博客 ✨

[![VitePress](https://img.shields.io/badge/基于-VitePress-646CFF?logo=vite&style=flat-square)](https://vitepress.dev)
[![Node](https://img.shields.io/badge/Node-≥18-339933?logo=node.js&style=flat-square)](https://nodejs.org)
[![Vue3](https://img.shields.io/badge/Vue-3-4FC08D?logo=vue.js&style=flat-square)](https://vuejs.org)
[![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript&style=flat-square)](https://www.typescriptlang.org)
[![GitHub](https://img.shields.io/github/stars/你的用户名/你的仓库?style=flat-square&logo=github)](https://github.com/你的用户名/你的仓库)
[![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](https://opensource.org/licenses/MIT)

> 专注前端、后端、架构分享,用代码构建有趣的世界

## 简介

这里是我的个人技术博客,基于VitePress搭建,记录学习、踩坑、实战心得……