# Custom Hugo Shortcodes

LLMS index: [llms.txt](/llms.txt)

---

<!-- overview -->
This page explains the custom Hugo shortcodes that can be used in Kubernetes Markdown documentation.

Read more about shortcodes in the [Hugo documentation](https://gohugo.io/content-management/shortcodes).

<!-- body -->

## Feature state

In a Markdown page (`.md` file) on this site, you can add a shortcode to
display version and state of the documented feature.

### Feature state demo

Below is a demo of the feature state snippet, which displays the feature as
stable in the latest Kubernetes version.

```
{{< feature-state state="stable" >}}
```

Renders to:








  <div class="feature-state-notice feature-stable">
      <span class="feature-state-name">FEATURE STATE:</span>
      <code>Kubernetes v1.36 [stable]</code>
    </div>
  



The valid values for `state` are:

* alpha
* beta
* deprecated
* stable

### Feature state code

The displayed Kubernetes version defaults to that of the page or the site. You can change the
feature state version by passing the `for_k8s_version` shortcode parameter. For example:

```
{{< feature-state for_k8s_version="v1.10" state="beta" >}}
```

Renders to:








  <div class="feature-state-notice feature-beta">
      <span class="feature-state-name">FEATURE STATE:</span>
      <code>Kubernetes v1.10 [beta]</code>
    </div>
  



### Feature state retrieval from description file

To dynamically determine the state of the feature, make use of the `feature_gate_name`
shortcode parameter. The feature state details will be extracted from the corresponding feature gate 
description file located in `content/en/docs/reference/command-line-tools-reference/feature-gates/`.
For example:

```
{{< feature-state feature_gate_name="NodeSwap" >}}
```

Renders to:








  <div class="feature-state-notice feature-stable" title="Feature Gate: NodeSwap">
              <span class="feature-state-name">FEATURE STATE:</span> 
              <code>Kubernetes v1.34 [stable]</code>(enabled by default)</div>


## Feature gate description

In a Markdown page (`.md` file) on this site, you can add a shortcode to
display the description for a shortcode.

### Feature gate description demo

Below is a demo of the feature state snippet, which displays the feature as
stable in the latest Kubernetes version.

```
{{< feature-gate-description name="DryRun" >}}
```

Renders to:

<p><code>DryRun</code>: Enable server-side <a href="/docs/reference/using-api/api-concepts/#dry-run">dry run</a> requests
so that validation, merging, and mutation can be tested without committing.</p>

## Glossary

There are two glossary shortcodes: `glossary_tooltip` and `glossary_definition`.

You can reference glossary terms with an inclusion that automatically updates
and replaces content with the relevant links from [our glossary](/docs/reference/glossary/).
When the glossary term is moused-over, the glossary entry displays a tooltip.
The glossary term also displays as a link.

As well as inclusions with tooltips, you can reuse the definitions from the glossary in
page content.

The raw data for glossary terms is stored at
[the glossary directory](https://github.com/kubernetes/website/tree/main/content/en/docs/reference/glossary),
with a content file for each glossary term.

### Glossary demo

For example, the following include within the Markdown renders to
<a class='glossary-tooltip' title='A set of worker machines, called nodes, that run containerized applications. Every cluster has at least one worker node.' data-bs-toggle='tooltip' data-bs-placement='top' href='/docs/reference/glossary/?all=true#term-cluster' target='_blank' aria-label='cluster'>cluster</a> with a tooltip:

```
{{< glossary_tooltip text="cluster" term_id="cluster" >}}
```

Here's a short glossary definition:

```
{{< glossary_definition prepend="A cluster is" term_id="cluster" length="short" >}}
```

which renders as:
<p>A cluster is a set of worker machines, called <a class='glossary-tooltip' title='A node is a worker machine in Kubernetes.' data-bs-toggle='tooltip' data-bs-placement='top' href='/docs/concepts/architecture/nodes/' target='_blank' aria-label='nodes'>nodes</a>,
that run containerized applications. Every cluster has at least one worker node.</p>

You can also include a full definition:

```
{{< glossary_definition term_id="cluster" length="all" >}}
```

which renders as:
<p>A set of worker machines, called <a class='glossary-tooltip' title='A node is a worker machine in Kubernetes.' data-bs-toggle='tooltip' data-bs-placement='top' href='/docs/concepts/architecture/nodes/' target='_blank' aria-label='nodes'>nodes</a>,
that run containerized applications. Every cluster has at least one worker node.</p>
<p>The worker node(s) host the <a class='glossary-tooltip' title='A Pod represents a set of running containers in your cluster.' data-bs-toggle='tooltip' data-bs-placement='top' href='/docs/concepts/workloads/pods/' target='_blank' aria-label='Pods'>Pods</a> that are
the components of the application workload. The
<a class='glossary-tooltip' title='The container orchestration layer that exposes the API and interfaces to define, deploy, and manage the lifecycle of containers.' data-bs-toggle='tooltip' data-bs-placement='top' href='/docs/reference/glossary/?all=true#term-control-plane' target='_blank' aria-label='control plane'>control plane</a> manages the worker
nodes and the Pods in the cluster. In production environments, the control plane usually
runs across multiple computers and a cluster usually runs multiple nodes, providing
fault-tolerance and high availability.</p>

## Links to API Reference

You can link to a page of the Kubernetes API reference using the
`api-reference` shortcode, for example to the








<a href="/docs/reference/kubernetes-api/core/pod-v1/">Pod</a> reference:

```
{{< api-reference page="core/pod-v1" >}}
```

The content of the `page` parameter is the suffix of the URL of the API reference page.


You can link to a specific place into a page by specifying an `anchor`
parameter, for example to the 







<a href="/docs/reference/kubernetes-api/core/pod-v1/#PodSpec">PodSpec</a>
reference or the 







<a href="/docs/reference/kubernetes-api/core/pod-v1/#environment-variables">environment-variables</a>
section of the page:

```
{{< api-reference page="core/pod-v1" anchor="PodSpec" >}}
{{< api-reference page="core/pod-v1" anchor="environment-variables" >}}
```


You can change the text of the link by specifying a `text` parameter, for
example by linking to the








<a href="/docs/reference/kubernetes-api/core/pod-v1/#environment-variables">Environment Variables</a>
section of the page:

```
{{< api-reference page="core/pod-v1" anchor="environment-variables" text="Environment Variable" >}}
```

## Table captions

You can make tables more accessible to screen readers by adding a table caption. To add a
[caption](https://www.w3schools.com/tags/tag_caption.asp) to a table,
enclose the table with a `table` shortcode and specify the caption with the `caption` parameter.


<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Table captions are visible to screen readers but invisible when viewed in standard HTML.</div>


Here's an example:

```go-html-template
{{< table caption="Configuration parameters" >}}
Parameter | Description | Default
:---------|:------------|:-------
`timeout` | The timeout for requests | `30s`
`logLevel` | The log level for log output | `INFO`
{{< /table >}}
```

The rendered table looks like this:



 





<table><caption style="display: none;">Configuration parameters</caption>
	<thead>
			<tr>
					<th style="text-align: left">Parameter</th>
					<th style="text-align: left">Description</th>
					<th style="text-align: left">Default</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><code>timeout</code></td>
					<td style="text-align: left">The timeout for requests</td>
					<td style="text-align: left"><code>30s</code></td>
			</tr>
			<tr>
					<td style="text-align: left"><code>logLevel</code></td>
					<td style="text-align: left">The log level for log output</td>
					<td style="text-align: left"><code>INFO</code></td>
			</tr>
	</tbody>
</table>


If you inspect the HTML for the table, you should see this element immediately
after the opening `<table>` element:

```html
<caption style="display: none;">Configuration parameters</caption>
```

## Tabs

In a markdown page (`.md` file) on this site, you can add a tab set to display
multiple flavors of a given solution.

The `tabs` shortcode takes these parameters:

* `name`: The name as shown on the tab.
* `codelang`: If you provide inner content to the `tab` shortcode, you can tell Hugo
  what code language to use for highlighting.
* `include`: The file to include in the tab. If the tab lives in a Hugo
  [leaf bundle](https://gohugo.io/content-management/page-bundles/#leaf-bundles),
  the file -- which can be any MIME type supported by Hugo -- is looked up in the bundle itself.
  If not, the content page that needs to be included is looked up relative to the current page.
  Note that with the `include`, you do not have any shortcode inner content and must use the
  self-closing syntax. For example,
  `{{< tab name="Content File #1" include="example1" />}}`. The language needs to be specified
  under `codelang` or the language is taken based on the file name.
  Non-content files are code-highlighted by default.
* If your inner content is markdown, you must use the `%`-delimiter to surround the tab.
  For example, `{{% tab name="Tab 1" %}}This is **markdown**{{% /tab %}}`
* You can combine the variations mentioned above inside a tab set.

Below is a demo of the tabs shortcode.


<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>The tab <strong>name</strong> in a <code>tabs</code> definition must be unique within a content page.</div>


### Tabs demo: Code highlighting

```go-text-template
{{< tabs name="tab_with_code" >}}
{{< tab name="Tab 1" codelang="bash" >}}
echo "This is tab 1."
{{< /tab >}}
{{< tab codelang="go" >}}
println "This is tab 2."
{{< /tab >}}
{{< /tabs >}}
```

Renders to:

<ul class="nav nav-tabs" id="tabs-tab-with-code" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-with-code-0" role="tab" aria-controls="tabs-tab-with-code-0" aria-selected="true">Tab A</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-with-code-1" role="tab" aria-controls="tabs-tab-with-code-1">Tab 2</a></li></ul>

<div class="tab-content" id="tabs-tab-with-code-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-with-code-0" role="tabpanel" aria-labelledby="tabs-tab-with-code-0-tab" tabindex="tab-with-code"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;This is tab A.&#34;</span>
</span></span></code></pre></div></div><div class="tab-body tab-pane fade"
        id="tabs-tab-with-code-1" role="tabpanel" aria-labelledby="tabs-tab-with-code-1-tab" tabindex="tab-with-code"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="c1">// If you don&#39;t set a tab name, the site supplies one.</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nx">println</span><span class="w"> </span><span class="s">&#34;This tab has a default name&#34;</span><span class="p">;</span><span class="w">
</span></span></span></code></pre></div></div></div>


### Tabs demo: Inline Markdown and HTML

```go-html-template
{{< tabs name="tab_with_md" >}}
{{% tab name="Markdown" %}}
This is **some markdown.**
{{< note >}}
It can even contain shortcodes.
{{< /note >}}
{{% /tab %}}
{{< tab name="HTML" >}}
<div>
	<h3>Plain HTML</h3>
	<p>This is some <i>plain</i> HTML.</p>
</div>
{{< /tab >}}
{{< /tabs >}}
```

Renders to:

<ul class="nav nav-tabs" id="tabs-tab-with-md" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-with-md-0" role="tab" aria-controls="tabs-tab-with-md-0" aria-selected="true">Markdown</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-with-md-1" role="tab" aria-controls="tabs-tab-with-md-1">HTML</a></li></ul>

<div class="tab-content" id="tabs-tab-with-md-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-with-md-0" role="tabpanel" aria-labelledby="tabs-tab-with-md-0-tab" tabindex="tab-with-md"><p>This is <strong>some markdown.</strong></p>
<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>It can even contain shortcodes.</div>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-with-md-1" role="tabpanel" aria-labelledby="tabs-tab-with-md-1-tab" tabindex="tab-with-md">
<div>
	<h3>Plain HTML</h3>
	<p>This is some <i>plain</i> HTML.</p>
</div>
</div></div>


### Tabs demo: File include

```go-text-template
{{< tabs name="tab_with_file_include" >}}
{{< tab name="Content File #1" include="example1" />}}
{{< tab name="Content File #2" include="example2" />}}
{{< tab name="JSON File" include="podtemplate" />}}
{{< /tabs >}}
```

Renders to:

<ul class="nav nav-tabs" id="tabs-tab-with-file-include" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-with-file-include-0" role="tab" aria-controls="tabs-tab-with-file-include-0" aria-selected="true">Content File #1</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-with-file-include-1" role="tab" aria-controls="tabs-tab-with-file-include-1">Content File #2</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-with-file-include-2" role="tab" aria-controls="tabs-tab-with-file-include-2">JSON File</a></li></ul>

<div class="tab-content" id="tabs-tab-with-file-include-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-with-file-include-0" role="tabpanel" aria-labelledby="tabs-tab-with-file-include-0-tab" tabindex="tab-with-file-include"><p>This is an <strong>example</strong> content file inside the <strong>includes</strong> leaf bundle.</p>

<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Included content files can also contain shortcodes.</div>

</div><div class="tab-body tab-pane fade"
        id="tabs-tab-with-file-include-1" role="tabpanel" aria-labelledby="tabs-tab-with-file-include-1-tab" tabindex="tab-with-file-include"><p>This is another <strong>example</strong> content file inside the <strong>includes</strong> leaf bundle.</p>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-with-file-include-2" role="tabpanel" aria-labelledby="tabs-tab-with-file-include-2-tab" tabindex="tab-with-file-include"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl">  <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;apiVersion&#34;</span><span class="p">:</span> <span class="s2">&#34;v1&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;kind&#34;</span><span class="p">:</span> <span class="s2">&#34;PodTemplate&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;metadata&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;nginx&#34;</span>
</span></span><span class="line"><span class="cl">    <span class="p">},</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;template&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;metadata&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="nt">&#34;labels&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">          <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;nginx&#34;</span>
</span></span><span class="line"><span class="cl">        <span class="p">},</span>
</span></span><span class="line"><span class="cl">        <span class="nt">&#34;generateName&#34;</span><span class="p">:</span> <span class="s2">&#34;nginx-&#34;</span>
</span></span><span class="line"><span class="cl">      <span class="p">},</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;spec&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">         <span class="nt">&#34;containers&#34;</span><span class="p">:</span> <span class="p">[{</span>
</span></span><span class="line"><span class="cl">           <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;nginx&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">           <span class="nt">&#34;image&#34;</span><span class="p">:</span> <span class="s2">&#34;dockerfile/nginx&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">           <span class="nt">&#34;ports&#34;</span><span class="p">:</span> <span class="p">[{</span><span class="nt">&#34;containerPort&#34;</span><span class="p">:</span> <span class="mi">80</span><span class="p">}]</span>
</span></span><span class="line"><span class="cl">         <span class="p">}]</span>
</span></span><span class="line"><span class="cl">      <span class="p">}</span>
</span></span><span class="line"><span class="cl">    <span class="p">}</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span>
</span></span></code></pre></div></div></div>


