关于图片的问题
你好,你做的这个博客程序很不错,就是处理图片的时候有些问题。 譬如,如果我在source文件夹里放一张图片 example.png, 生成之后会在public文件夹下游example.png。 但是,如果我把source的example.png删除掉,然后换一张不一样的图片,但是依旧命名为example.png,重新生成一遍,之前的图片不会被覆盖。 这个问题,覆盖或者不覆盖都有问题。 how to node 这个静态博客在图片处理上就比较好,每个markdown文件,都同时带一个同名文件夹,里面放所有的附件,包块图片。 不知道你今后解决图片这个问题的方法会是什么。 一直在找一个符合心意的静态博客系统,用markdown写作,而且支持像how to node那样支持图片和文档一起提交上去,就发布为一篇新博客。
new的时候同时生成一个目录似乎是个不错的点子呢,+1
一个markdown文件一个文件夹 +1
[TRANS] Image Problem
There are some problem when user handle images. If user insert a image example.png under source, it will appear under public directory. If user delete example.png and change to another image also name it as example.png, the previous image won't be replaced. But even it does still not right.
The blog engine behine how to node do better, each time user create a new post will also create a new directory, with the same name, which can put all attachment files.
Any good advices?
目前是直接產生POST_NAME.md的檔案,改成生成一個POST_NAME的目錄
hexo generate則轉換md,其餘目錄檔案不變,這樣使用者可以自行增添?
hexo will create POST_NAME.md right now, maybe it can create a directory instead.
When hexo generate, it will convert md but keep other directories/files as usual. In that case, user can manage their files easily.
嗯,大概就是这个思路。在hexo new "New Post" 的时候,同时在同级路径下生成一个同名文件夹,这个文件夹让用户放置图片等附件。然后hexo generate的时候,直接把这个目录复制到public文件夹去就行了。
赞同啊
然後如果在md文件中可以直接用文件名直接引用附件的話就更贊了
如  這種形式【ˋ(°▽、°)口水ing...】
同遇到这个问题 +1
目前正在試著實作此功能,希望能在v2.4發佈,各位如果有任何意見的話歡迎討論。
I'm trying to implement this feature. Feel free to write your opinion here.
目前此功能的初版已經完成,只要在 _config.yml 中將 post_asset_folder 設為 true,即能開啟此功能。這將會:
- 在建立新文章時,同時建立同名資料夾
- 解析文章時,同時掃描該資料夾的內容
若有任何意見歡迎提出。
The first version of this feature is finished. To enable this feature, you have to set post_asset_folder as true in _config.yml. And this will:
- Create a folder with same name when creating a new post.
- Scan the folder when processing posts.
Feel free to write your opinions here.
@tommy351 今天体验了一下功能,写作与发布的图片引用并不同步.
例如我在编写的文章newpost.md的时候引用图片
 这样才能引用到图片,
而发布的时候,由于生成后的文章同级目录缺少了 newpost/newpost这个图片目录,导致最后生成的页面没法引用图片.我建议, 不单单把目录下的文件复制过去,并且写作与发布的目录结构也要一致.