# Unknown shortcode token error in v0.111.x

**URL:** <https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387>\
**Category:** support\
**Tags:** shortcodes\
**Created:** [March 11, 2023, 8:10am UTC](https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387 "2023-03-11T08:10:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigbox](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/craigbox/32/11498_2.png) [@craigbox](https://discourse.gohugo.io/u/craigbox)\
**Post date:** [March 11, 2023, 8:10am UTC](https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387/1 "2023-03-11T08:10:28Z")

</div>

The Kubernetes website builds with 0.110 but not 0.111. I’ve [sent a PR](https://github.com/kubernetes/website/pull/39922) to close all the shortcodes which were previously left dangling, but I’m getting errors relating to shortcodes used in headings, which look to be related to generating the page TOC?

`Error: Error building site: "/Users/craigbox/Documents/Projects/kubernetes.io/content/ja/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md:1:1": unknown shortcode token "HAHAHUGOSHORTCODE-s12</span>-HBHB"`

The file(s) with errors contain headings:

`## {{% heading "prerequisites" %}}`

where the heading shortcode is

```auto
<!-- heading -->
{{- $heading := .Get 0 -}}
{{- $heading := printf "%s_heading" $heading -}}
{{- T $heading | safeHTML -}}

```

All the headings are defined in `ja.toml`:

```auto
[prerequisites_heading]
other = "始める前に"

```

The full source is at [GitHub - kubernetes/website: Kubernetes website and documentation repo:](https://github.com/kubernetes/website/).

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 11, 2023, 4:29pm UTC](https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387/2 "2023-03-11T16:29:17Z")

</div>

The error is not triggered by the headings. It is triggered by calling a shortcode using the `{{< >}}` notation within a fenced code block, and it depends on the lexer (code language) in the code block’s info string.

I’ll log an issue shortly.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 11, 2023, 5:20pm UTC](https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387/3 "2023-03-11T17:20:34Z")

</div>

The site builds without errors using the `{{% %}}` shortcode notation within fenced code blocks, which to me makes a lot more sense than using the `{{< >}}` notation.

I cloned the site, pulled in your PR, and then made these changes:

> **See diff**
>
> ````diff
> diff --git a/content/es/docs/tasks/tools/included/install-kubectl-windows.md b/content/es/docs/tasks/tools/included/install-kubectl-windows.md
> index 46a43a35ca..4665883943 100644
> --- a/content/es/docs/tasks/tools/included/install-kubectl-windows.md
> +++ b/content/es/docs/tasks/tools/included/install-kubectl-windows.md
> @@ -30,7 +30,7 @@ Existen los siguientes métodos para instalar kubectl en Windows:
> O si tiene `curl` instalado, use este comando:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe
> + curl -LO https://dl.k8s.io/release/{{% param "fullversion" %}}/bin/windows/amd64/kubectl.exe
> ```
>  
> {{< note >}}
> @@ -42,7 +42,7 @@ Existen los siguientes métodos para instalar kubectl en Windows:
> Descargue el archivo de comprobación de kubectl:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe.sha256
> + curl -LO https://dl.k8s.io/{{% param "fullversion" %}}/bin/windows/amd64/kubectl.exe.sha256
> ```
>  
> Valide el binario kubectl con el archivo de comprobación:
> @@ -148,7 +148,7 @@ A continuación se muestran los procedimientos para configurar el autocompletado
> 1. Descargue la última versión con el comando:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe
> + curl -LO https://dl.k8s.io/release/{{% param "fullversion" %}}/bin/windows/amd64/kubectl-convert.exe
> ```
>  
> 1. Validar el binario (opcional)
> @@ -156,7 +156,7 @@ A continuación se muestran los procedimientos para configurar el autocompletado
> Descargue el archivo de comprobación kubectl-convert:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe.sha256
> + curl -LO https://dl.k8s.io/{{% param "fullversion" %}}/bin/windows/amd64/kubectl-convert.exe.sha256
> ```
>  
> Valide el binario kubectl-convert con el archivo de comprobación:
> @@ -187,4 +187,4 @@ A continuación se muestran los procedimientos para configurar el autocompletado
>  
> ## {{% heading "whatsnext" %}}
>  
> -{{< include "kubectl-whats-next.md" >}}
> \ No newline at end of file
> +{{< include "kubectl-whats-next.md" >}}
> diff --git a/content/hi/docs/tasks/tools/install-kubectl-windows.md b/content/hi/docs/tasks/tools/install-kubectl-windows.md
> index 5af06aaf32..7632d08486 100644
> --- a/content/hi/docs/tasks/tools/install-kubectl-windows.md
> +++ b/content/hi/docs/tasks/tools/install-kubectl-windows.md
> @@ -27,7 +27,7 @@ Windows पर kubectl संस्थापित करने के लिए
> या यदि आपके पास `curl` है, तो इस कमांड का उपयोग करें:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe
> + curl -LO https://dl.k8s.io/release/{{% param "fullversion" %}}/bin/windows/amd64/kubectl.exe
> ```
>  
> {{< note >}}
> @@ -39,7 +39,7 @@ Windows पर kubectl संस्थापित करने के लिए
> kubectl चेकसम फाइल डाउनलोड करें:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl.exe.sha256
> + curl -LO https://dl.k8s.io/{{% param "fullversion" %}}/bin/windows/amd64/kubectl.exe.sha256
> ```
>  
> चेकसम फ़ाइल से kubectl बाइनरी को मान्य करें:
> @@ -143,7 +143,7 @@ kubectl Bash और Zsh के लिए ऑटोकम्प्लेशन 
> 1. इस कमांड से नवीनतम रिलीज डाउनलोड करें:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/release/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe
> + curl -LO https://dl.k8s.io/release/{{% param "fullversion" %}}/bin/windows/amd64/kubectl-convert.exe
> ```
>  
> 1. बाइनरी को मान्य करें (वैकल्पिक)
> @@ -151,7 +151,7 @@ kubectl Bash और Zsh के लिए ऑटोकम्प्लेशन 
> kubectl-convert चेकसम फ़ाइल डाउनलोड करें:
>  
> ```powershell
> - curl -LO https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubectl-convert.exe.sha256
> + curl -LO https://dl.k8s.io/{{% param "fullversion" %}}/bin/windows/amd64/kubectl-convert.exe.sha256
> ```
>  
> चेकसम फ़ाइल से kubectl-convert बाइनरी को मान्य करें:
> diff --git a/content/ja/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md b/content/ja/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md
> index 3cd7ec82e0..44c93132a5 100644
> --- a/content/ja/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md
> +++ b/content/ja/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md
> @@ -147,7 +147,7 @@ Windowsワーカーノードの(管理者)権限を持つPowerShell環境で実
>  
> ```PowerShell
> curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
> - .\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}}
> + .\PrepareNode.ps1 -KubernetesVersion {{% param "fullversion" %}}
> ```
>  
> 1. `kubeadm`を実行してノードに参加します
> diff --git a/content/ja/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md b/content/ja/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md
> index 1deed73121..a989e2098f 100644
> --- a/content/ja/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md
> +++ b/content/ja/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md
> @@ -32,8 +32,8 @@ Windowsノードをアップグレードする前にコントロールプレー
> 1. Windowsノードから、kubeadmをアップグレードします。:
>  
> ```powershell
> - # {{< param "fullversion" >}}を目的のバージョンに置き換えます
> - curl.exe -Lo C:\k\kubeadm.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubeadm.exe
> + # {{% param "fullversion" %}}を目的のバージョンに置き換えます
> + curl.exe -Lo C:\k\kubeadm.exe https://dl.k8s.io/{{% param "fullversion" %}}/bin/windows/amd64/kubeadm.exe
> ```
>  
> ### ノードをドレインする
> @@ -67,7 +67,7 @@ Windowsノードをアップグレードする前にコントロールプレー
>  
> ```powershell
> stop-service kubelet
> - curl.exe -Lo C:\k\kubelet.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubelet.exe
> + curl.exe -Lo C:\k\kubelet.exe https://dl.k8s.io/{{% param "fullversion" %}}/bin/windows/amd64/kubelet.exe
> restart-service kubelet
> ```
>  
> @@ -88,5 +88,3 @@ Windowsノードをアップグレードする前にコントロールプレー
> ```shell
> curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/kube-proxy.yml | sed 's/VERSION/{{< param "fullversion" >}}/g' | kubectl apply -f -
> ```
> -
> -
> 
> ````

I would hold off on making any changes until we have some resolution on the related issue:  
[https://github.com/gohugoio/hugo/issues/10819](https://github.com/gohugoio/hugo/issues/10819)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 12, 2023, 3:00pm UTC](https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387/4 "2023-03-12T15:00:37Z")

</div>

bep fixed this in v0.111.3, released earlier today.

> [@jmooring](#):
>
> which to me makes a lot more sense than using the `{{< >}}` notation

To clarify…

When you do _this_, whatever the shortcode produces is _not_ passed through the syntax highlighter:

````plaintext
```somelang
{{< my-shortcode >}}
```

````

When you do _this_, whatever the shortcode produces _is_ passed through the syntax highlighter:

````plaintext
```somelang
{{% my-shortcode %}}
```

````

---

<div class="post-metadata">

**Author:** ![craigbox](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/craigbox/32/11498_2.png) [@craigbox](https://discourse.gohugo.io/u/craigbox)\
**Post date:** [March 12, 2023, 9:17pm UTC](https://discourse.gohugo.io/t/unknown-shortcode-token-error-in-v0-111-x/43387/5 "2023-03-12T21:17:09Z")

</div>

Thanks Joe and Bjørn!
