Skip to content

Commit d41c7db

Browse files
committed
update site
1 parent 782eebc commit d41c7db

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed

site/components/layout.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import sortBy from 'lodash/sortBy';
1010
import { isZhCN } from '../util';
1111
import { Provider, create } from '../../components/_util/store';
1212
import NProgress from 'nprogress';
13-
import MobileMenu from '../../components/vc-drawer/src';
13+
import MobileMenu from '../../components/vc-drawer/src';
1414
1515
const docsList = [
1616
{ key: 'introduce', enTitle: 'Ant Design of Vue', title: 'Ant Design of Vue' },
@@ -155,6 +155,15 @@ export default {
155155
mountedCallback () {
156156
NProgress.done();
157157
document.documentElement.scrollTop = 0;
158+
try {
159+
document.getElementById('ad').innerHTML = '';
160+
const src = '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio';
161+
const hm = document.createElement('script');
162+
hm.src = src;
163+
hm.id = '_carbonads_js';
164+
const s = document.getElementById('ad');
165+
s.append(hm);
166+
} catch (error) {}
158167
},
159168
},
160169
@@ -224,7 +233,7 @@ export default {
224233
}
225234
const config = AllDemo[titleMap[reName]];
226235
this.resetDocumentTitle(config, reName, isCN);
227-
const { showSideBars, isMobile } = this;
236+
const { isMobile } = this;
228237
return (
229238
<div class='page-wrapper'>
230239
<Header searchData={searchData} name={name}/>

site/index.html

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,43 @@
1616
display: none;
1717
}
1818
</style>
19+
<style>
20+
#ad {
21+
width: 145px;
22+
position: fixed;
23+
bottom: 10px;
24+
right: 10px;
25+
padding: 10px;
26+
background-color: #fff;
27+
border-radius: 3px;
28+
font-size: 13px;
29+
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
30+
}
31+
#ad a {
32+
display: inline-block;
33+
color: #7f8c8d;
34+
font-weight: normal;
35+
}
36+
#ad span {
37+
color: #7f8c8d;
38+
display: inline-block;
39+
margin-bottom: 5px;
40+
}
41+
#ad img {
42+
width: 125px;
43+
}
44+
#ad .carbon-img,
45+
#ad .carbon-text {
46+
display: block;
47+
margin-bottom: 6px;
48+
font-weight: normal;
49+
color: #34495e;
50+
}
51+
#ad .carbon-poweredby {
52+
color: #aaa;
53+
font-weight: normal;
54+
}
55+
</style>
1956
<script>
2057
var _hmt = _hmt || [];
2158
var isGithub = location.host.indexOf('github') !== -1;
@@ -27,12 +64,16 @@
2764
s.parentNode.insertBefore(hm, s);
2865
})()
2966
</script>
67+
3068
</head>
3169

3270
<body>
3371
<div id="app">
3472
<router-view></router-view>
3573
</div>
74+
<div id="ad">
75+
<!-- <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio" id="_carbonads_js"></script> -->
76+
</div>
3677
<script>
3778
// var SeedAndDewConfig = {};
3879
// (function() {
@@ -52,4 +93,4 @@
5293
</script>
5394
</body>
5495

55-
</html>
96+
</html>

site/index.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,13 @@
171171
text-align: center;
172172
}
173173
}
174+
.toc-affix {
175+
width: 120px;
176+
position: fixed;
177+
top: 100px;
178+
right: 10px;
179+
bottom: 250px;
180+
}
181+
.toc-affix .ant-anchor-wrapper {
182+
max-height: calc(~'100vh - 350px') !important;
183+
}

0 commit comments

Comments
 (0)