## Source code files

You can use the `{{% code_sample %}}` shortcode to embed the contents of file in a code block to allow users to download or copy its content to their clipboard. This shortcode is used when the contents of the sample file is generic and reusable, and you want the users to try it out themselves.

This shortcode takes in two named parameters: `language` and `file`. The mandatory parameter `file` is used to specify the path to the file being displayed. The optional parameter `language` is used to specify the programming language of the file. If the `language` parameter is not provided, the shortcode will attempt to guess the language based on the file extension.

For example:

```none
{{% code_sample language="yaml" file="application/deployment-scale.yaml" %}}
```

The output is:


















<div class="highlight code-sample">
    <div class="copy-code-icon">
    <a href="https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/application/deployment-scale.yaml" download="application/deployment-scale.yaml"><code>application/deployment-scale.yaml</code>
    </a><img src="/images/copycode.svg" class="icon-copycode" onclick="copyCode('application-deployment-scale-yaml')" title="Copy application/deployment-scale.yaml to clipboard"></img></div>
    <div class="includecode" id="application-deployment-scale-yaml"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">apps/v1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">Deployment</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">nginx-deployment</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">spec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">selector</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">matchLabels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">app</span><span class="p">:</span><span class="w"> </span><span class="l">nginx</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">replicas</span><span class="p">:</span><span class="w"> </span><span class="m">4</span><span class="w"> </span><span class="c"># Update the replicas from 2 to 4</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">template</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">labels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">app</span><span class="p">:</span><span class="w"> </span><span class="l">nginx</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">spec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">containers</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">nginx</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l">nginx:1.16.1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">ports</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span>- <span class="nt">containerPort</span><span class="p">:</span><span class="w"> </span><span class="m">80</span><span class="w">
