File tree Expand file tree Collapse file tree 2 files changed +2120
-2497
lines changed
Expand file tree Collapse file tree 2 files changed +2120
-2497
lines changed Original file line number Diff line number Diff line change 11const { path, _ } = require ( '@micro-app/shared-utils' ) ;
22
3+ // fixed chinese path...
4+ const blogPluginUtil = require ( '@vuepress/plugin-blog/lib/node/util.js' ) ;
5+ const oldCurryFrontmatterHandler = blogPluginUtil . curryFrontmatterHandler ;
6+ const FIXED_PATH = Symbol ( 'FIXED_PATH' ) ;
7+ blogPluginUtil . curryFrontmatterHandler = ( scope , map , _path ) => {
8+ const fn = oldCurryFrontmatterHandler ( scope , map , _path )
9+ return ( key , pageKey ) => {
10+ const r = fn ( key , pageKey ) ;
11+ if ( key ) {
12+ if ( map [ key ] && map [ key ] . path && ! map [ key ] [ FIXED_PATH ] ) {
13+ // map[key].path = `${path}${key}/`;
14+ map [ key ] . path = encodeURI ( `${ _path } ${ key } /` ) ; // fixed path
15+ map [ key ] [ FIXED_PATH ] = true ;
16+ }
17+ }
18+ return r ;
19+ } ;
20+ } ;
21+
322// 初始化默认值
423const initBlogConfig = require ( './init' ) ;
524
You can’t perform that action at this time.
0 commit comments