feat(validate_config): add warning about timezone#5731
feat(validate_config): add warning about timezone#5731stevenjoezhang wants to merge 1 commit intomasterfrom
Conversation
How to testgit clone -b tz https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test |
Pull Request Test Coverage Report for Build 20736158720Details
💛 - Coveralls |
| const machineTimezone = moment.tz.guess(); | ||
| if (configTimezone.name !== machineTimezone) { |
There was a problem hiding this comment.
Do we have to guess and warn about a mismatch here? E.g., running Hexo on CI may have a different timezone, intentionally.
There was a problem hiding this comment.
Yes that the warning will always be displayed in CI environments. However, I think it should be displayed.
If the user's permalink setting includes time-based parts, it will also change the URLs of their posts.
As @stevenjoezhang mentioned in the above comment at #5720 (comment), my concern is that URLs may change.
Currently, URLs are always generated using the LocalTimeZone (machine's timezone) for date/time formatting. If we change it to use the Timezone from _config.yml for generating URLs in the next major version, and users are unaware that their machine's timezone and the timezone in _config.yml are inconsistent, the generated URLs could unintentionally change.
However, I do think it might be acceptable to address this by including a migration guide in the release notes instead of showing the warning.
What does it do?
See #5720
Screenshots
Pull request tasks