4

I'd like to schedule some posts to be published in the future, and migrate some posts from other sites, which were published in the past.

I've tried modifying the unix file creation date for my source files, but that doesn't seem to do the right thing.

blueberryfields
  • 45,910
  • 28
  • 89
  • 168

1 Answers1

6

hexo controls the publish date (and other config options) in the source .md files. just add a date tag to the top of the file, for example:

title: page title
tags:
  - aTag
  - anotherTag
id: 418
categories:
  - aCategory
  - anotherCategory
date: 2013-11-06 06:40:12
---

Some text i'd like to have in the body of this post
blueberryfields
  • 45,910
  • 28
  • 89
  • 168
  • 1
    Make sure you have `future: false` in your configuration. – m4ktub Feb 03 '16 at 09:10
  • Also it is important to note that you need to restart Hexo in order for the server to display posts which it should now publish. Meaning, setting a future time and date will prevent Hexo from displaying the post, but once that time comes, Hexo will not display the post until you restart the server. I write posts weeks in advance, and so I simply have a cron that restarts my Hexo container every four hours or so. – L0j1k Mar 09 '16 at 07:24
  • @L0j1k sounds like overkill. you might want to look into the watch option - somewhere in your setup, add it to the hexo generate command: `hexo generate --watch` – blueberryfields Mar 11 '16 at 17:07
  • @blueberryfields The files don't change. I write the posts weeks in advance, and so a file watch wouldn't do anything for me. – L0j1k Mar 12 '16 at 00:58
  • right. can you confirm whether or not the posts get generated at all? – blueberryfields Mar 13 '16 at 19:04