Hexo: post date error on linux

Created on 20 Nov 2018  ยท  11Comments  ยท  Source: hexojs/hexo

post date error on linux

for example
this is my blog https://blog.hellojukay.cn/2018/11/20/20180524/

the post date show 2018-11-20, but this article write on 2018-05-24 , this is the markdown source file https://github.com/hellojukay/blog/blob/master/source/_posts/20180524.md
image
image

on mac , it work fine, bug linux not.

this is my config

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: ๆถฆ็‰ฉ็ป†ๆ— ๅฃฐ
subtitle:
description:
author: hellojukay
language:
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://blog.hellojukay.cn
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: true
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace:

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repository: https://github.com/hellojukay/hellojukay.github.io.git
  branch: master

this is my build script

language: node_js
nodejs: stable

install:
        - npm install

script:
        - hexo g

after_script:
        - cd ./public
        - git init
        - git config user.name "hellojukay"
        - git config user.email "[email protected]"
        - git add .
        - git commit -m "$(date +%F) auto deploy"
        - git remote add origin https://${blog_token}@github.com/hellojukay/hellojukay.github.io.git
        - git push -f origin master

this is my blog source file

https://github.com/hellojukay/blog

bug dates deploy need-investigation

Most helpful comment

Guys, just one thing:

---
title: ไปŽไธ€ๆฌกๆ•‘็ซๆƒณๅˆฐ้—ฎ้ข˜
data: 2018-05-24 08:55:00
tags: [ๆ‚่ฎฐ]
---

Not data, but date. :smile:

All 11 comments

Hi @hellojukay :wave:

I wonder if someone moved the date from the one in the markdown file to file mtime (file system modified time).

At least that gives us a place to look.

@tcatche Yes,This is my blog https://blog.hellojukay.cn/,this is my blog source file repo https://github.com/hellojukay/blog

@hellojukay Do you know if it's possible to use hexo-deployer-git instead?

https://hexo.io/docs/deployment#Git

I wonder if that will help.

@tcatche hexo create html date error on localhost , not git push.

I'm taking another look at this now @hellojukay. Please don't @ mention tcatche user. ๐Ÿ˜… I am @tcrowe.

I know we were discussing a date change here: https://github.com/hexojs/hexo/pull/3235

I will see if any of these changes effected your repo.

@hellojukay I was able to reproduce the error you posted.

tcrowe versions:
OSX: 10.13
node -v: v11.2.0
npm -v: 6.4.1

npm ls --depth 0

โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected]

Source view:

hexo-hellojukay-date01

Local server view:

hexo-hellojukay-date02

Guys, just one thing:

---
title: ไปŽไธ€ๆฌกๆ•‘็ซๆƒณๅˆฐ้—ฎ้ข˜
data: 2018-05-24 08:55:00
tags: [ๆ‚่ฎฐ]
---

Not data, but date. :smile:

@ivan-nginx Thank you for pointing that out!

I found a setting which also changes the dates here:
https://github.com/hexojs/hexo/blame/master/lib/plugins/processor/post.js#L78

@hellojukay can you try removing your timezone:
https://github.com/hellojukay/blog/blob/master/_config.yml#L11

Then tell me if that fixes it?

@tcrowe @ivan-nginx I change 'data' to 'date',

it fixed , thinks very munch. ๐Ÿ‘ ๐Ÿ’ฏ

@hellojukay Thank you for helping us find a bug. Now we can think how to fix it for everyone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hgDendi picture hgDendi  ยท  3Comments

bearpaw picture bearpaw  ยท  3Comments

demurgos picture demurgos  ยท  3Comments

enterhuiche picture enterhuiche  ยท  3Comments

lushijie picture lushijie  ยท  3Comments