diff options
author | Matthew Lemon <y@yulqen.org> | 2023-10-23 15:05:16 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-10-23 15:05:16 +0100 |
commit | b970808bccebdbd102ef5f2337c74f3c2f99d1e9 (patch) | |
tree | 6d5f04ccffe154650e4fafd7419b370f67de25c6 /layouts/shortcodes | |
parent | 4bcbdbc1c2480128b6c992c46597c977c7d57797 (diff) |
Pagination of stream complete with working images
To include an image in the stream, you have to use the streamimage
shortcode, e.g.
{{< streamimage filename="bobbins.jpg" >}}
bobbins.jpg must be saved in content/stream/img.
You can include a "size" param in the shortcode (a string as number),
which is translated as a height attribute in the img html tag.
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r-- | layouts/shortcodes/streamimage.html | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/layouts/shortcodes/streamimage.html b/layouts/shortcodes/streamimage.html index 2ff9f0a..003b982 100644 --- a/layouts/shortcodes/streamimage.html +++ b/layouts/shortcodes/streamimage.html @@ -1,5 +1,3 @@ {{ $filename := .Get "filename" }} - -<!-- <p>{{ $.Page.Params.draft }}</p> --> -<p>{{ .Scratch.Get "toss" }}</p> -<img src="../../img/{{ $filename }}"> +{{ $size := .Get "size" }} +<img src="{{ absURL "/stream/img/" }}{{ $filename }}" height="{{ $size }}"> |