Skip to content

Commit 43b54c3

Browse files
committed
fix: 静态文件资源存储位置调整
1 parent 4dc8768 commit 43b54c3

File tree

4 files changed

+49
-21
lines changed

4 files changed

+49
-21
lines changed

Contribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
## 文档如何在本地跑起来?
2626

27-
Pandas 中文文档的最新版本使用的是 [VuePress](https://v1.vuepress.vuejs.org/zh/) 文档生成工具来驱动的。
27+
本中文文档的最新版本使用的是 [VuePress](https://v1.vuepress.vuejs.org/zh/) 文档生成工具来驱动的。
2828

2929
由于 [VuePress](https://v1.vuepress.vuejs.org/zh/) 是基于 [Nodejs](https://zh.wikipedia.org/wiki/Node.js) 编写的工具,如果你想让文档在本地运行调试,你首先需要安装 [Nodejs](http://nodejs.cn/) 在你的电脑上,非Windows操作系统推荐使用 [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) 来安装 [Nodejs](http://nodejs.cn/) ,Windows操作系统的小伙伴可以直接下载最新版本的 Nodejs 的 [Windows 安装包](http://nodejs.cn/download/)
3030

docs/.vuepress/components/ahome-wxpub.vue renamed to docs/.vuepress/components/ahome-article.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
</template>
1616

1717
<script>
18+
const staticDomain = 'https://static.numpy.org.cn/';
19+
1820
export default {
1921
data() {
2022
return {
@@ -25,17 +27,17 @@ export default {
2527
url: "https://www.paddlepaddle.org.cn/modelbase?from=numpy-cn"
2628
},
2729
{
28-
poster: "https://static.numpy.org.cn/home/article_poster_02.jpg@w300h300",
30+
poster: staticDomain + "home/article_poster_02.jpg@w300h300",
2931
title: "可能是最通俗易懂的Python入门资料整理和最优学习路线推荐。",
3032
url: "https://mp.weixin.qq.com/s/QUUYEimknwt5v3RUxIf8kQ"
3133
},
3234
{
33-
poster: "https://static.numpy.org.cn/home/article_poster_02.jpg@w300h300",
35+
poster: staticDomain + "home/article_poster_03.jpg@w300h300",
3436
title: "几百个不同领域的数据集分享给你,别让巧妇难为无米之炊。",
3537
url: "https://mp.weixin.qq.com/s/lVKa2j2yXbjpjom4GD5Btw"
3638
},
3739
{
38-
poster: "https://static.numpy.org.cn/home/article_poster_04.jpg@w300h300",
40+
poster: staticDomain + "home/article_poster_04.jpg@w300h300",
3941
title: "刚刚,我用Python做了个七夕礼物,差点被女朋友打死",
4042
url: "https://mp.weixin.qq.com/s/i2UQOqBr8zGqtgqTaHh3mg"
4143
}

docs/.vuepress/components/ahome-nav.vue

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="ahome-nav">
33
<div class="nav-bar">
4-
<b class="name">我想要</b>
4+
<b class="name">点击我想要</b>
55
<a class="btn-home-nav" :class="{'active': navId === 1}" @click="navId=1">关注公众号</a>
66
<a class="btn-home-nav" :class="{'active': navId === 2}" @click="navId=2">加入群聊</a>
77
<a class="btn-home-nav" :class="{'active': navId === 3}" @click="navId=3">贡献翻译</a>
@@ -16,7 +16,7 @@
1616
<p>掌上中文数据科学社区,关注公众号获取各种Python的奇淫技巧、赚钱技巧,更有机会获得大厂内推。</p>
1717
</div>
1818
<div class="qr-item mpqr-item">
19-
<img src="https://static.numpy.org.cn/qrcode/mp_mydataset.png@qrcode" alt="数量集公众号二维码" />
19+
<img :src="staticDomain + 'qrcode/mp_mydataset.png/qrcode'" alt="DATA中文公众号二维码" />
2020
</div>
2121
</div>
2222

@@ -25,35 +25,35 @@
2525
<div class>
2626
<p>
2727
欢迎加入
28-
<b>NumPy 中文社区</b> 群聊,群内有BAT公司大牛、常春藤校友、中国顶尖高校的各类学霸,以及众多大佬!
28+
<b>{{name}} 中文社区</b> 群聊,群内有BAT公司大牛、常春藤校友、中国顶尖高校的各类学霸,以及众多大佬!
2929
</p>
3030
</div>
3131
<div class="qr-item">
3232
<img
33-
src="https://static.numpy.org.cn/qrcode/wx_master.jpg@qrcode"
33+
:src="staticDomain + 'qrcode/wx_master.jpg@qrcode'"
3434
alt="站长微信二维码"
3535
/>
36-
<span class="text">站长微信(可拉微信群,备注:numpy)</span>
36+
<span class="text">站长微信(可拉微信群,备注:{{name | lowercase}})</span>
3737
</div>
3838
<div class="qr-item">
3939
<img
40-
src="https://static.numpy.org.cn/qrcode/qq_group_numpy.jpg@qrcode"
40+
:src="staticDomain + 'qrcode/qq_group_' + lowercase(name) + '.jpg@qrcode'"
4141
alt="QQ群二维码(群号:294639068)"
4242
/>
43-
<span class="text">QQ群二维码(群号:294639068)</span>
43+
<span class="text">QQ群二维码(群号:{{qqGroupNumber}})</span>
4444
</div>
4545
</div>
4646

4747
<!-- 贡献翻译 -->
4848
<div class="block" :class="{'show': navId === 3}">
4949
<p>
5050
首先感谢
51-
<a href="https://github.com/teadocs/numpy-cn/graphs/contributors" target="_blank">这些小伙伴</a> 对数据科学汉化事业的做出的翻译贡献!🙏
51+
<a :href="'https://github.com/teadocs/' + lowercase(name) + '-cn/graphs/contributors'" target="_blank">这些小伙伴</a> 对数据科学汉化事业的做出的翻译贡献!🙏
5252
</p>
5353
<p>
5454
贡献翻译不需要太多门槛,想参与翻译的小伙伴,可以先查看
5555
<a
56-
href="https://github.com/teadocs/numpy-cn/blob/v1.17/Contribution.md"
56+
:href="'https://github.com/teadocs/' + lowercase(name) + '-cn/blob/' + version + '/Contribution.md'"
5757
target="_blank"
5858
>《本文档翻译贡献指南》</a>。
5959
</p>
@@ -76,7 +76,7 @@
7676
<p>捐赠数额不限,特大数额可以加入网站鸣谢列表或全站推荐。</p>
7777
<div class="qr-item">
7878
<img
79-
src="https://static.numpy.org.cn/qrcode/wechat_payee.jpeg@qrcode"
79+
:src="staticDomain + 'qrcode/wechat_payee.jpeg@qrcode'"
8080
alt="微信付款码"
8181
/>
8282
<span class="text">
@@ -85,7 +85,7 @@
8585
</div>
8686
<div class="qr-item">
8787
<img
88-
src="https://static.numpy.org.cn/qrcode/alipay_payee.jpg@qrcode"
88+
:src="staticDomain + 'qrcode/alipay_payee.jpg@qrcode'"
8989
alt="支付宝付款码"
9090
/>
9191
<span class="text">
@@ -111,21 +111,21 @@
111111
</div>
112112
<div class="qr-item">
113113
<img
114-
src="https://static.numpy.org.cn/qrcode/paddlepaddle_mp.png@qrcode"
114+
:src="staticDomain + 'qrcode/paddlepaddle_mp.png@qrcode'"
115115
alt="paddle微信公众号"
116116
/>
117117
<span class="text">Paddle官方微信公众号</span>
118118
</div>
119119
<div class="qr-item">
120120
<img
121-
src="https://static.numpy.org.cn/qrcode/paddlepaddle_qq_group.jpg@qrcode"
121+
:src="staticDomain + 'qrcode/paddlepaddle_qq_group.jpg@qrcode'"
122122
alt="qq群二维码"
123123
/>
124124
<span class="text">QQ群二维码(群号:796771754)</span>
125125
</div>
126126
<div class="qr-item">
127127
<img
128-
src="https://static.numpy.org.cn/qrcode/paddlepaddle_github.png@qrcode"
128+
:src="staticDomain + 'qrcode/paddlepaddle_github.png@qrcode'"
129129
alt="Paddle的github地址"
130130
/>
131131
<span class="text">Paddle的GitHub地址</span>
@@ -135,11 +135,34 @@
135135
</template>
136136

137137
<script>
138+
// 名称
139+
const name = 'NumPy';
140+
// 静态文件地址
141+
const staticDomain = 'https://static.numpy.org.cn/';
142+
// qq群号码
143+
const qqGroupNumber = '294639068';
144+
// 版本
145+
const version = 'v1.17';
146+
147+
const lowercase = str => str.toLowerCase();
148+
138149
export default {
150+
filters: {
151+
lowercase
152+
},
153+
139154
data() {
140155
return {
141-
navId: 0
156+
navId: 1,
157+
name,
158+
staticDomain,
159+
qqGroupNumber,
160+
version
142161
};
162+
},
163+
164+
methods: {
165+
lowercase
143166
}
144167
};
145168
</script>
@@ -178,7 +201,10 @@ export default {
178201
}
179202
180203
&.donation {
181-
border: 2px solid $accentColor;
204+
background: -webkit-gradient(linear, left top, right top, from(#ffe4b2), to(#c79354));
205+
background: linear-gradient(90deg, #ffe4b2, #c79354);
206+
color: #333333;
207+
border-color: gray;
182208
}
183209
}
184210
}

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ array([[1., 0., 0., 0.],
8383

8484
:::
8585

86-
<ahome-wxpub></ahome-wxpub>
86+
<ahome-article></ahome-article>
8787

8888
<ahome-nav></ahome-nav>
8989

0 commit comments

Comments
 (0)