I have noticed that currently on Windows, paths in Hexo are converted frequently. For example, when adding files to the ctx.model('Cache') database, the path separators \ are replaced with /, and later when Assets use these paths, the join function is called, which on Windows, will replace / back with \. This pull request aims to standardize the separator in the cache's _id to match the current operating system's support and to avoid using hardcoded separators (using path.sep instead). It will not change existing functionalities but is intended to improve the uniformity and maintainability of the code.
What does it do?
I have noticed that currently on Windows, paths in Hexo are converted frequently. For example, when adding files to the
ctx.model('Cache')
database, the path separators\
are replaced with/
, and later when Assets use these paths, thejoin
function is called, which on Windows, will replace/
back with\
. This pull request aims to standardize the separator in the cache's_id
to match the current operating system's support and to avoid using hardcoded separators (usingpath.sep
instead). It will not change existing functionalities but is intended to improve the uniformity and maintainability of the code.WIP: pending https://github.com/hexojs/hexo/pull/5385Screenshots
Pull request tasks