Unknown shortcode token error in v0.111.x

The Kubernetes website builds with 0.110 but not 0.111. I’ve sent a PR 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

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

All the headings are defined in ja.toml:

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

The full source is at GitHub - kubernetes/website: Kubernetes website and documentation repo:.

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.

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 --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

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

To clarify…

When you do this, whatever the shortcode produces is not passed through the syntax highlighter:

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

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

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

Thanks Joe and Bjørn!