{{ $lang := .lang }}
<div class="sidebar col-md-3">
    <div class="row">
        {{ if .sidebarArticles }}
        <div class="col-md-12 widget-posts top_45">
            <div class="widget-title">
                <h2 class="upper">{{ trans .lang "recent_articles"}}</h2>
            </div>
            <ul class="sidebar-posts">
                {{ range .sidebarArticles }}
                <li>
                    {{ $link := concat "/article/" .URL }}
                    <div class="title"><a href={{ link $lang $link }}>{{ .Title }}</a></div>
                    <a class="post-content" href={{ link $lang $link }}>
                        {{ if .PreviewText }}<p>{{ noescape .PreviewText }}</p>{{ end }}
                        <span class="date-comment">{{ .PublishTime }}</span>
                    </a>
                </li>
                {{ end }}
            </ul>
        </div>
        {{ end }}

        {{ if .sidebarTags }}
        <div class="col-md-12 widget-tags top_45">
            <div class="widget-title">
                <h2 class="upper">{{ trans .lang "tags"}}</h2>
            </div>
            <ul class="top_15">
                {{ range .sidebarTags }}
                <li>
                    {{ $link := concat "/tag/" .URL }}
                    <a href={{ link $lang $link }}>{{ .Tag }}</a>
                </li>
                {{ end }}
            </ul>
        </div>
        {{ end }}
    </div>
</div>