@@ -12,183 +12,19 @@ module.exports = ctx => ({
1212 description : 'NumPy is the fundamental package for scientific computing with Python.'
1313 }
1414 } ,
15- head : [
16- [ 'link' , {
17- rel : 'dns-prefetch' ,
18- href : `//cdn.bootcss.com`
19- } ] ,
20- [ 'link' , {
21- rel : 'dns-prefetch' ,
22- href : `//cdn.mathjax.org`
23- } ] ,
24- // 使主题能够支持数学公式
25- [ 'script' , {
26- type : 'text/x-mathjax-config'
27- } , `
28- MathJax.Hub.Config({
29- showProcessingMessages: false, //关闭js加载过程信息
30- messageStyle: "none", //不显示信息
31- tex2jax: {
32- "inlineMath": [["$", "$"], ["\\\\(", "\\\\)"]],
33- "processEscapes": true,
34- "ignoreClass": "document",
35- skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'a', 'td'],
36- "processClass": "math|output_area"
37- },
38- "HTML-CSS": {
39- showMathMenu: false
40- }
41- })
42- ` ] ,
43- [ 'script' , {
44- src : '//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
45- } ] ,
46- // 监听路由重新渲染数学公式
47- [ 'script' , { } , `
48- (function() {
49- var url1 = window.location.href;
50- var url2 = window.location.href;
51- setInterval(function() {
52- if (url1 === url2) {
53- url2 = window.location.href;
54- } else {
55- url1 = url2;
56- if (window.MathJax) window.MathJax.Hub.Typeset();
57- }
58- }, 200);
59- })();
60- ` ] ,
61- [ 'link' , {
62- rel : 'icon' ,
63- href : `/logo.png`
64- } ] ,
65- [ 'link' , {
66- rel : 'manifest' ,
67- href : '/manifest.json'
68- } ] ,
69- [ 'meta' , {
70- name : 'theme-color' ,
71- content : '#3eaf7c'
72- } ] ,
73- [ 'meta' , {
74- name : 'apple-mobile-web-app-capable' ,
75- content : 'yes'
76- } ] ,
77- [ 'meta' , {
78- name : 'apple-mobile-web-app-status-bar-style' ,
79- content : 'black'
80- } ] ,
81- [ 'link' , {
82- rel : 'apple-touch-icon' ,
83- href : `/icons/apple-touch-icon-152x152.png`
84- } ] ,
85- [ 'link' , {
86- rel : 'mask-icon' ,
87- href : '/icons/safari-pinned-tab.svg' ,
88- color : '#3eaf7c'
89- } ] ,
90- [ 'meta' , {
91- name : 'msapplication-TileImage' ,
92- content : '/icons/msapplication-icon-144x144.png'
93- } ] ,
94- [ 'meta' , {
95- name : 'msapplication-TileColor' ,
96- content : '#000000'
97- } ] ,
98- // 百度统计
99- [ 'script' , { } , `
100- (function() {
101- var onDocumentComplete = function() {
102- if (document.readyState =='complete') {
103- var hm = document.createElement("script");
104- hm.src = "https://hm.baidu.com/hm.js?a809b6f7e6517af8c15c6076273e80fe";
105- var s = document.getElementsByTagName("script")[0];
106- s.parentNode.insertBefore(hm, s);
107- }
108- }
109- document.onreadystatechange = onDocumentComplete; //当页面加载状态改变的时候执行这个方法.
110- })();
111- ` ] ,
112- ] ,
15+ head : require ( './configs/head' ) ,
11316 theme : 'teadocs' ,
114- themeConfig : {
115- logo : {
116- text : 'NumPy' ,
117- subText : '中文网' ,
118- image : '/logo.svg'
119- } ,
120- alert : [ {
121- id : '2019-7-29' ,
122- title : '文档公告' ,
123- content : `我们经常发布文档更新,部分页面的翻译可能仍在进行中。有关最新信息,请访问<a href="/en/">英文文档</a>。如果某个页面上的翻译有问题,请提issues<a href="https://github.com/teadocs/numpy-cn/issues" target="_blank">告诉我们</a>。`
124- } ] ,
125- repo : 'teadocs/numpy-cn' ,
126- editLinks : true ,
127- docsDir : 'docs' ,
128- locales : {
129- '/' : {
130- label : '简体中文' ,
131- selectText : '选择语言' ,
132- editLinkText : '在 GitHub 上编辑此页' ,
133- lastUpdated : '上次更新' ,
134- nav : require ( './nav/zh' ) ,
135- sidebar : {
136- '/user/' : require ( './sidebar/user_zh' ) ( ) ,
137- '/reference/' : require ( './sidebar/reference_zh' ) ( ) ,
138- '/f2py' : require ( './sidebar/f2py_zh' ) ( ) ,
139- '/dev' : require ( './sidebar/dev_zh' ) ( ) ,
140- '/bedocs' : require ( './sidebar/bedocs_zh' ) ( )
141- }
142- } ,
143- '/en/' : {
144- label : 'English' ,
145- selectText : 'Languages' ,
146- editLinkText : 'Edit this page on GitHub' ,
147- lastUpdated : 'Last Updated' ,
148- nav : require ( './nav/en' ) ,
149- sidebar : {
150- '/en/user/' : require ( './sidebar/user_en' ) ( ) ,
151- '/en/reference/' : require ( './sidebar/reference_en' ) ( ) ,
152- '/en/f2py' : require ( './sidebar/f2py_en' ) ( ) ,
153- '/en/dev' : require ( './sidebar/dev_en' ) ( ) ,
154- '/en/bedocs' : require ( './sidebar/bedocs_en' ) ( )
155- }
156- }
157- }
158- } ,
159- plugins : [
160- [ '@vuepress/back-to-top' , true ] ,
161- [ '@vuepress/pwa' , {
162- serviceWorker : true ,
163- updatePopup : {
164- '/' : {
165- message : "发现新内容可用" ,
166- buttonText : "刷新"
167- } ,
168- '/en/' : {
169- message : "New content is available." ,
170- buttonText : "Refresh"
171- }
172- }
173- } ] ,
174- [ '@vuepress/medium-zoom' , true ] ,
175- [ 'container' , {
176- type : 'vue' ,
177- before : '<pre class="vue-container"><code>' ,
178- after : '</code></pre>' ,
179- } ] ,
180- [ 'container' , {
181- type : 'upgrade' ,
182- before : info => `<UpgradePath title="${ info } ">` ,
183- after : '</UpgradePath>' ,
184- } ] ,
185- ] ,
17+ themeConfig : require ( './configs/themeConfig' ) ,
18+ plugins : require ( './configs/plugins' ) ,
18619 extraWatchFiles : [
18720 '.vuepress/nav/en.js' ,
18821 '.vuepress/nav/zh.js' ,
18922 '.vuepress/sidebar/user_en.js' ,
19023 '.vuepress/sidebar/user_zh.js' ,
19124 '.vuepress/sidebar/reference_zh.js' ,
192- '.vuepress/sidebar/reference_zh.js'
25+ '.vuepress/sidebar/reference_zh.js' ,
26+ '.vuepress/configs/head.js' ,
27+ '.vuepress/configs/plugins.js' ,
28+ '.vuepress/configs/themeConfig.js'
19329 ]
194- } )
30+ } ) ;
0 commit comments