_sidebar.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{ $lang := .lang }}
  2. <div class="sidebar col-md-3">
  3. <div class="row">
  4. {{ if .sidebarArticles }}
  5. <div class="col-md-12 widget-posts top_45">
  6. <div class="widget-title">
  7. <h2 class="upper">{{ trans .lang "recent_articles"}}</h2>
  8. </div>
  9. <ul class="sidebar-posts">
  10. {{ range .sidebarArticles }}
  11. <li>
  12. {{ $link := concat "/article/" .URL }}
  13. <div class="title"><a href={{ link $lang $link }}>{{ .Title }}</a></div>
  14. <a class="post-content" href={{ link $lang $link }}>
  15. {{ if .PreviewText }}<p>{{ noescape .PreviewText }}</p>{{ end }}
  16. <span class="date-comment">{{ .PublishTime }}</span>
  17. </a>
  18. </li>
  19. {{ end }}
  20. </ul>
  21. </div>
  22. {{ end }}
  23. {{ if .sidebarTags }}
  24. <div class="col-md-12 widget-tags top_45">
  25. <div class="widget-title">
  26. <h2 class="upper">{{ trans .lang "tags"}}</h2>
  27. </div>
  28. <ul class="top_15">
  29. {{ range .sidebarTags }}
  30. <li>
  31. {{ $link := concat "/tag/" .URL }}
  32. <a href={{ link $lang $link }}>{{ .Tag }}</a>
  33. </li>
  34. {{ end }}
  35. </ul>
  36. </div>
  37. {{ end }}
  38. </div>
  39. </div>