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.
 
 
 
 
 

143 lines
6.0 KiB

  1. {{define "head"}}<title>{{.SiteName}} Reader</title>
  2. <link rel="alternate" type="application/rss+xml" title="{{.SiteName}} Reader" href="/read/feed/" />
  3. {{if gt .CurrentPage 1}}<link rel="prev" href="{{.PrevPageURL .CurrentPage}}">{{end}}
  4. {{if lt .CurrentPage .TotalPages}}<link rel="next" href="{{.NextPageURL .CurrentPage}}">{{end}}
  5. <meta name="description" content="Read the latest posts from {{.SiteName}}.">
  6. <meta itemprop="name" content="{{.SiteName}} Reader">
  7. <meta itemprop="description" content="Read the latest posts from {{.SiteName}}.">
  8. <meta name="twitter:card" content="summary_large_image">
  9. <meta name="twitter:title" content="{{.SiteName}} Reader">
  10. <meta name="twitter:description" content="Read the latest posts from {{.SiteName}}.">
  11. <meta property="og:title" content="{{.SiteName}} Reader" />
  12. <meta property="og:type" content="object" />
  13. <meta property="og:description" content="Read the latest posts from {{.SiteName}}." />
  14. <style>
  15. .heading h1 {
  16. font-weight: 300;
  17. text-align: center;
  18. margin: 3em 0 0;
  19. }
  20. .heading p {
  21. text-align: center;
  22. margin: 1.5em 0 4.5em;
  23. font-size: 1.1em;
  24. color: #777;
  25. }
  26. #wrapper {
  27. font-size: 1.2em;
  28. }
  29. .preview {
  30. max-height: 180px;
  31. overflow: hidden;
  32. position: relative;
  33. }
  34. .preview .over {
  35. position: absolute;
  36. top: 5em;
  37. bottom: 0;
  38. left: 0;
  39. right: 0;
  40. /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,1+100 */
  41. background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); /* FF3.6-15 */
  42. background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10-25,Safari5.1-6 */
  43. background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  44. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
  45. }
  46. p.source {
  47. font-size: 0.86em;
  48. margin-top: 0.25em;
  49. margin-bottom: 0;
  50. }
  51. .attention-box {
  52. text-align: center;
  53. font-size: 1.1em;
  54. }
  55. .attention-box hr { margin: 4rem auto; }
  56. hr { max-width: 40rem; }
  57. header {
  58. padding: 0 !important;
  59. text-align: left !important;
  60. margin: 1em !important;
  61. max-width: 100% !important;
  62. }
  63. body#collection header nav {
  64. display: inline !important;
  65. }
  66. body#collection header nav:not(#full-nav):not(#user-nav) {
  67. margin: 0 0 0 1em !important;
  68. }
  69. header nav#user-nav {
  70. margin-left: 0 !important;
  71. }
  72. body#collection header nav.tabs a:first-child {
  73. margin-left: 1em;
  74. }
  75. body#collection article {
  76. max-width: 40em !important;
  77. }
  78. </style>
  79. {{end}}
  80. {{define "body-attrs"}}id="collection"{{end}}
  81. {{define "content"}}
  82. <div class="content-container snug">
  83. <h1>{{.ContentTitle}}</h1>
  84. <p{{if .SelTopic}} style="text-align:center"{{end}}>{{if .SelTopic}}#{{.SelTopic}} posts{{else}}{{.Content}}{{end}}</p>
  85. </div>
  86. <div id="wrapper">
  87. {{ if gt (len .Posts) 0 }}
  88. <section itemscope itemtype="http://schema.org/Blog">
  89. {{range .Posts}}<article class="{{.Font}} h-entry" itemscope itemtype="http://schema.org/BlogPosting">
  90. {{if .Title.String -}}
  91. <h2 class="post-title" itemprop="name" class="p-name">
  92. {{- if .IsPaid}}{{template "paid-badge" .}}{{end -}}
  93. <a href="{{if .Slug.String}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL .Host}}.md{{end}}" itemprop="url" class="u-url">{{.PlainDisplayTitle}}</a>
  94. </h2>
  95. <time class="dt-published" datetime="{{.Created8601}}" pubdate itemprop="datePublished" content="{{.Created}}">{{if not .Title.String}}<a href="{{.Collection.CanonicalURL}}{{.Slug.String}}" itemprop="url">{{end}}{{.DisplayDate}}{{if not .Title.String}}</a>{{end}}</time>
  96. {{- else -}}
  97. <h2 class="post-title" itemprop="name">
  98. {{- if .IsPaid}}{{template "paid-badge" .}}{{end -}}
  99. <time class="dt-published" datetime="{{.Created8601}}" pubdate itemprop="datePublished" content="{{.Created}}"><a href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL .Host}}.md{{end}}" itemprop="url" class="u-url">{{.DisplayDate}}</a></time>
  100. </h2>
  101. {{- end}}
  102. <p class="source">{{if .Collection}}from <a href="{{.Collection.CanonicalURL}}">{{.Collection.DisplayTitle}}</a>{{else}}<em>Anonymous</em>{{end}}</p>
  103. {{if .Excerpt}}<div class="p-summary" {{if .Language}}lang="{{.Language.String}}"{{end}} dir="{{.Direction}}">{{.Excerpt}}</div>
  104. <a class="read-more" href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL .Host}}.md{{end}}">{{localstr "Read more..." .Language.String}}</a>{{else}}<div class="e-content preview" {{if .Language}}lang="{{.Language.String}}"{{end}} dir="{{.Direction}}">{{ if not .HTMLContent }}<p id="post-body" class="e-content preview">{{.Content}}</p>{{ else }}{{.HTMLContent}}{{ end }}<div class="over">&nbsp;</div></div>
  105. <a class="read-more maybe" href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL .Host}}.md{{end}}">{{localstr "Read more..." .Language.String}}</a>{{end}}</article>
  106. {{end}}
  107. </section>
  108. {{ else }}
  109. <div class="attention-box">
  110. <p>No posts here yet!</p>
  111. </div>
  112. {{ end }}
  113. {{if gt .TotalPages 1}}<nav id="paging" class="content-container clearfix">
  114. {{if lt .CurrentPage .TotalPages}}<a href="{{.NextPageURL .CurrentPage}}">&#8672; Older</a>{{end}}
  115. {{if gt .CurrentPage 1}}<a style="float:right;" href="{{.PrevPageURL .CurrentPage}}">Newer &#8674;</a>{{end}}
  116. </nav>{{end}}
  117. </div>
  118. <script src="/js/localdate.js">
  119. <script type="text/javascript">
  120. (function() {
  121. var $articles = document.querySelectorAll('article');
  122. for (var i=0; i<$articles.length; i++) {
  123. var $art = $articles[i];
  124. var $more = $art.querySelector('.read-more.maybe');
  125. if ($more != null) {
  126. if ($art.querySelector('.e-content.preview').clientHeight < 180) {
  127. $more.parentNode.removeChild($more);
  128. var $overlay = $art.querySelector('.over');
  129. $overlay.parentNode.removeChild($overlay);
  130. }
  131. }
  132. }
  133. })();
  134. </script>
  135. {{end}}