{{ if eq .card_type "upcoming" }}
    {{ with .context }}
    {{ $tag_color := .Site.Params.categories_colors }}

        <div class="postcard">
        {{ if ne (.Params.eventStartDate) (.Params.eventEndDate) }}
            <div class="eventdate">
            {{ dateFormat "2 Jan, 2006" .Params.eventStartDate }}  -  {{ dateFormat "2 Jan, 2006" .Params.eventEndDate }}
            </div>
        {{ else }} {{/* if eventStartDate == eventEndDate  */}}
            <div class="eventdate">
            {{ dateFormat "2 Jan, 2006" .Params.eventEndDate }}
            </div>
        {{ end }}

        <h2 class="post-title">{{ .Title }}</h2>
        {{ if .Params.tags }}
            {{ $numtags := len .Params.tags }}
            {{ $first_tag := index .Params.tags 0 }}
            {{ if gt $numtags 0 }} {{ if ne $first_tag "" }}
                <div class="tags"> {{/* --if-- insert tag box */}}                    {{ range .Params.tags }}
                    {{ $param_tag_name := . }}
                    <a href="{{ $.Site.BaseURL | relLangURL }}tags/{{ lower $param_tag_name }}/" class="tagbutton {{ $param_tag_name }}">{{ $param_tag_name }}</a>
                {{ end }} {{/* --end-- insert tag box */}}
                </div>
            {{ end }} {{ end }}
        {{ end }}
        <div class="postcard-content">
        <p>{{ .Content }}</p>
        </div>
        <div class="date">
        Posted on {{ dateFormat "2 Jan, 2006" .Date }}
        </div>
        <p><a href="{{ .Permalink }}" class="read-more">Read more...</a></p>

        </div>

    {{ end }} {{/* --end-- with */}}

{{ else if eq .card_type "normal" }}
    {{ with .context }}
    {{ $tag_color := .Site.Params.categories_colors }}
        <div class="postcard">
        <h2 class="post-title">{{ .Title }}</h2>
        {{ if .Params.tags }}
            {{ $numtags := len .Params.tags }}
            {{ $first_tag := index .Params.tags 0 }}
            {{ if gt $numtags 0 }} {{ if ne $first_tag "" }}
                <div class="tags">
                {{ range .Params.tags }}
                    {{ $param_tag_name := . }}
                    <a href="{{ $.Site.BaseURL | relLangURL }}tags/{{ lower $param_tag_name }}/" class="tagbutton {{ $param_tag_name }}">{{ $param_tag_name }}</a>
                {{ end }}
                </div>
            {{ end }} {{ end }}
        {{ end }}
        <div class="postcard-content">
        <p>{{ .Content }}</p>
        </div>
        <div class="date">
        Posted on {{ dateFormat "2 Jan, 2006" .Date }}
        </div>
        <p><a href="{{ .Permalink }}" class="read-more">Read more...</a></p>
        </div>
    {{ end }}

{{ else if eq .card_type "simple" }}
    {{ with .context }}
    {{ $tag_color := .Site.Params.categories_colors }}
        <div class="postcard">
        <h2 class="post-title">{{ .Title }}</h2>
        <div class="postcard-content">
          <p>{{ .Content }}</p>
        </div>
        <div class="date">
        Posted on {{ dateFormat "2 Jan, 2006" .Date }}
        </div>
        <p><a href="{{ .Permalink }}" class="read-more">Read more...</a></p>
        </div>
    {{ end }}
{{ end }}
