A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
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.
 
 
 
 
 

57 lines
1.4 KiB

  1. {{define "stats"}}
  2. {{template "header" .}}
  3. <style>
  4. table.classy th { text-align: left }
  5. table.classy th.num { text-align: right }
  6. td + td {
  7. padding-left: 0.5em;
  8. padding-right: 0.5em;
  9. }
  10. td.num {
  11. text-align: right;
  12. }
  13. table.classy.export a { text-transform: inherit; }
  14. td.none {
  15. font-style: italic;
  16. }
  17. </style>
  18. <div class="content-container snug">
  19. {{if .Silenced}}
  20. {{template "user-silenced"}}
  21. {{end}}
  22. <h2 id="posts-header">{{if .Collection}}{{.Collection.DisplayTitle}} {{end}}Stats</h2>
  23. <p>Stats for all time.</p>
  24. {{if .Federation}}
  25. <h3>Fediverse stats</h3>
  26. <table id="fediverse" class="classy export">
  27. <tr>
  28. <th>Followers</th>
  29. </tr>
  30. <tr>
  31. <td>{{.APFollowers}}</td>
  32. </tr>
  33. </table>
  34. {{end}}
  35. <h3>Top {{len .TopPosts}} posts</h3>
  36. <table class="classy export">
  37. <tr>
  38. <th>Post</th>
  39. {{if not .Collection}}<th>Blog</th>{{end}}
  40. <th class="num">Total Views</th>
  41. </tr>
  42. {{range .TopPosts}}<tr>
  43. <td style="word-break: break-all;"><a href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}/{{.ID}}{{end}}">{{if ne .Title.String ""}}{{.Title.String}}{{else}}<em>{{.ID}}</em>{{end}}</a></td>
  44. {{ if not $.Collection }}<td>{{if .Collection}}<a href="{{.Collection.CanonicalURL}}">{{.Collection.Title}}</a>{{else}}<em>Draft</em>{{end}}</td>{{ end }}
  45. <td class="num">{{.ViewCount}}</td>
  46. </tr>{{end}}
  47. </table>
  48. </div>
  49. {{template "footer" .}}
  50. {{end}}