mirror of
https://github.com/lmika/postlist-for-micro.blog.git
synced 2025-08-02 15:56:08 +00:00
Added limit option and display option
This commit is contained in:
parent
d94e08674f
commit
79e4f94a6c
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.DS_Store
|
18
layouts/partials/_postlist/post-content.html
Normal file
18
layouts/partials/_postlist/post-content.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="h-entry">
|
||||||
|
{{ if .Title }}
|
||||||
|
<h2 class="p-name"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
|
||||||
|
{{ if .Params.custom_summary }}
|
||||||
|
<div class="p-summary">
|
||||||
|
<p>{{ .Summary | safeHTML }}<p>
|
||||||
|
</div>
|
||||||
|
{{ else }}
|
||||||
|
<div class="e-content">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
<div class="e-content">
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
|
@ -18,14 +18,26 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
<ul class="postlist">
|
{{- if (ne (.Get "limit") "") -}}
|
||||||
{{ range $pgr }}
|
{{- $pgr = $pgr.Limit (int (.Get "limit")) -}}
|
||||||
{{- if (ne .LinkTitle "") -}}
|
{{- end -}}
|
||||||
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
|
||||||
{{- else if (ne .Summary "") -}}
|
{{- if (eq (.Get "display") "content") -}}
|
||||||
<li><a href="{{ .RelPermalink }}">{{ .Summary | safeHTML | truncate 70 }}</a></li>
|
<div class="postlist postlist-display-content h-feed">
|
||||||
|
{{ range $pgr }}
|
||||||
|
{{ partial "_postlist/post-content.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<li><a href="{{ .RelPermalink }}">{{ .Content | safeHTML | truncate 70 }}</a></li>
|
<ul class="postlist">
|
||||||
{{ end }}
|
{{ range $pgr }}
|
||||||
{{ end }}
|
{{- if (ne .LinkTitle "") -}}
|
||||||
</ul>
|
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- else if (ne .Summary "") -}}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Summary | safeHTML | truncate 70 }}</a></li>
|
||||||
|
{{- e\lse -}}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Content | safeHTML | truncate 70 }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{- end -}}
|
Loading…
Reference in a new issue