Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

绝对路径生成不完整 #13

Open
ETRD opened this issue Jan 22, 2017 · 3 comments
Open

绝对路径生成不完整 #13

ETRD opened this issue Jan 22, 2017 · 3 comments

Comments

@ETRD
Copy link

ETRD commented Jan 22, 2017

我使用该插件仍旧无法正常显示图片,查看html发现图片路径生成不完整,只有日,没有年月。
如下
img src="/22/imagetest/500.jpg" alt="500"

md文件完整语句如下:

title: imagetest
date: 2017-01-22 20:24:21
tags:

500

请问如何解决?谢谢

@ETRD
Copy link
Author

ETRD commented Jan 23, 2017

我将安装后的hexo-asset-image插件中的index.js中的这句代码
var beginPos = getPosition(link, '/', 3) + 1;
修改成了
var beginPos = getPosition(link, '/', 1) + 1;
问题得到解决,但不明白是不是巧合,也不明白其中的原理,更详细的见我的总结:
hexo中完美插入本地图片

@smallx
Copy link
Contributor

smallx commented Jan 23, 2017

@ETRD 我用的 hexo 3.1.1 暂时没这个问题。看你的版本是 hexo 3.2,不知道是不是 hexo 版本的原因。

@LiuZhe6
Copy link

LiuZhe6 commented Jan 30, 2017

使用的hexo 3.2.2,在进行hexo g时出现错误。代码如下:
$ hexo g
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'replace' of undefined
at Object. (D:\Hexo\blog\node_modules\hexo-asset-image\index.js:31:38)
at exports.each (D:\Hexo\blog\node_modules\cheerio\lib\api\traversing.js:293:24)
at Hexo. (D:\Hexo\blog\node_modules\hexo-asset-image\index.js:29:16)
at Hexo.tryCatcher (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\util.js:26:23)
at Hexo. (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\method.js:15:34)
at D:\Hexo\blog\node_modules\hexo\lib\extend\filter.js:68:35
at tryCatcher (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\util.js:26:23)
at ReductionPromiseArray._promiseFulfilled (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\reduce.js:105:38)
at Promise._settlePromiseAt (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\promise.js:589:26)
at Promise._settlePromises (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\promise.js:700:14)
at Async._drainQueue (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\async.js:123:16)
at Async._drainQueues (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\async.js:133:10)
at Immediate.Async.drainQueues (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\async.js:15:14)
at runCallback (timers.js:570:20)
at tryOnImmediate (timers.js:550:5)
at processImmediate [as _immediateCallback] (timers.js:529:5)
FATAL Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
at Object. (D:\Hexo\blog\node_modules\hexo-asset-image\index.js:31:38)
at exports.each (D:\Hexo\blog\node_modules\cheerio\lib\api\traversing.js:293:24)
at Hexo. (D:\Hexo\blog\node_modules\hexo-asset-image\index.js:29:16)
at Hexo.tryCatcher (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\util.js:26:23)
at Hexo. (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\method.js:15:34)
at D:\Hexo\blog\node_modules\hexo\lib\extend\filter.js:68:35
at tryCatcher (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\util.js:26:23)
at ReductionPromiseArray._promiseFulfilled (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\reduce.js:105:38)
at Promise._settlePromiseAt (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\promise.js:589:26)
at Promise._settlePromises (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\promise.js:700:14)
at Async._drainQueue (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\async.js:123:16)
at Async._drainQueues (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\async.js:133:10)
at Immediate.Async.drainQueues (D:\Hexo\blog\node_modules\hexo\node_modules\bluebird\js\main\async.js:15:14)
at runCallback (timers.js:570:20)
at tryOnImmediate (timers.js:550:5)
at processImmediate [as _immediateCallback] (timers.js:529:5)

不知道如何解决?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants