How do I check if the post .Content
contains a certain string? I am have tried the following code and none of them work.
- Using
in
{{ if in .Content "<!--more-->"}}
<span>MORE!!!</span>
{{else}}
<span>NO MORE!!!</span>
{{end}}
- Using
strings.Contains
(Any reason this function is not listed in the documentation)
{{ if strings.Contains .Content "<!--more-->"}}
<span>MORE!!!</span>
{{else}}
<span>NO MORE!!!</span>
{{end}}
Both options end up in NO MORE!!!
What am I missing?