istio.io/_docs/reference/contribute/writing-a-new-topic.md

4.3 KiB

title overview order layout type
Writing a New Topic Explains the mechanics of creating new documentation pages. 30 docs markdown

This page shows how to create a new Istio documentation topic.

Before you begin

You first need to create a fork of the Istio documentation repository as described in Creating a Doc Pull Request.

Choosing a page type

As you prepare to write a new topic, think about which of these page types is the best fit for your content:

Concept A concept page explains some significant aspect of Istio. For example, a concept page might describe the Mixer's configuration model and explain some of its subtleties. Typically, concept pages don't include sequences of steps, but instead provide links to tasks or tutorials that do.
Reference A reference page provides exhaustive lists of things like API parameters, command-line options, configuration settings, and procedures.
Sample A sample page describes a fully working stand-alone example highlighting a particular set of features. Samples must have easy to follow setup and usage instructions so users can quickly run the sample themselves and experiment with changing the sample to explore the system.
Task 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.
Tutorial 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. Tutorials can include surface-level explanations, but should link to related conceptual topics for deep explanations.

Each page type has a template file located in the corresponding directory which shows you the basic structure expected for topics of that type. Please start new documents by copying the template.

Naming a topic

Choose a title for your topic that has the keywords you want search engines to find. Create a filename for your topic that uses the words in your title, separated by hyphens, all in lower case.

For example, the topic with title TBD has filename tbd.md. You don't need to put "Istio" in the filename, because "Istio" is already in the URL for the topic, for example:

https://istio.io/docs/tasks/tbd.html

Updating the front matter

Every documentation file needs to start with Jekyll front matter. The front matter is a block of YAML that is between the triple-dashed lines at the top of each file. Here's the chunk of front matter you should start with:

---
title: TITLE_TBD
overview: OVERVIEW_TBD

order: ORDER_TBD

layout: docs
type: markdown
---

Copy the above at the start of your new markdown file and update the TBD fields for your particular file. The available front matter fields are:

Field Description
title The short title of the page
overview a one-line description of what the topic is about
order integer used for sort order
`layout' indicates which of the Jekyll layouts this page uses
index indicates whether the page should appear in the doc's top nav tabs

Choosing a directory

Depending on your page type, put your new file in a subdirectory of one of these:

  • _docs/concepts/
  • _docs/reference/
  • _docs/samples/
  • _docs/tasks/
  • _docs/tutorials/

You can put your file in an existing subdirectory, or you can create a new subdirectory.

Adding images to a topic

Put image files in a img/NAME subdirectory of where you put your markdown file, where NAME corresponds to the name of your markdown file. The preferred image format is SVG.

If you must use a PNG or JPEG file instead, and the file was generated from an original SVG file, please include the SVG file in the repository even if it isn't used in the web site itself. This is so we can update the imagery over time if needed.