Skip to content

Commit 223558f

Browse files
committed
chore: ads
1 parent 9e18c40 commit 223558f

File tree

3 files changed

+22
-34
lines changed

3 files changed

+22
-34
lines changed

.vitepress/theme/components/ArticleShare.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, computed } from "vue"
2+
import { ref, computed, onMounted } from "vue"
33
44
const props = defineProps({
55
shareText: {
@@ -77,6 +77,13 @@ const copiedIconSvg = `
7777
<path d="M20 6 9 17l-5-5"></path>
7878
</svg>
7979
`
80+
81+
onMounted(() => {
82+
const script = document.createElement('script')
83+
script.src = 'https://cdn.wwads.cn/js/makemoney.js'
84+
script.async = true
85+
document.head.appendChild(script)
86+
})
8087
</script>
8188

8289
<template>
@@ -97,6 +104,7 @@ const copiedIconSvg = `
97104
</div>
98105
</button>
99106
</div>
107+
<div class="wwads-cn wwads-vertical sponsors" data-id="380" style="max-width:180px"></div>
100108
</template>
101109

102110
<style scoped>
@@ -169,4 +177,17 @@ const copiedIconSvg = `
169177
align-items: center;
170178
margin-right: 6px;
171179
}
180+
181+
.sponsors {
182+
max-width: 100%;
183+
margin: 0 !important;
184+
background-color: transparent !important;
185+
}
186+
187+
.sponsors .wwads-text {
188+
color: var(--vp-c-text-1) !important;
189+
transition-property: color;
190+
transition-duration: 500ms;
191+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
192+
}
172193
</style>

.vitepress/theme/components/Sponsors.vue

Lines changed: 0 additions & 31 deletions
This file was deleted.

.vitepress/theme/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import DefaultTheme from 'vitepress/theme'
44
import './styles/style.css'
55
import './styles/custom-block.css'
66
import './styles/font.css'
7-
import Sponsors from './components/Sponsors.vue'
87
import ArticleShare from "./components/ArticleShare.vue";
98
import NotFound from './components/NotFound.vue'
109

@@ -15,7 +14,6 @@ export default {
1514
return h(DefaultTheme.Layout, null, {
1615
// https://vitepress.dev/guide/extending-default-theme#layout-slots
1716
"aside-outline-after": () => h(ArticleShare),
18-
"aside-ads-after": () => h(Sponsors),
1917
"not-found": () => h(NotFound),
2018
})
2119
}

0 commit comments

Comments
 (0)