summaryrefslogtreecommitdiffstats
path: root/docs/layouts/shortcodes
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-01-31 11:08:08 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-01-31 11:08:08 +0100
commit158e1151cdfbdebd2e4a527e828d8a0b17933787 (patch)
treeb73947184a82fe10366dbefe7e3f2d0e415ae801 /docs/layouts/shortcodes
parentf0c0ece44d55b6c2997cbd106d1bc099ea1a2fa7 (diff)
parent337d0c5f516ee085205e8abefdb7f87e6d33ca05 (diff)
Diffstat (limited to 'docs/layouts/shortcodes')
-rw-r--r--docs/layouts/shortcodes/datatable-filtered.html28
-rw-r--r--docs/layouts/shortcodes/imgproc.html10
2 files changed, 36 insertions, 2 deletions
diff --git a/docs/layouts/shortcodes/datatable-filtered.html b/docs/layouts/shortcodes/datatable-filtered.html
new file mode 100644
index 000000000..576ddab6f
--- /dev/null
+++ b/docs/layouts/shortcodes/datatable-filtered.html
@@ -0,0 +1,28 @@
+{{ $package := (index .Params 0) }}
+{{ $listname := (index .Params 1) }}
+{{ $filter := split (index .Params 2) " " }}
+{{ $filter1 := index $filter 0 }}
+{{ $filter2 := index $filter 1 }}
+{{ $filter3 := index $filter 2 }}
+
+{{ $list := (index (index .Site.Data.docs $package) $listname) }}
+{{ $fields := after 3 .Params }}
+{{ $list := where $list $filter1 $filter2 $filter3 }}
+
+<table class="table table-bordered">
+ <tr>
+ {{ range $fields }}
+ <th>{{ . }}</th>
+ {{ end }}
+ </tr>
+ {{ range $list }}
+ <tr>
+ {{ range $k, $v := . }}
+ {{ $.Scratch.Set $k $v }}
+ {{ end }}
+ {{ range $fields }}
+ <td>{{ $.Scratch.Get . }}</td>
+ {{ end }}
+ </tr>
+ {{ end }}
+</table>
diff --git a/docs/layouts/shortcodes/imgproc.html b/docs/layouts/shortcodes/imgproc.html
index f0ab4c8ea..6ff73e1f9 100644
--- a/docs/layouts/shortcodes/imgproc.html
+++ b/docs/layouts/shortcodes/imgproc.html
@@ -1,4 +1,4 @@
-{{ $original := .Page.Resources.GetByPrefix (.Get 0) }}
+{{ $original := .Page.Resources.GetMatch (printf "%s*" (.Get 0)) }}
{{ $command := .Get 1 }}
{{ $options := .Get 2 }}
{{ if eq $command "Fit"}}
@@ -14,6 +14,12 @@
<figure style="width: {{ add $image.Width 3 }}px; padding: 3px; background-color: #cccc">
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
<figcaption>
- <small>.{{ $command }} "{{ $options }}"</small>
+ <small>
+ {{ with .Inner }}
+ {{ . }}
+ {{ else }}
+ .{{ $command }} "{{ $options }}"
+ {{ end }}
+ </small>
</figcaption>
</figure> \ No newline at end of file