summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/README.md b/README.md
index 773f233..a04c9de 100644
--- a/README.md
+++ b/README.md
@@ -158,6 +158,35 @@ Payload {
})
```
+## Special filters
+
+- first (gets first N posts)
+- last (gets last N posts)
+- random (gets random N posts)
+
+```html
+<!-- First 10 pages -->
+{{ range first 10 .Pages }}
+ {{ if and (eq .Type "post") (not .Draft) }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+{{ end }}
+
+<!-- Last 10 pages -->
+{{ range last 10 .Pages }}
+ {{ if and (eq .Type "post") (not .Draft) }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+{{ end }}
+
+<!-- Random 10 pages -->
+{{ range random 10 .Pages }}
+ {{ if and (eq .Type "post") (not .Draft) }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+{{ end }}
+```
+
## License
[jbmafp](https://github.com/mitjafelicijan/jbmafp) was written by [Mitja