Comments (17)
图片建议放在 source/images 目录下。然后使用 [config.root]/images/xxx
的形式引用,其中 [config.root]
是你的站点的根路径。可以查看我的demo站点的 source分支 了解图片的放置方法以及 feature 的书写方法。
from hexo-theme-freemind.
非常感谢,最开始使用hexo 2.0时也是这种方式引用图片,后来升级hexo 3.0之后有个post_asset_folder功能选项,觉得非常方便,就使用了这个,请问现在有没有办法还是使用将对应帖子的图片直接放到相应帖子名称文件夹的方法。
from hexo-theme-freemind.
主页的图片如果不使用 post_asset_folder
变量,直接引用图片路径是否可以解决问题?即:
根路径/文件夹名/图片名
from hexo-theme-freemind.
非常感谢,这样可以解决主页上的feature中需要显示的图片问题,还想问两个问题,谢谢!
- 像我下述图片中描述的1中填写的路径很长,有没有办法可以直接引用某个变量来实现让它直接引用post_asset_folder中的图片?
- 对2处的位置是直接引用post_asset_folder中的图片,当将放在图片下面时,理论上主页应该显示出该图片,但主页上却无法下载引用图片地址,主页上的图片引用路径依然是根目录,无法自动引用post_asset_folder路径,这个可否解决?
谢谢
from hexo-theme-freemind.
应该可以。我晚点看看。
from hexo-theme-freemind.
热心大神!什么时候您有空了都可以,谢谢!
from hexo-theme-freemind.
刚才图片没出来
from hexo-theme-freemind.
试试更新下主题。然后 feature 的路径也改成使用和正文一样的 post_asset_folder 短路径。
from hexo-theme-freemind.
这样可以完美解决我上面提到的问题1,对于问题2,是不是也需要大神修改哪里对应的代码,谢谢
from hexo-theme-freemind.
我看了一下官方提供的 Light 和 Landscape 的源码,发现他们的主题同样没有对首页文章内容中的图片路径进行处理。我认为这个问题应该是共性的。
要解决这个问题,我想了三个方法:
- 修改主题,如果要避免这种错误,我能想到的办法是在模板中插入对文章内容的处理,将这些内容中的短路径全局替换成完整路径。但需要小心避免错误替换外链的图片。我感觉这种替换的实现有点 dirty 。
- 修改 hexo 对 asset 的处理,增加对首页中的�文章内容的短路径。我更倾向于这种做法。也许我会找时间给 hexo 提交 pull request 。
- 目前更建议你将需要作为 excerpt 的部分中的图片链接改成完整的链接。即 当前文章路径/图片名 的形式。
from hexo-theme-freemind.
大神,正如你说所,最近更换主题时试用多个主题,都有这种excerpt中出现无法引用短路径的问题,最后给issue都没能回复,试用到你这里给了回复,在hexo那里没有更新之前,我还是先使用你提供的方案3吧,放
from hexo-theme-freemind.
谢谢,笔误
from hexo-theme-freemind.
FYI ,看看这篇文章:http://timnew.me/blog/2014/08/19/use-hexo-asset-folder-to-manage-resource-used-by-post/ 。应该可以解决你的问题。
from hexo-theme-freemind.
谢谢,在hexo官方没出解决方法或者没有其他人长期维护的代码之前我先使用你说的直接引用绝对路径的方式解决吧。刚试了那个插件,发现不支持hexo 3.1.1
from hexo-theme-freemind.
官方的解决方案
from hexo-theme-freemind.
@AsiamCn 👍 。请 @blueyi 测试下是否解决。如果是,请关闭本issue。
from hexo-theme-freemind.
谢谢 @AsiamCn
from hexo-theme-freemind.
Related Issues (20)
- “阅读更多”的样式text-pull:right在chrome中查看“Unknown property name” HOT 2
- Uncaught TypeError: Cannot read property 'addEventListener' of null in search.js HOT 2
- Can't show H2 HOT 8
- 能否请大大增加不蒜子的访问计数? HOT 1
- [feature] pjax-support HOT 1
- 请教作者如何使用云跟帖替代新逝的多说? HOT 4
- 请教如何使用标签插件 HOT 1
- 请问怎么给网页添加一个logo如logo.ico HOT 2
- How can I show the description of article on the front page? HOT 4
- Freemind theme at Jekyll HOT 3
- 请问,markdown的主题可以更换吗? HOT 6
- 您博客旁边的wiki特别棒,能分享下吗? HOT 1
- 博文更改标签后原来的标签仍然显示在 Tag 页面 HOT 1
- How to get rid of heart icon in slogan line? HOT 2
- 分享到微信朋友圈功能无法生成二维码 HOT 4
- Word wrapping does not work with long URL HOT 4
- Bug in search.js HOT 2
- Multiple tags Search feature
- Major Bug in search.js HOT 9
- How to change the index to about?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-freemind.