Browse Source

support summaries for long posts

Lennart Weller 2 years ago
parent
commit
eb1b2f95c7

+ 1
- 1
themes/ring0/layouts/_default/list.html View File

@@ -1,7 +1,7 @@
1 1
 {{ partial "header.html" . }}
2 2
 
3 3
 {{ range (.Paginator 5).Pages }}
4
-	{{ partial "entry.html" . }}
4
+	{{ partial "summary.html" . }}
5 5
 {{ end }}
6 6
 <span id="main" class="clearfix" />
7 7
 

+ 1
- 1
themes/ring0/layouts/index.html View File

@@ -1,7 +1,7 @@
1 1
 {{ partial "header.html" . }}
2 2
 
3 3
 {{ range (.Paginator 5).Pages }}
4
-	{{ partial "entry.html" . }}
4
+	{{ partial "summary.html" . }}
5 5
 {{ end }}
6 6
 <span id="main" class="clearfix" />
7 7
 

+ 13
- 0
themes/ring0/layouts/partials/summary.html View File

@@ -0,0 +1,13 @@
1
+<div>
2
+<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
3
+	<span>tags: 
4
+		{{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}<a class='icon-tag' href="/tags/{{ $e | urlize}}">{{ $e }}</a>{{ end }}
5
+	</span>
6
+	<span>{{ .Date.Format "2006-01-02 15:04" }} by <a class="icon-user" href="/authors/{{ .Params.authors }}">{{ .Params.authors }}</a></span>
7
+	<p class="content">{{ .Summary }}</p>
8
+	{{ if .Truncated }}
9
+  <div class="read-more-link">
10
+    <a href="{{ .RelPermalink }}">Read More…</a>
11
+  </div>
12
+  {{ end }}
13
+</div>

+ 1
- 1
themes/ring0/static/css/global.css View File

@@ -145,7 +145,7 @@ code {
145 145
 }
146 146
 pre {
147 147
     display: block;
148
-    padding: 1rem 1.5rem;
148
+    padding: .5rem .5rem;
149 149
     white-space: pre;
150 150
 }
151 151
 

Loading…
Cancel
Save