_sidebar.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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">
  14. <a href={{ link $lang $link }}>{{ .Title }}</a>
  15. </div>
  16. <a class="post-content" href={{ link $lang $link }}>
  17. {{ if .PreviewText }}
  18. <p>{{ noescape .PreviewText }}</p>
  19. {{ end }}
  20. <span class="date-comment">{{ .PublishTime }}</span>
  21. </a>
  22. </li>
  23. {{ end }}
  24. </ul>
  25. </div>
  26. {{ end }}
  27. {{ if .sidebarTags }}
  28. <div class="col-md-12 widget-tags top_45">
  29. <div class="widget-title">
  30. <h2 class="upper">{{ trans .lang "tags"}}</h2>
  31. </div>
  32. <ul class="top_15">
  33. {{ range .sidebarTags }}
  34. <li>
  35. {{ $link := concat "/tag/" .URL }}
  36. <a href={{ link $lang $link }}>{{ .Tag }}</a>
  37. </li>
  38. {{ end }}
  39. </ul>
  40. </div>
  41. {{ end }}
  42. </div>
  43. </div>