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.
 
 
 
 
 

128 lines
5.7 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. margin: 0 0 0 1em !important;
  66. }
  67. header nav#user-nav {
  68. margin-left: 0 !important;
  69. }
  70. </style>
  71. {{end}}
  72. {{define "body-attrs"}}id="collection"{{end}}
  73. {{define "content"}}
  74. <div class="content-container snug" style="max-width: 40rem;">
  75. <h1 style="text-align:center">Reader</h1>
  76. <p>Read the latest posts from {{.SiteName}}. {{if .Username}}To showcase your writing here, go to your <a href="/me/c/">blog</a> settings and select the <em>Public</em> option.{{end}}</p>
  77. </div>
  78. <div id="wrapper">
  79. {{ if gt (len .Posts) 0 }}
  80. <section itemscope itemtype="http://schema.org/Blog">
  81. {{range .Posts}}<article class="{{.Font}} h-entry" itemscope itemtype="http://schema.org/BlogPosting">
  82. {{if .Title.String}}<h2 class="post-title" itemprop="name" class="p-name"><a href="{{if .Slug.String}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL}}.md{{end}}" itemprop="url" class="u-url">{{.PlainDisplayTitle}}</a></h2>
  83. <time class="dt-published" datetime="{{.Created}}" 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>
  84. {{else}}
  85. <h2 class="post-title" itemprop="name"><time class="dt-published" datetime="{{.Created}}" pubdate itemprop="datePublished" content="{{.Created}}"><a href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL}}.md{{end}}" itemprop="url" class="u-url">{{.DisplayDate}}</a></time></h2>
  86. {{end}}
  87. <p class="source">{{if .Collection}}from <a href="{{.Collection.CanonicalURL}}">{{.Collection.DisplayTitle}}</a>{{else}}<em>Anonymous</em>{{end}}</p>
  88. {{if .Excerpt}}<div class="p-summary" {{if .Language}}lang="{{.Language.String}}"{{end}} dir="{{.Direction}}">{{.Excerpt}}</div>
  89. <a class="read-more" href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL}}.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>
  90. <a class="read-more maybe" href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}{{.CanonicalURL}}.md{{end}}">{{localstr "Read more..." .Language.String}}</a>{{end}}</article>
  91. {{end}}
  92. </section>
  93. {{ else }}
  94. <div class="attention-box">
  95. <p>No posts here yet!</p>
  96. </div>
  97. {{ end }}
  98. {{if gt .TotalPages 1}}<nav id="paging" class="content-container clearfix">
  99. {{if lt .CurrentPage .TotalPages}}<a href="{{.NextPageURL .CurrentPage}}">&#8672; Older</a>{{end}}
  100. {{if gt .CurrentPage 1}}<a style="float:right;" href="{{.PrevPageURL .CurrentPage}}">Newer &#8674;</a>{{end}}
  101. </nav>{{end}}
  102. </div>
  103. <script type="text/javascript">
  104. (function() {
  105. var $articles = document.querySelectorAll('article');
  106. for (var i=0; i<$articles.length; i++) {
  107. var $art = $articles[i];
  108. var $more = $art.querySelector('.read-more.maybe');
  109. if ($more != null) {
  110. if ($art.querySelector('.e-content.preview').clientHeight < 180) {
  111. $more.parentNode.removeChild($more);
  112. var $overlay = $art.querySelector('.over');
  113. $overlay.parentNode.removeChild($overlay);
  114. }
  115. }
  116. }
  117. })();
  118. </script>
  119. {{end}}