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

After Enabling "post_asset_folder: true", Only One Format of Posts Can Be Rendered #5523

Open
5 tasks done
simonkimi opened this issue Jul 23, 2024 · 3 comments · May be fixed by #5531
Open
5 tasks done

After Enabling "post_asset_folder: true", Only One Format of Posts Can Be Rendered #5523

simonkimi opened this issue Jul 23, 2024 · 3 comments · May be fixed by #5531

Comments

@simonkimi
Copy link

Check List

  • I have already read Docs page & Troubleshooting page.
  • I have already searched existing issues and they are not help to me.
  • I examined error or warning messages and it's difficult to solve.
  • I am using the latest version of Hexo. (run hexo version to check)
  • My Node.js is matched the required version.

Expected behavior

I have articles in various formats, such as Markdown (.md) and AsciiDoc (.adoc). However, due to the code at this link, when the post_asset_folder is enabled, only articles with the same extension as defined in new_post_name can be rendered. Other types of documents are treated as asset files and ignored. I want articles with different file extensions to be rendered correctly.

Actual behavior

My new_post_name setting is "year:month:day-:title.md", so only Markdown articles with the .md format are rendered, while other articles are ignored.

How to reproduce?

  1. Enable post_asset_folder
  2. Create articles with different file extensions
  3. hexo g

Is the problem still there under Safe mode?

yes

Your Node.js & npm version

node: v18.2.0
pnpm: 9.4.0

Your Hexo and Plugin version

dependencies:
hexo 7.3.0                          hexo-generator-archive 2.0.0        hexo-generator-tag 2.0.0            hexo-renderer-marked 6.3.0
hexo-asset-img 1.1.0                hexo-generator-category 2.0.0       hexo-renderer-asciidoc 2.2.0-dev.1  hexo-renderer-stylus 3.0.1
hexo-deployer-git 4.0.0             hexo-generator-index 3.0.0          hexo-renderer-ejs 2.0.0             hexo-server 3.0.0

Your package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo clean && hexo generate --debug",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "7.3.0"
  },
  "dependencies": {
    "hexo": "^7.3.0",
    "hexo-asset-img": "^1.1.0",
    "hexo-deployer-git": "^4.0.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-asciidoc": "2.2.0-dev.1",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^6.3.0",
    "hexo-renderer-stylus": "^3.0.0",
    "hexo-server": "^3.0.0"
  }
}

Your site's _config.yml (Optional)

No response

Others

No response

@simonkimi
Copy link
Author

I am wondering if there is a configuration for a whitelist or blacklist to distinguish which files are articles and which are asset files. For example: post_extension: ["md", "adoc"], and anything beyond this will be considered as asset files.

@yoshinorin
Copy link
Member

@simonkimi

I am wondering if there is a configuration for a whitelist or blacklist to distinguish which files are articles and which are asset files. For example: post_extension: ["md", "adoc"], and anything beyond this will be considered as asset files.

As far as I know, there are none. I'm not sure what side effects there might be, but if you (or someone) submit a PR about this, we could be accepted.

@uiolee
Copy link
Member

uiolee commented Aug 17, 2024

#4781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants