File tree Expand file tree Collapse file tree 4 files changed +22
-7
lines changed
templates/default/introduce/api Expand file tree Collapse file tree 4 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function getRdocConf() {
25
25
return conf ;
26
26
}
27
27
28
- function getCinfigFilePath ( fileName , type ) {
28
+ function getConfigFilePath ( fileName , type ) {
29
29
const conf = getRdocConf ( ) ;
30
30
// 这里是读取配置
31
31
if ( conf && conf [ type ] ) {
@@ -55,21 +55,21 @@ function getCinfigFilePath(fileName, type) {
55
55
56
56
// Get favicon path
57
57
const faviconPath = ( ) => {
58
- const _path = getCinfigFilePath ( './favicon.ico' , 'favicon' ) ;
58
+ const _path = getConfigFilePath ( './favicon.ico' , 'favicon' ) ;
59
59
if ( _path ) return _path ;
60
60
return resolveTool ( '../../theme/default/favicon.ico' ) ;
61
61
} ;
62
62
63
63
// Get logo path
64
64
const logoPath = ( ) => {
65
- const _path = getCinfigFilePath ( './logo.svg' , 'logo' ) ;
65
+ const _path = getConfigFilePath ( './logo.svg' , 'logo' ) ;
66
66
if ( _path ) return _path ;
67
67
return false ;
68
68
} ;
69
69
70
70
// Get theme path
71
71
const getThemePath = ( ) => {
72
- const _path = getCinfigFilePath ( './default' , 'theme' ) ;
72
+ const _path = getConfigFilePath ( './default' , 'theme' ) ;
73
73
if ( _path ) return _path ;
74
74
return resolveTool ( '../../theme/default' ) ;
75
75
} ;
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ const UPATH = require('upath');
5
5
const paths = require ( './path' ) ;
6
6
const pkg = require ( '../../package.json' ) ;
7
7
8
+ const define = paths . rdocConf && paths . rdocConf . footer && typeof paths . rdocConf . footer === 'string'
9
+ ? { FOOTER : JSON . stringify ( paths . rdocConf . footer ) } : { } ;
10
+
8
11
module . exports = {
9
12
entry : { } ,
10
13
output : {
@@ -91,6 +94,7 @@ module.exports = {
91
94
new WebpackBar ( { name : pkg . name } ) ,
92
95
new webpack . DefinePlugin ( {
93
96
VERSION : JSON . stringify ( pkg . version ) ,
97
+ ...define ,
94
98
} ) ,
95
99
] ,
96
100
node : {
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ sort: 4
26
26
+ "theme": "rdoc-theme-load-react",
27
27
+ "favicon": "./assets/favicon.ico",
28
28
+ "logo": "./assets/rdoc.logo.svg",
29
+ + "footer": "前端<b>开</b>发"
29
30
+ "react_modules": {
30
31
+ "Hotkeys": "react-hot-keys"
31
32
+ }
@@ -83,3 +84,7 @@ sort: 4
83
84
这个参数是一个特定参数,需求是在制作主题的时候,你的主题需要预览 React 实例,实例还需要加载一些未知的第三方 React 组件,这个时候你需要在你的 Markdown 项目中安装你需要的 React 组件,在配置中指定你的组件,在预览实例中你就可以引用该组件了。
84
85
85
86
> ⚠️注意:还在研究实现方式。
87
+
88
+ ### footer
89
+
90
+ 更改文档网站页脚
Original file line number Diff line number Diff line change @@ -3,12 +3,18 @@ import styles from './index.less';
3
3
4
4
const version = VERSION ; // eslint-disable-line
5
5
6
- const Footer = ( ) => {
6
+ const footer = FOOTER ; // eslint-disable-line
7
+
8
+ const FooterView = ( ) => {
7
9
return (
8
10
< div className = { styles . footer } >
9
- Copyright © 2018 Powered by < a target = "_blank" rel = "noopener noreferrer" href = "https://github.com/jaywcjlove/rdoc" > RDoc { version } </ a > .
11
+ { footer ? < div dangerouslySetInnerHTML = { { __html : footer } } /> : (
12
+ < div >
13
+ Copyright © 2018 Powered by < a target = "_blank" rel = "noopener noreferrer" href = "https://github.com/jaywcjlove/rdoc" > RDoc { version } </ a > .
14
+ </ div >
15
+ ) }
10
16
</ div >
11
17
) ;
12
18
} ;
13
19
14
- export default Footer ;
20
+ export default FooterView ;
You can’t perform that action at this time.
0 commit comments