Jekyll-compose, automatically add time


#1

I use a default theme and jekyll-compose. I somehow figured out how to manually add time to a date format. I would like to know how to add it automatically by jekyll-compose. Currently when I hit bundle exec jekyll post "My new post", it adds time 00:00 to a post. The same when I publish a draft.


#2

I’m guessing what is happening here is the theme is using datetime from the filename, which will only get you the month, day, and year (eg. YYYY-MM-DD).

If you want hours and minutes you’ll need to add something like this to your post’s YAML Front matter.

date: 2017-06-16T16:28:40-04:100  

I’ve never used jekyll-compose so no idea if it can do that when it creates the post. But without it the theme will just fallback to 00:00 since it has no clue what the hour or minutes are on the date.


#3

I rewrote it at one place (see screenshot). Also see date formatting. It is only inside articles, but maybe I would be able to find where to rewrite it to change frontpage as well. To assign the time automatically I suspect that I would have to rewrite the code of jekyll-compose. I don’t know. I wanted to contact an author of the theme but he is only available through Twitter and I don’t have Twitter.