{"id":19834,"date":"2014-04-18T15:01:46","date_gmt":"2014-04-18T07:01:46","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=19834"},"modified":"2025-04-04T01:45:08","modified_gmt":"2025-04-03T17:45:08","slug":"jekyll-draft","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/","title":{"rendered":"How to Create Post Draft In Jekyll"},"content":{"rendered":"<p>In the previous post, we have shown you how to install <a href=\"https:\/\/jekyllrb.com\/\" target=\"_blank\" rel=\"noopener\">Jekyll<\/a> and <a href=\"https:\/\/www.hongkiat.com\/blog\/blog-with-jekyll\/\">publish your first post<\/a> with it. If you have followed it, you can see that creating a post is a breeze; we simply create a new Markdown file, save it within the <strong>\/_posts<\/strong> folder, and it will <strong>show up in the blog immediately<\/strong>.<\/p>\n<p>That, however, could be a problem if you have put your blog online. Your post may have unfinished sentences, contain errors, and a few other things that should not be seen by your readers.<\/p>\n<p>That\u2019s why we usually create a draft first before pressing the <strong>Publish<\/strong> button. So, in this post, we will show you how to <strong>create a post draft in Jekyll before<\/strong> it hits the public eye.<\/p>\n<p class=\"note\"><strong>Recommended Reading: <\/strong><a href=\"https:\/\/www.hongkiat.com\/blog\/blog-with-jekyll\/\">How To Create A Blog With Jekyll \u2013 A Beginner\u2019s Guide<\/a><\/p>\n<p>But first, let\u2019s start up the Jekyll server with the following command line.<\/p>\n<pre>\r\njekyll server --watch\r\n<\/pre>\n<h2>File and Directory<\/h2>\n<p>Prior to version 1.0, working with a draft in Jekyll is hardly manageable. There are numerous ways to deal with it.<\/p>\n<p>Some have set <code>published: false<\/code> in the post files to prevent it from being published, and some put <code>future: false<\/code> in the configuration file to prevent Jekyll from generating posts with a <strong>future date<\/strong> \u2014 which still will  be published once the date rolls around.<\/p>\n<p>Now, Jekyll has made things simpler to control.<\/p>\n<p>Jekyll relies on strict directory structure. In the case of creating drafts, we need to create a new folder named <strong>_drafts<\/strong>. We put all drafts into this folder.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg\" alt=\"drqaft folder\" width=\"500\" height=\"210\"><\/figure>\n<p>The draft file name does not have to include the post date; we can just name it this way:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-file.jpg\" alt=\"draft file\" width=\"500\" height=\"210\"><\/figure>\n<p>Jekyll will ignore this folder. You can write your post as usual, and it won\u2019t be displayed out in the open yet. Once you are done with your post, you can put it in the <strong>_posts<\/strong> folder, and add a proper date in the filename.<\/p>\n<h2>Hold on?!<\/h2>\n<p>Hold on, can\u2019t we just create <em>any<\/em> folder? Well, the <strong>_drafts<\/strong> folder name is the official naming convention to put your drafts in. We technically can name the folder anything, but doing so would prevent us from previewing our drafts.<\/p>\n<p>In Jekyll, we can run the <code>jekyll<\/code> command with the <code>--drafts<\/code> flag to preview the drafts: <code>jekyll server --watch --drafts<\/code> Refresh your blog, and you will see the draft appear on the blog. The draft will be displayed with its latest modified date.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-preview.jpg\" alt=\"draft preview\" width=\"500\" height=\"210\"><\/figure>\n<h2>Conclusion<\/h2>\n<p>We have shown you how to create a draft in Jekyll. It\u2019s quite simple. But we can <strong>make the workflow from draft to publication more streamlined<\/strong> with the help of a plugin. We will discuss it in the next post. So, stay tuned.<\/p>","protected":false},"excerpt":{"rendered":"<p>In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a post is a breeze; we simply create a new Markdown file, save it within the \/_posts folder, and it will show up in the blog&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3408,352],"tags":[3093],"topic":[4520,4523],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Create Post Draft In Jekyll - Hongkiat<\/title>\n<meta name=\"description\" content=\"In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Post Draft In Jekyll\" \/>\n<meta property=\"og:description\" content=\"In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2014-04-18T07:01:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T17:45:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Create Post Draft In Jekyll\",\"datePublished\":\"2014-04-18T07:01:46+00:00\",\"dateModified\":\"2025-04-03T17:45:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/\"},\"wordCount\":445,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jekyll-draft\\\/draft-folder.jpg\",\"keywords\":[\"Jekyll\"],\"articleSection\":[\"Blogging\",\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/\",\"name\":\"How to Create Post Draft In Jekyll - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jekyll-draft\\\/draft-folder.jpg\",\"datePublished\":\"2014-04-18T07:01:46+00:00\",\"dateModified\":\"2025-04-03T17:45:08+00:00\",\"description\":\"In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jekyll-draft\\\/draft-folder.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/jekyll-draft\\\/draft-folder.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/jekyll-draft\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Post Draft In Jekyll\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Create Post Draft In Jekyll - Hongkiat","description":"In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Post Draft In Jekyll","og_description":"In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a","og_url":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2014-04-18T07:01:46+00:00","article_modified_time":"2025-04-03T17:45:08+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Create Post Draft In Jekyll","datePublished":"2014-04-18T07:01:46+00:00","dateModified":"2025-04-03T17:45:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/"},"wordCount":445,"commentCount":3,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg","keywords":["Jekyll"],"articleSection":["Blogging","Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/","url":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/","name":"How to Create Post Draft In Jekyll - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg","datePublished":"2014-04-18T07:01:46+00:00","dateModified":"2025-04-03T17:45:08+00:00","description":"In the previous post, we have shown you how to install Jekyll and publish your first post with it. If you have followed it, you can see that creating a","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/jekyll-draft\/draft-folder.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/jekyll-draft\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Post Draft In Jekyll"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-59U","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=19834"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19834\/revisions"}],"predecessor-version":[{"id":73682,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19834\/revisions\/73682"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=19834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=19834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=19834"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=19834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}