Conditionals in head

I want to load a different link in the head based on the current URL.


{{ if eq <current url> "<url>" }}
            <link rel="alternate" hreflang="en" href="{{ replace .Permalink "/de/" "/en/" }}"/>

What I can’t figure out is the the <current url> and <url> bit.

I’ve used conditionals before based on the MD title in the front matter. But can’t figure out how to do it for urls.

My goal is to load a different bit on various subpages. I’m using blocks and baseof to define my templates. What I want is to load a different bit in the head based on the subpage.

Alternatively, if this can be done with blocks than even better.

You might want to just use a multilingual config. That doc will have some context for what you are trying to do, as well.

Can you show an example of that template being filled out? Are you aware of .Permalink and .URL?