Breadcrumbs in the Post

Hello. I have such code on my post


title: “Diet for High Blood Pressure: Eliminate Salt and Alcohol!”

description: “A high blood pressure diet will reduce the risk of serious illness and bring your blood pressure back to normal. Start now!”

image: /images/2017/08/168.jpg

imagepost: /images/2017/08/168-200x152.jpg

date: 2013-03-27

tags: [“diet”]

type: post

showTableOfContents: false

pretitle: High blood pressure diet

pretext: “A diet with high blood pressure will reduce the possibility of serious diseases and bring pressure back to normal. Start now!”


So, using this code

    <ul>
        <li><a href="/">
                👨‍🍳 {{ .Site.Params.Name }} /
            </a></li>
        <li><a href="/">
                here i need to use Pretitle of Category
            </a></li>
        <li><a href="/">
                {{ .Params.Pretitle }}
            </a></li>
    </ul>

I have such picture

I indicated place where i need to use params.pretitle from my _index.en.md file, witch has next info:


title: Salads are a wonderful addition to the second course

description: Salads are a wonderful addition to the second course. These include meat, fish, vegetable, fruit … All salads cannot be counted. In the process of preparing a salad, it can be supplemented to taste with your favorite ingredients …

type: post

pretitle: Salads


i need to use params.pretitle from my _index.en.md.
I need use it inside my Post template pretitle: Salads.
Who knows how to do it?

HELP PLEASE))

from memory, I think you need something like this:

{{ with .Params.pretitle }}{{ . }}{{end}}

Not working.

When i use

    <ul>
        <li><a href="/">
                👨‍🍳 {{ .Site.Params.Name }} /
            </a></li>
        <li><a href="/">
                {{ with .Params.pretitle }}{{ . }}{{end}}
            </a></li>
        <li><a href="/">
                {{ .Params.Pretitle }}
            </a></li>
    </ul>

i have such picture

its added Params.pretitle of the page. But, i need category pretitle - its “diet”.
Have any variants?

I found like this

    {{ template "breadcrumbnav" (dict "p1" .) }}
    </ol>
    {{ define "breadcrumbnav" }}
    {{ if .p1.Parent }}
    {{ template "breadcrumbnav" (dict "p1" .p1.Parent ) }}
    {{ end }}
    {{ $anchorContent := .p1.Params.PreTitle }}
    {{ $anchorContent }}
    </li>
    {{ end }}

But when i use it its very long and get me title, which not need to me. I show it on the photo below. Help please.

do you have your code somewhere?

    <ul>
        <li><a href="/">
                👨‍🍳 {{ .Site.Params.Name }} /
            </a></li>
        <li><a href="/">
                {{ with .Params.pretitle }}{{ . }}{{end}}
            </a></li>
        <li><a href="/">
                {{ .Params.Pretitle }}
            </a></li>
    </ul>
   {{ template "breadcrumbnav" (dict "p1" .) }}
    </ol>
    {{ define "breadcrumbnav" }}
    {{ if .p1.Parent }}
    {{ template "breadcrumbnav" (dict "p1" .p1.Parent ) }}
    {{ end }}
    {{ $anchorContent := .p1.Params.PreTitle }}
    {{ $anchorContent }}
    </li>
    {{ end }}