Skip to content

Commit

Permalink
Merge pull request #2 from zhonganeng/zhanzhu
Browse files Browse the repository at this point in the history
feat:新增右下角赞助位
  • Loading branch information
nihaojob authored Jun 28, 2024
2 parents 7f61414 + 2869653 commit 604aa0e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
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.

0 comments on commit 604aa0e

Please sign in to comment.