Skip to content

How to create a draft page

Jared C Cunha edited this page Jun 4, 2019 · 4 revisions

Creating a draft page is easy. It allows you and your team members to preview documentation on dev-design.va.gov.

draft preview

  • Draft pages are committed to the master branch.
  • Search engines will not index draft pages
  • Draft pages only appear in the left nav when you are viewing the draft page
  • Draft pages will be flagged as a draft at the top with a link to edit the page in GitHub
  • To view a draft, you must have the hyperlink of the page
    • There is also a drafts index that shows all current pages in draft

Creating your draft page

First, you should read how to add new pages if you haven't already.

Next, create a new page in the desired section. For this example, let's say we're creating a draft in the patterns section. Go into the /src/_patterns folder and click the "Create new file button."

create page button

Let's call this page "Draft pattern." In the file name field, we'll enter draft-pattern.md. You will need to remember everything before the .md part of your file name because it will be part of your page URL. After we commit this file, the link will be https://dev-design.va.gov/patterns/draft-pattern.

choose file name

As we noted in the how to add new pages section, each page requires Front Matter at the top the page. To make a page a draft, you need an additional piece of Front Matter: draft: true.

---
# Do NOT Edit layout
layout: default

#Page info: Edit these items below
title: [Page title]
draft: true
---

# [Main page title]

[YOUR CONTENT]

From here:

  • Update the page title
  • Write your content
  • Add any anchors or search tags you may need.

To publish your draft page

To publish your draft, commit this page directly to master. It will take up to 10 minutes to view your page on dev-design.va.gov.

Commit file

You can edit your draft like any other page now, using pull requests and committing to the master branch to view on the web.

Promoting drafts to production

When your draft page is ready for production, remove the line containing draft: true from page's Front Matter and commit the change to the master branch.

Drafting content on an existing page

Unfortunately, you cannot draft content on existing pages. There are two choices for how you may proceed.

  1. Use GitHub's pull request
  2. Create a new version of the existing page. If awesome-pattern.md already exists and you want to draft large scale changes, create awesome-pattern-2.md or awesome-pattern-draft.md. Then, when you are ready to promote the draft content, you may overwrite the content in the old page with the content in your new page, and then delete the draft file.

Things to keep in mind

  • Content from dev-design.va.gov will publish daily to design.va.gov. Draft pages will continue to be accessible only by having the link.
  • All draft content is in a public repository. Any can access it.