I am quite new to Hugo and trying to understand it through documentation and other things. I am creating a simple shortcode
which I would like to include within my page but for some reason the shortcode is not rendered within my page at all.
Following is my shortcode in: layouts\shortcodes\plain.html
:
{{ .Page.File.Ext }}
{{ . }}
{{ .Get "title" }}
{{ .Get "linkTitle" }}
<div>
{{ .Inner }}
</div>
Following is my content which I want to add to my HTML page: \content\en\_index.html
:
+++
title = "Home-Test"
linkTitle = "Home-Test"
+++
{{< plain >}}
<h1>HELLO FROM BLOCKS SHORTCODES</h1>
{{< /plain >}}
Following is my index.html from baseof layouts\_default\baseof.html
:
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js">
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ partial "loader.html" . }}
<header>
{{ partial "navbar.html" . }}
</header>
<main>
{{ block "plain" . }}{{ end }}
</main>
<footer>
{{ partial "footer.html" . }}
</footer>
{{ partialCached "scripts.html" . }}
</body>
</html>
I would expect my content provided <h1>HELLO FROM BLOCKS SHORTCODES</h1>
should be displayed on the HTML page rendered by the Hugo but its not displayed. Can someone please correct me what am I doing wrong here?