-
Notifications
You must be signed in to change notification settings - Fork 67
How to create a draft page
Creating a draft page is easy. It allows you and your team members to preview documentation on dev-design.va.gov.
- 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
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."
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
.
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, commit this page directly to master. It will take up to 10 minutes to view your page on dev-design.va.gov.
You can edit your draft like any other page now, using pull requests and committing to the master
branch to view on the web.
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.
Unfortunately, you cannot draft content on existing pages. There are two choices for how you may proceed.
- Use GitHub's pull request
- Create a new version of the existing page. If
awesome-pattern.md
already exists and you want to draft large scale changes, createawesome-pattern-2.md
orawesome-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.
- Content from
dev-design.va.gov
will publish daily todesign.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.