A web blog and personal homepage engine written in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 rivejä
1.6 KiB

  1. {{ define "title" }}{{ .V.post.Title }}{{ end }}
  2. {{ define "content" }}
  3. {{ $Post := .V.post }}
  4. <div class="card mb-4">
  5. <div class="card-header">
  6. <h1 class="blog-title">{{ $Post.Title }}</h1>
  7. </div>
  8. <div class="card-body">
  9. <small class="text-muted blog-meta"><em>
  10. {{ if $Post.Sticky }}<span class="blog-sticky">[sticky]</span>{{ end }}
  11. {{ if ne $Post.Privacy "public" }}
  12. <span class="blog-{{ $Post.Privacy }}">[{{ $Post.Privacy }}]</span>
  13. {{ end }}
  14. <span title="{{ $Post.CreatedAt.Format "Jan 2 2006 15:04:05 MST" }}">
  15. {{ $Post.CreatedAt.Format "January 2, 2006" }}
  16. </span>
  17. {{ if ($Post.UpdatedAt.After $Post.CreatedAt) }}
  18. <span title="{{ $Post.UpdatedAt.Format "Jan 2 2006 15:04:05 MST" }}">
  19. (updated {{ $Post.UpdatedAt.Format "January 2, 2006" }})
  20. </span>
  21. {{ end }}
  22. {{ if $Post.Author.Name }}
  23. by {{ $Post.Author.Name }}
  24. {{ end }}
  25. </em></small>
  26. <br><br>
  27. {{ $Post.HTML }}
  28. <div class="mt-4">
  29. <small class="text-muted"><em>
  30. Tags:
  31. {{ range $tag := $Post.Tags }}
  32. <a href="/tagged/{{ $tag.Tag }}" class="ml-2">#{{ $tag.Tag }}</a>
  33. {{ end }}
  34. </em></small>
  35. </div>
  36. </div>
  37. </div>
  38. {{ .CurrentUser }}
  39. {{ if .CurrentUser.IsAdmin }}
  40. <div class="alert alert-secondary">
  41. <strong>Admin:</strong>
  42. [
  43. <a href="/blog/edit?id={{ $Post.ID }}">edit</a> |
  44. <a href="/blog/delete?id={{ $Post.ID }}">delete</a>
  45. ]
  46. </div>
  47. {{ end }}
  48. {{ $idStr := printf "%d" $Post.ID }}
  49. {{ if $Post.EnableComments }}
  50. {{ RenderComments .ResponseWriter .Request $Post.Title "post" $idStr }}
  51. {{ else }}
  52. {{ RenderCommentsRO .ResponseWriter .Request "post" $idStr }}
  53. {{ end }}
  54. {{ end }}