Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images in Page "index" directories don't work like normal post_asset_folder's #4236

Closed
churbis opened this issue Apr 11, 2020 · 5 comments · Fixed by #4258
Closed

Images in Page "index" directories don't work like normal post_asset_folder's #4236

churbis opened this issue Apr 11, 2020 · 5 comments · Fixed by #4258
Labels
bug Something isn't working

Comments

@churbis
Copy link

churbis commented Apr 11, 2020

Expected behavior

post_asset_folder: true creates asset folders for pages that work

Actual behavior

post_asset_folder: true creates a folder named index in the root directory when you run the $hexo new page command (//index) but this folder does not work like the other asset folders.

How to reproduce?

  1. Create a page using the command
  2. Put assets in the folder that's created along side of index.md
  3. Images are not referenced via markdown ("") or plugin ("{%asset_img%}") as per usual asset_folder behavior

Environment & Settings

Node.js & npm version
Windows 10 64
Node v12.10
NPM 6.10.3

@jiangtj
Copy link
Member

jiangtj commented Apr 11, 2020

{% asset img%} is used to solve the relative path between home and post, but this problem does not exist in page. You can directly use the most common markdown syntax.

@churbis
Copy link
Author

churbis commented Apr 11, 2020 via email

@jiangtj
Copy link
Member

jiangtj commented Apr 12, 2020

I don't understand what you mean, see this example.

├─source
│  ├─example-page
│  │  ├─index.md
│  │  ├─some-pic.png

if you want to use those assets in page, just common md syntax

![](some-pic.png)

@churbis
Copy link
Author

churbis commented Apr 12, 2020 via email

@jiangtj
Copy link
Member

jiangtj commented Apr 22, 2020

I think that the index directory should not be created.

SukkaW pushed a commit that referenced this issue Jun 5, 2020
…older is true (#4258)

* fix post_asset_folder on page

* fix createAssetFolder

* Fix test case
@SukkaW SukkaW mentioned this issue Jul 25, 2020
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants