• "/docs/templatedemos/"
  • "/docs/templatedemos.html" title: Using Page Templates

These page templates are available for writers who would like to contribute new topics to the Kubernetes docs:

The page templates are in the _includes/templates directory of the kubernetes.github.io repository.

Task template

A task page shows how to do a single thing, typically by giving a short sequence of steps. Task pages have minimal explanation, but often provide links to conceptual topics that provide related background and knowledge.

To write a new task page, create a Markdown file in a subdirectory of the /docs/tasks directory. In your Markdown file, provide values for these variables, and then include templates/task.md:

  • overview - required
  • prerequisites - required
  • steps - required
  • discussion - optional
  • whatsnext - optional

In the steps section, use ## to start with a level-two heading. For subheadings, use ### and #### as needed. Similarly, if you choose to have a discussion section, start the section with a level-two heading.

Here's an example of a Markdown file that uses the task template:

{% raw %}

---
title: Configuring This Thing


{% capture overview %} This page shows how to ... {% endcapture %}

{% capture prerequisites %} Do this. Do this too. {% endcapture %}

{% capture steps %}

Doing ...

  1. Do this.
  2. Do this next. Possibly read this related explanation. {% endcapture %}

{% capture discussion %}

Understanding ...

Here's an interesting thing to know about the steps you just did. {% endcapture %}

{% capture whatsnext %} Learn more about this. See this related task. {% endcapture %}

{% include templates/task.md %}

{% endraw %}

Here's an example of a published topic that uses the task template:

Using an HTTP Proxy to Access the Kubernetes API

Tutorial template

A tutorial page shows how to accomplish a goal that is larger than a single task. Typically a tutorial page has several sections, each of which has a sequence of steps. For example, a tutorial might provide a walkthrough of a code sample that illustrates a certain feature of Kubernetes. Tutorials can include surface-level explanations, but should link to related concept topics for deep explanations.

To write a new tutorial page, create a Markdown file in a subdirectory of the /docs/tutorials directory. In your Markdown file, provide values for these variables, and then include templates/tutorial.md:

  • overview - required
  • prerequisites - required
  • objectives - required
  • lessoncontent - required
  • cleanup - optional
  • whatsnext - optional

In the lessoncontent section, use ## to start with a level-two heading. For subheadings, use ### and #### as needed.

Here's an example of a Markdown file that uses the tutorial template:

{% raw %}

---
title: Running a Thing


{% capture overview %} This page shows how to ... {% endcapture %}

{% capture prerequisites %} Do this. Do this too. {% endcapture %}

{% capture objectives %} Learn this. Build this. * Run this. {% endcapture %}

{% capture lessoncontent %}

Building ...

  1. Do this.
  2. Do this next. Possibly read this related explanation.

Running ...

  1. Do this.
  2. Do this next.

Understanding the code

Here's something interesting about the code you ran in the preceding steps. {% endcapture %}

{% capture cleanup %} Delete this. Stop this. {% endcapture %}

{% capture whatsnext %} Learn more about this. See this related tutorial. {% endcapture %}

{% include templates/tutorial.md %}

{% endraw %}

Here's an example of a published topic that uses the tutorial template:

Running a Stateless Application Using a Deployment

Concept template

A concept page explains some aspect of Kubernetes. For example, a concept page might describe the Kubernetes Deployment object and explain the role it plays as an application is deployed, scaled, and updated. Typically, concept pages don't include sequences of steps, but instead provide links to tasks or tutorials.

To write a new concept page, create a Markdown file in a subdirectory of the /docs/concepts directory. In your Markdown file, provide values for these variables, and then include templates/concept.md:

  • overview - required
  • body - required
  • whatsnext - optional

In the body section, use ## to start with a level-two heading. For subheadings, use ### and #### as needed.

Here's an example of a page that uses the concept template:

{% raw %}

---
title: Understanding this Thing


{% capture overview %} This page explains ... {% endcapture %}

{% capture body %}

Understanding ...

Kubernetes provides ...

Using ...

To use ... {% endcapture %}

{% capture whatsnext %} Learn more about this. See this related task. {% endcapture %}

{% include templates/concept.md %}

{% endraw %}

Here's an example of a published topic that uses the concept template:

Annotations