Halyul / hexo-theme-mdui

GNU General Public License v3.0
185 stars 35 forks source link

代码高亮模块工作不正常~~ #63

Closed yihuishou closed 7 years ago

yihuishou commented 7 years ago

使用 npm install prismjs --save 后 程序依旧无法找到prismjs

yihuishou commented 7 years ago

错误信息如下: ERROR Script load failed: themes\mdui\scripts\lib\prism\prism.js TypeError: Cannot set property 'keyword' of undefined at Object.extend (e:\Hexo\node_modules\prismjs\components\prism-core.js:74:15) at Object. (e:\Hexo\node_modules\prismjs\components\prism-arduino.js:1:105) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (e:\Hexo\node_modules\hexo\lib\hexo\index.js:216:21) at componentsSet.forEach (e:\Hexo\themes\mdui\scripts\lib\prism\prism.js:30:27) at Array.forEach (native) at e:\Hexo\themes\mdui\scripts\lib\prism\prism.js:30:4 at e:\Hexo\node_modules\hexo\lib\hexo\index.js:232:12 at tryCatcher (e:\Hexo\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (e:\Hexo\node_modules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (e:\Hexo\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromise0 (e:\Hexo\node_modules\bluebird\js\release\promise.js:614:10) at Promise._settlePromises (e:\Hexo\node_modules\bluebird\js\release\promise.js:693:18) at Promise._fulfill (e:\Hexo\node_modules\bluebird\js\release\promise.js:638:18) at Promise._resolveCallback (e:\Hexo\node_modules\bluebird\js\release\promise.js:432:57) at Promise._settlePromiseFromHandler (e:\Hexo\node_modules\bluebird\js\release\promise.js:524:17) at Promise._settlePromise (e:\Hexo\node_modules\bluebird\js\release\promise.js:569:18)

yihuishou commented 7 years ago

说明文档里没有写明切换语言的设置…… zh-cn 不好用 必须是 zh-CN

Halyul commented 7 years ago

@yihuishou 染色插件这个问题请问是如何出现的呢?能否给我一个复现步骤? 语言设置问题是跟着HEXO官方文档的,请认真阅读官方文档

yihuishou commented 7 years ago

在正常安装Hexo,使用乃的主题之后,使用hexo g命令就是这样~

目录结构如下: $ npm list --depth 0 hexo-site@0.0.0 E:\Hexo +-- hexo@3.3.9 +-- hexo-deployer-git@0.3.1 +-- hexo-generator-archive@0.1.4 +-- hexo-generator-category@0.1.3 +-- hexo-generator-index@0.2.1 +-- hexo-generator-search@2.1.1 +-- hexo-generator-searchdb@1.0.8 +-- hexo-generator-tag@0.2.0 +-- hexo-renderer-ejs@0.3.1 +-- hexo-renderer-marked@0.3.0 +-- hexo-renderer-stylus@0.3.3 +-- hexo-server@0.2.2 `-- prismjs@1.8.1

(莫非是我win32 系统的锅? 小声……)

yihuishou commented 7 years ago

菜单栏前面的图标和文章右上角的图标在手机端浏览会缺失~ 麻烦说明一下修改的方法~ ovo

yihuishou commented 7 years ago

文章底部许可协议和md文件路径显示区域可以去除吗~? 在配置文档中似乎没有相关信息~

Halyul commented 7 years ago
yihuishou commented 7 years ago

你的站点菜单都是图标哇~ 咱这边看到的都是一个 ’方块‘ 文字在那里的说~ QAQ

Halyul commented 7 years ago

能否将配置文件贴上来看看呢?

yihuishou commented 7 years ago
# CDN for mathjax
location: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML

# style
style:
  scheme: 'now'
  bg_img: /img/bg.png
  avatar: /img/isme.png
  slogan: "喵·帕·斯"
  hoverable: true

# HTML head
head:
  favicon: /img/isme.png
  high_res_favicon: /img/isme.png
  apple_touch_icon: /img/isme.png
  keywords: blog, hexo, mdui

# color
color:
  primary_color: "indigo"
  accent_color: "blue"
  layout:
  random:
  bg_color: "#eeeeee"

# appbar
appbar:
  title: "(ฅ´ω`ฅ)"
  search: false

index:
  welcome: "欢迎来到我的Blog(๑>ڡ<)☆"
  notification: false

# post settings
post:
  entry_excerpt: 80
  qr_code: false
  prism:
    theme: coy
    line_number: true
  license:
    name: 'CC BY-NC-SA 4.0'
    link:  'https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh'
  word_count:
  read_time:
  toc_list_number: true
  donate:
#    wechat:
#      link: /img/avatar.png
#      fa: 'fa-wechat'
#    paypay:
#      link: 'https://paypal.com'
#      fa: 'fa-paypal'

share_menu:
#  rss: false
#  weibo: false
#  twitter: true
#  facebook: true
#  googleplus: true
#  linkedin: true
  qq: true
#  telegram: false

comment:
    use:
    shortname:

# pagination
# github@zllovesuki
pagination: 2

# footer
footer:
  since: 2017
  ICP:
  image:

# Plugins
busuanzi:
#  all_site_uv: true
#  post_pv: true
#  busuanzi_pure_mini_js: "//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"

service_woker:

about_me: true

pace: false

random_pics: 44

pages:
#  Test1:
#    link: "/myfriends"
#    md: ""
#  Test2:
#    link: "/apply-for-link"
#    fa: "fa-child"
#  Test3:
#    link: "/timeline"
#    md: "home"
#  Test4:
#    cascade: true
#    md: 'home'
#    pages:
#      TEST1:
#        link: "/myfriends"
#        md: ""
#      TEST2:
#        link: "/timeline"
#        md: "home"

sns:
#  Twitter:
#    link: https://twitter.com
#    fa: 'fa-twitter'
#  Facebook:
#    link: https://facebook.com
#    null_icon: true

# Vendors
vendors:
  fonts_min_css: fonts.useso.com
  style_min_css:
  js_min_js:
  outdatedbrowser_min_js:
  pace_min_js:
  pace_style_css:
yihuishou commented 7 years ago

大部分图标都显示成 ""

Halyul commented 7 years ago

@yihuishou 你看看控制台是否报错

yihuishou commented 7 years ago

@Halyul 控制台除了之前找不到代码着色器的错误以外,没有其他的了

yihuishou commented 7 years ago

@Halyul 就是这个样子的 https://yihuishou.github.io

Halyul commented 7 years ago

@yihuishou l浏览器控制台

yihuishou commented 7 years ago

@Halyul 没有错误~

Halyul commented 7 years ago

@yihuishou ....额你现在是全部图标都不显示吗?

yihuishou commented 7 years ago

@Halyul yes~ QAQ

EYHN commented 7 years ago

我需要 node 版本、 npm 版本、package.json。

Halyul commented 7 years ago

@yihuishou 嗯我找到图标的问题了。。。是我这个cdn设置上有问题。。。。你去掉你使用的cdn即可 染色问题EYHN在看

Halyul commented 7 years ago

染色那里因为prism那里更新了,我内置的调用没跟上而导致染色出错,我会尽快解决。 如果你急需使用的话,请手动安装prismjs的1.6.0版本

EYHN commented 7 years ago

prism.js 1.6.0 可以用

npm install --save prismjs@1.6.0
yihuishou commented 7 years ago

@EYHN 好用了 QwQ

yihuishou commented 7 years ago

@Halyul 在mdui/layout/_custom目录下新建两个空文件custom_head.ejs和custom_js.ejs即可让警告消失 要不要在配置文件里加个选项是否开启自定义头? QwQ

Halyul commented 7 years ago

@yihuishou 这是一个不错的主意

Halyul commented 7 years ago

这里补充说一下,