I'm working on some blog code (written by someone else) which lists all posts into the main index.html file. I want to exclude one file (welcome.md) from this listing. I believe this is the relevant code that does this -
{{$l := len .}}
{{range $i, $e := .}}
<h3><a href="/{{$e.Title | slug}}.html">{{$e.Title}}</a></h3>
Is it possible?
Update - Here is my full code, I left some out of the above -
{{define "title"}}
Test
{{end}}
{{define "content"}}
<h1>Heading</h1>
{{$l := len .}}
{{range $i, $e := .}}
{{- if ne $e.Title "welcome" -}}
<h3><a href="/{{$e.Title | slug}}.html">{{$e.Title}}</a></h3>
{{- end }}
<small>
<em>
{{$e.Written.Format "Jan 2, 2006"}}
Tags: {{range $e.Tags}}
<a href="/tags/{{. | slug}}.html" title="Posts Tagged {{.}}">{{.}}</a>
{{end}}
</em>
</small>
{{(printf "%s </br><small>[Read more](/%s.html)</small>" ($e.Content | summary) (.Title | slug)) | html}}
{{end}}
{{end}}