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:新增右下角赞助位 #2

Merged
merged 1 commit into from
Jun 28, 2024
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
72 changes: 72 additions & 0 deletions .vitepress/theme/Sponsor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!--.vitepress/theme/Sponsor.vue-->
<script setup>
import DefaultTheme from 'vitepress/theme'

const { Layout } = DefaultTheme
</script>

<template>
<Layout>
<template #aside-bottom>
<a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=nengneng.CVCode" class="vscodePlug">
<img src="/public/vscode-logo.png" alt="">
<div>
<p class="title">
VSCode 插件推荐
</p>
<p class="describe">
轻松管理代码片段
</p>
</div>
<span class="identification">赞助</span>
</a>
</template>
</Layout>
</template>

<style>
.vscodePlug{
padding: 20px 5px;
position: relative;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
text-decoration: none;
background-color: #f4f8fa;
border-radius: 12px;
}
.vscodePlug .identification{
position: absolute;
bottom: 5px;
left: 5px;
font-size: 11px;
line-height: 11px;
color: #a6b7bf;
}
.vscodePlug img{
width: 40px;
}
.vscodePlug div{
margin-left: 10px;
}
.vscodePlug div p{
margin: 0;
line-height: 1rem;
text-align: center;
font-weight: bold;
text-wrap: nowrap;
}
.vscodePlug div p.title{
color: #000;
font-size: 14px;
}
.vscodePlug div p.describe{
margin-top: 6px;
font-size: 16px;
color: #028fd6;
}
.vscodePlug:hover .describe{
text-decoration: underline;
}
</style>
9 changes: 9 additions & 0 deletions .vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// .vitepress/theme/index.js
import DefaultTheme from 'vitepress/theme'
import Sponsor from './Sponsor.vue'

export default {
extends: DefaultTheme,
// 使用注入插槽的包装组件覆盖 Layout
Layout: Sponsor
}
Binary file added public/vscode-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.