probberechts / hexo-theme-cactus

:cactus: A responsive, clean and simple theme for Hexo.
https://probberechts.github.io/hexo-theme-cactus/
MIT License
3.15k stars 784 forks source link

Image Sizing #306

Closed nataliepjlin closed 2 years ago

nataliepjlin commented 2 years ago

hello! i added this package to my hexo site. after installing, when using ![image](./about/images/profile.jpg), it works fine. but it doesn't work when using ![image](./about/images/profile.jpg =36x36). is there any ways to fix this, or is there any other tools that can set images' sizes?

probberechts commented 2 years ago

You can use one of Hexo's tag plugins

{% img [class names] /path/to/image [width] [height] '"title text" "alt text"' %}

or raw HTML

<img src="/path/to/image" alt="alt text" style="width:200px;"/>
nataliepjlin commented 2 years ago

@probberechts I tried both <img src="/images/profile.jpg" width="40" height="40"> and {% asset_img profile.jpg 30 30 %} but none of these work. Do I need to create a new path or move the images folder to another places?? my repo: https://github.com/nataliepjlin/heeexo thanks a lot!!!

probberechts commented 2 years ago

I do not know why the HTML tag does not work, but asset_img has to be used in conjunction with post_asset_folder. Try with the normal img tag instead.

nataliepjlin commented 2 years ago

@probberechts I'm not sure what happened but now it says Markdown Image Path does not exists!, also even ![image](/source/images/profile.jpg) can't display

I tried using HTML again, using <img src="/profile.jpg"/>, and git messages said update link as:-->/heeexo/heeexo/about/index/profile.jpg

👇I'm not sure if this will help maybe it's because the path is incorrect? image