Fix broken links to event items on translated top page.

If there is no translated event entry, these links should be to
the original English entry.
This commit is contained in:
Ryusuke SUZUKI 2021-02-21 12:12:55 +09:00
parent 20f83c0421
commit bdb3189d38

View file

@ -18,7 +18,7 @@
<p>
<span class="txtdate">{{ dateFormat "2006-01-02" .startDate }} - {{ dateFormat "2006-01-02" .endDate }}</span>
<br />
<a href="{{.Site.BaseURL | relLangURL }}events/#{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}">
<a href="{{ if (fileExists $eventsPath) -}}{{ .Site.BaseURL | relLangURL }}{{ else }}{{ $.Site.BaseURL }}{{- end }}events/#{{ dateFormat "2006-01" .endDate }}:{{ $eventsCounter }}">
{{ .name }}
<br />
{{ if or (.city) (.country) }}({{end}}{{ if .city }}{{ .city }},{{ end }} {{ if .country }}{{ .country }}{{ end }}{{ if or (.city) (.country) }}){{end}}