</span></span></span></code></pre></div></div>
</div>

When adding a new sample file, such as a YAML file, create the file in one of the `<LANG>/examples/` subdirectories where `<LANG>` is the language for the page. In the markdown of your page, use the `code` shortcode:

```none
{{% code_sample file="<RELATIVE-PATH>/example-yaml>" %}}
```
where `<RELATIVE-PATH>` is the path to the sample file to include, relative to the `examples` directory. The following shortcode references a YAML file located at `/content/en/examples/configmap/configmaps.yaml`.

```none
{{% code_sample file="configmap/configmaps.yaml" %}}
```

The legacy `{{% codenew %}}` shortcode is being replaced by `{{% code_sample %}}`.
Use `{{% code_sample %}}` (not `{{% codenew %}}` or `{{% code %}}`) in new documentation.

## Third party content marker

Running Kubernetes requires third-party software. For example: you
usually need to add a
[DNS server](/docs/tasks/administer-cluster/dns-custom-nameservers/#introduction)
to your cluster so that name resolution works.

When we link to third-party software, or otherwise mention it,
we follow the [content guide](/docs/contribute/style/content-guide/)
and we also mark those third party items.

Using these shortcodes adds a disclaimer to any documentation page
that uses them.

### Lists {#third-party-content-list}

For a list of several third-party items, add:
```
{{% thirdparty-content %}}
```
just below the heading for the section that includes all items.

### Items {#third-party-content-item}

If you have a list where most of the items refer to in-project
software (for example: Kubernetes itself, and the separate
[Descheduler](https://github.com/kubernetes-sigs/descheduler)
component), then there is a different form to use.

Add the shortcode:
```
{{% thirdparty-content single="true" %}}
```

before the item, or just below the heading for the specific item.

## Details

You can render a `<details>` HTML element using a shortcode:

```markdown
{{< details summary="More about widgets" >}}
The frobnicator extension API implements _widgets_ using example running text.

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et
dolore magnam aliquam quaerat voluptatem.
{{< /details >}}
```

This renders as:
<details><summary>More about widgets</summary><div class="details-inner">
    <p>The frobnicator extension API implements <em>widgets</em> using example running text.</p>
<p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et
dolore magnam aliquam quaerat voluptatem.</p>

  </div>
</details>



<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>Use this shortcode sparingly; it is usually best to have all of the text directly shown
to readers.</div>


## Version strings

To generate a version string for inclusion in the documentation, you can choose from
several version shortcodes. Each version shortcode displays a version string derived from
the value of a version parameter found in the site configuration file, `hugo.toml`.
The two most commonly used version parameters are `latest` and `version`.

### `{{< param "version" >}}`

The `{{< param "version" >}}` shortcode generates the value of the current
version of the Kubernetes documentation from the `version` site parameter. The
`param` shortcode accepts the name of one site parameter, in this case:
`version`.


<div class="alert alert-info" role="note"><h4 class="alert-heading">Note:</h4>In previously released documentation, <code>latest</code> and <code>version</code> parameter values
are not equivalent.  After a new version is released, <code>latest</code> is incremented
and the value of <code>version</code> for the documentation set remains unchanged. For
example, a previously released version of the documentation displays <code>version</code>
as <code>v1.19</code> and <code>latest</code> as <code>v1.20</code>.</div>


Renders to:

v1.36

### `{{< latest-version >}}`

The `{{< latest-version >}}` shortcode returns the value of the `latest` site parameter.
The `latest` site parameter is updated when a new version of the documentation is released.
This parameter does not always match the value of `version` in a documentation set.

Renders to:

v1.36

### `{{< latest-semver >}}`

The `{{< latest-semver >}}` shortcode generates the value of `latest`
without the "v" prefix.

Renders to:

1.36

### `{{< version-check >}}`

The `{{< version-check >}}` shortcode checks if the `min-kubernetes-server-version`
page parameter is present and then uses this value to compare to `version`.

Renders to:


 <p>To check the version, enter  <code>kubectl version</code>.</p>


### `{{< latest-release-notes >}}`

The `{{< latest-release-notes >}}` shortcode generates a version string
from `latest` and removes the "v" prefix. The shortcode prints a new URL for
the release note CHANGELOG page with the modified version string.

Renders to:

https://git.k8s.io/kubernetes/CHANGELOG/CHANGELOG-1.36.md



## What's next

* Learn about [Hugo](https://gohugo.io/).
* Learn about [writing a new topic](/docs/contribute/style/write-new-topic/).
* Learn about [page content types](/docs/contribute/style/page-content-types/).
* Learn about [opening a pull request](/docs/contribute/new-content/open-a-pr/).
* Learn about [advanced contributing](/docs/contribute/advanced/).
