mirror of
https://github.com/lmika/postlist-for-micro.blog.git
synced 2025-07-01 16:59:03 +00:00
Initial commit
This commit is contained in:
parent
891b767c61
commit
56295d02ba
21
layouts/shortcodes/postlist.html
Normal file
21
layouts/shortcodes/postlist.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{{- $pgr := where .Site.RegularPages "Section" "ne" "" -}}
|
||||||
|
{{- $pgr = where $pgr "Section" "not in" (slice "replies") -}}
|
||||||
|
{{- if (.Get "categories") -}}
|
||||||
|
{{- range (split (.Get "categories") ",") -}}
|
||||||
|
{{- $pgr = (where $pgr "Params.categories" "intersect" (slice .)) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if (eq (.Get "order") "link-title" ) -}}
|
||||||
|
{{- $pgr = $pgr.ByLinkTitle -}}
|
||||||
|
{{- end -}}
|
||||||
|
<ul class="postlist">
|
||||||
|
{{ range $pgr }}
|
||||||
|
{{- if (ne .LinkTitle "") -}}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- else if (ne .Summary "") -}}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Summary | safeHTML | truncate 70 }}</a></li>
|
||||||
|
{{- else -}}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .Content | safeHTML | truncate 70 }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
4
static/postlist.css
Normal file
4
static/postlist.css
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
ul.postlist {
|
||||||
|
list-style: none;
|
||||||
|
padding-inline-start: 0;
|
||||||
|
}
|
Loading…
Reference in a new issue