Set the date format for the Octopress home page

Source: Internet
Author: User

The Date_format parameter setting in _CONFIG.YML does not work on the display of the article date in the first page of the 2.0 version of octopress that I am currently using, and it needs to be set up in other ways.

Set to, modify the source/_includes/post/date.html file, replace it with {{page.date_time_html}} (please consciously remove "\", because octopress handle the problem of curly braces, do not add to the display, Added and wrong, same as below):

\{\{ page.date | date: ‘%Y年%m月%d日‘ }}

The content in single quotes is the date format of Jekyll (also octopress), where relevant examples can be found. Like what:

\{\{ page.date | date: ‘%B %d, %Y‘ }}

Will make the date appear as:

January 02, 2015

Refer to this Jekyll Date formatting examples and a reply to a question I have been waiting for a few months, and the second reply in this reply is the positive solution.

Original link Address: http://pangyi.github.io/blog/20150102/she-zhi-octopressshou-ye-de-ri-qi-ge-shi/
Written by pangyi?posted at Http://pangyi.github.io

Set the date format for the Octopress home page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.