post_preview.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <article class="post-preview">
  2. <a href="{{ .Permalink }}">
  3. <h2 class="post-title">{{ .Title }}</h2>
  4. {{ if .Params.subtitle }}
  5. <h3 class="post-subtitle">
  6. {{ .Params.subtitle }}
  7. </h3>
  8. {{ end }}
  9. {{ if .Params.image }}
  10. <img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" />
  11. {{ end }}
  12. {{ if .Params.video }}
  13. <video loop autoplay muted playsinline class="img-title">
  14. <source src="{{ .Params.video }}">
  15. </video>
  16. {{ end }}
  17. </a>
  18. <p class="post-meta">
  19. {{ partial "post_meta.html" . }}
  20. </p>
  21. <div class="post-entry">
  22. {{ if or (.Truncated) (.Params.summary) }}
  23. {{ .Summary }}
  24. <a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
  25. {{ else }}
  26. {{ .Content }}
  27. {{ end }}
  28. </div>
  29. {{ if .Params.tags }}
  30. <div class="blog-tags">
  31. {{ range .Params.tags }}
  32. <!-- Fix for "https://github.com/halogenica/beautifulhugo/issues/349".
  33. From "https://github.com/dovidio/personalwebsite/commit/34762e94c29fd2c26c16c45f8ae2de21bdf9b46d".
  34. <a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>&nbsp;
  35. -->
  36. <a href="{{"tags" | absLangURL}}/{{ . | urlize }}/">{{ . }}</a>&nbsp;
  37. {{ end }}
  38. </div>
  39. {{ end }}
  40. </article>