ele828 / hexo-prism-plugin

Hexo plugin for code highlighting by prism.js, supporting JSX syntax
204 stars 51 forks source link

Maybe you should change it? #4

Closed unicornt closed 7 years ago

unicornt commented 7 years ago
cosnt baseDir = hexo.base_dir
if (hexo.config.root && hexo.config.root !== '/')
  baseDir += hexo.config.root;

it should be change to

var adfaeawefwa = hexo.base_dir
if (hexo.config.root && hexo.config.root !== '/')
  adfaeawefwa += hexo.config.root;
const baseDir = adfaeawefwa;

when i run it,it have error

TypeError: Assignment to constant variable.

unicornt commented 7 years ago

and it still doesn't work...

ele828 commented 7 years ago

Can you help me try to change it like this? And see if it works or not, thank you!

let baseDir = hexo.base_dir;
unicornt commented 7 years ago

like this?

let baseDir = hexo.base_dir;
const pluginDir = path.join(
    baseDir, 'node_modules', 'hexo-prism-plugin');
const themeDir = path.join(pluginDir, 'themes');
const libUri = path.join(pluginDir, 'prism.js');
// Process sub-directory
if (hexo.config.root && hexo.config.root !== '/')
  baseDir += hexo.config.root;
ele828 commented 7 years ago

Yes

ele828 commented 7 years ago

If it works, please let me know, I'll update the codebase. If it still doesn't work, I'll try to figure it out.

unicornt commented 7 years ago

there're no error. but still doesn't work

ele828 commented 7 years ago

Fixed it. And I test it on my local machine, hope it works for you!

unicornt commented 7 years ago

yes,it really works. thank you