Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(AsideLogo): use Iconify icons and support light/dark modes. #194

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/.vitepress/data/AsideData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,56 @@ import type { AsideItem } from '@theojs/lumen'
export const Aside_Data: AsideItem[] = [
{
link: 'https://qytcc01.qingyunti.pro/register?aff=jjgD79Jd',
icon: 'https://www.qingyunti.cc/images/qytlogo-144-49.png',
image: 'https://www.qingyunti.cc/images/qytlogo-144-49.png',
activity: '青云梯 四周年双旦特惠',
info1: '月付 85折 优惠码 <span style="color: var(--vp-c-brand-3)"> qyt85 </span>',
info2: '年付以上 8折 优惠码 <span style="color: var(--vp-c-brand-3)"> qyt80 </span>'
},
{
link: 'https://fbinv02.fbaff.cc/auth/register?code=RZP3',
icon: 'https://i.theojs.cn/docs/202409111237242.png',
image: 'https://i.theojs.cn/docs/202409111237242.png',
activity: 'FlyingBird 双旦活动开启',
info1: '月付 85折 优惠码 <span style="color: var(--vp-c-brand-3)"> 122485 </span>',
info2: '年付 64折 优惠码 <span style="color: var(--vp-c-brand-3)"> 122480 </span>'
},
// {
// link: 'https://feitu.im/index.html?register=2cFF8mg4',
// icon: 'https://飞兔.com/img/logo.png',
// image: 'https://飞兔.com/img/logo.png',
// activity: '飞兔云 双11 狂欢来袭!',
// info1:
// '全场<span style="color: var(--vp-c-brand-3)"> 88 </span>折!全场<span style="color: var(--vp-c-brand-3)"> 88 </span>折!',
// info2: '优惠码 <span style="color: var(--vp-c-brand-3)"> 1111@88 </span>全场打折'
// },
{
link: 'https://github.com/sponsors/Theo-Messi',
icon: 'https://doc.theojs.cn/爱心.png',
icon: 'twemoji:red-heart',
name: '赞助我的项目'
},
{
link: 'https://doc.theojs.cn/',
icon: 'https://i.theojs.cn/avatar.png',
image: 'https://i.theojs.cn/avatar.png',
name: 'Theo-Docs',
hide1: '流媒体观影',
hide2: '一站式服务'
},
{
link: 'https://xx.theojs.cn/',
icon: 'https://i.theojs.cn/avatar.png',
image: 'https://i.theojs.cn/avatar.png',
name: '玄学宝典',
hide1: '传世经典著作',
hide2: '山医命相卜'
},
{
link: 'https://doc.theojs.cn/serve/sharing/Account-sharing-guide',
icon: 'https://cdn.iconscout.com/icon/free/png-256/free-netflix-2296042-1912001.png',
icon: { light: 'simple-icons:netflix', dark: 'simple-icons:youtube' },
color: { light: '#E50914', dark: '#FF0000' },
name: '流媒体帐号合租',
hide1: '流媒体账号合租',
hide2: '共享车位'
},
{
link: 'https://github.com/Theo-Messi/dotfiles',
icon: 'https://img.icons8.com/?size=400&id=nuPce-GYYZeC&format=png&color=000000',
icon: 'eos-icons:configuration-file',
name: '常用配置 - dotfiles',
hide1: 'zshrc、系统优化一键脚本',
hide2: 'Clash/Loon/QX... 配置'
Expand Down
47 changes: 30 additions & 17 deletions docs/guide/docasidelogo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,41 @@ title: 侧边栏链接

## 创建数据

在`.vitepress`目录下新建`data/AsideData.ts`文件,并添加以下内容:
`.vitepress` 目录下新建 `data/AsideData.ts` 文件,并添加以下内容:

```ts [.vitepress/data/AsideData.ts]
import type { AsideItem } from '@theojs/lumen'

export const Aside_Data: AsideItem[] = [
{
link: 'https://example.com/',
icon: 'https://example.com/icon.png',
image: 'https://example.com/icon.png',
activity: '活动标题',
info1: '简介1',
info2: '简介2' // info1/2 支持 `v-html`语法
info2: '简介2'
},
{
link: 'https://example.com/',
icon: 'https://example.com/icon.png',
image: 'https://example.com/icon.png',
name: '标题',
hide1: '隐藏信息1',
hide2: '隐藏信息2' // hide1/2 支持 `v-html`语法
hide2: '隐藏信息2'
},
{
link: 'https://example.com/',
icon: 'https://example.com/icon.png',
name: '为我赞助'
icon: 'twemoji:red-heart',
name: '使用iconify图标'
},
{
link: 'https://example.com/',
icon: { light: 'simple-icons:netflix', dark: 'simple-icons:youtube' },
color: { light: '#E50914', dark: '#FF0000' },
name: 'iconify图标的 light/dark 模式'
},
{
link: 'https://xx.theojs.cn/',
image: { light: 'https://i.theojs.cn/logo/github.svg', dark: 'https://i.theojs.cn/logo/github-dark.svg' },
name: '图片的 light/dark 模式'
}
]
```
Expand All @@ -54,13 +65,15 @@ export default {

## 数据接口说明

| 字段 | 类型 | 描述 |
| :--------: | :------: | ------------------------------------------ |
| `link` | `string` | 链接地址 |
| `icon` | `string` | 图标地址 |
| `name` | `string` | <Badge type="tip" text="可选" /> 名称 |
| `activity` | `string` | <Badge type="tip" text="可选" /> 活动名称 |
| `hide1` | `string` | <Badge type="tip" text="可选" /> 隐藏信息1 |
| `info1` | `string` | <Badge type="tip" text="可选" /> 信息1 |
| `hide2` | `string` | <Badge type="tip" text="可选" /> 隐藏信息2 |
| `info2` | `string` | <Badge type="tip" text="可选" /> 信息2 |
| 字段 | 类型 | 描述 |
| :--------: | :-------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `link` | `string` | 链接地址 |
| `color` | `string` \| `{ light: string; dark: string }` | 图标的颜色,可为单一颜色字符串,也可以是包含 `light` 和 `dark` 属性的对象 |
| `icon` | `string` \| `{ light: string; dark: string }` | 图标名称,支持 <Pill name="iconify 图标" link="https://icon-sets.iconify.design/" icon="line-md:iconify2-static" color="#1769AA" /> 可为单一图标名称或包含 `light` 和 `dark` 模式的对象 |
| `image` | `string` \| `{ light: string; dark: string }` | 图片地址或包含 `light` 和 `dark` 模式的对象 |
| `name` | `string` | <Badge type="tip" text="可选" /> 名称 |
| `activity` | `string` | <Badge type="tip" text="可选" /> 活动名称 |
| `hide1` | `string` | <Badge type="tip" text="可选" /> 隐藏信息1 |
| `info1` | `string` | <Badge type="tip" text="可选" /> 信息1 |
| `hide2` | `string` | <Badge type="tip" text="可选" /> 隐藏信息2 |
| `info2` | `string` | <Badge type="tip" text="可选" /> 信息2 |
Loading
Loading