Display draft post
To view the draft posts (in the source\_drafts
folder) on localhost:4000, just run hexo server --draft
.
Set render_drafts
as true
in _config.yml
will make hexo generate
generate the posts in source\_drafts
into public
folder, which means the draft posts will be deployed to GitHub page by hexo deploy
.
No needs to set render_drafts
as true
to view the draft posts on localhost, running hexo server --draft
is enough.
_config.yml
中的render_drafts
設定為true
的話,執行hexo generate
時,資料夾source\_drafts
內的檔案也會被生成到public
資料夾中。
在這個情況下執行hexo deploy
就會把草稿文章推到 GitHub Page 上。
只是想要在 localhost:4000 上瀏覽草稿的話,執行hexo server --draft
即可,不用修改render_drafts
的值。
hexo 官方文件對render_drafts
的說明比較簡短,一開始以為設定成true
只是代表hexo server
會渲染草稿……😇
Environment
hexo: 5.3.0
hexo-cli: 4.2.0
os: Windows_NT 10.0.18363 win32 x64