From b970808bccebdbd102ef5f2337c74f3c2f99d1e9 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 23 Oct 2023 15:05:16 +0100 Subject: 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. --- content/stream/2022-07-25.md | 2 +- content/stream/2022-08-02.md | 10 ++++++++++ content/stream/2022-08-02/barrow_tesco_extra.jpg | Bin 37718 -> 0 bytes content/stream/2022-08-02/index.md | 11 ----------- content/stream/2022_08_04.md | 2 +- content/stream/2022_08_11.md | 2 +- content/stream/2022_08_14.md | 3 +-- content/stream/2023-10-21.md | 3 --- content/stream/2023_10_07.md | 4 ++-- content/stream/img/barrow_tesco_extra.jpg | Bin 0 -> 37718 bytes layouts/shortcodes/streamimage.html | 6 ++---- layouts/stream/list.html | 18 +++++++----------- 12 files changed, 25 insertions(+), 36 deletions(-) create mode 100644 content/stream/2022-08-02.md delete mode 100644 content/stream/2022-08-02/barrow_tesco_extra.jpg delete mode 100644 content/stream/2022-08-02/index.md create mode 100644 content/stream/img/barrow_tesco_extra.jpg diff --git a/content/stream/2022-07-25.md b/content/stream/2022-07-25.md index e0dbab6..6fbf364 100644 --- a/content/stream/2022-07-25.md +++ b/content/stream/2022-07-25.md @@ -18,4 +18,4 @@ Added an [email address](mailto:y@yulqen.org) to the [About](../about) page, jus Boris thinks it is his right to enter our house to eat Bob's food. Boris lives with a tortoisehell cat called Maggie who often visits. She is similarly entitled. -{{< figure src="img/bob_boris_web.jpg" title="Bob and Boris">}} +{{< streamimage filename="bob_boris_web.jpg">}} diff --git a/content/stream/2022-08-02.md b/content/stream/2022-08-02.md new file mode 100644 index 0000000..2985882 --- /dev/null +++ b/content/stream/2022-08-02.md @@ -0,0 +1,10 @@ +--- +title: "2022_08_02" +date: 2022-08-02T16:00:46+01:00 +draft: false +tags: ['photos'] +--- + +Barrow-in-Furness in August. + +{{< streamimage filename="barrow_tesco_extra.jpg" >}} diff --git a/content/stream/2022-08-02/barrow_tesco_extra.jpg b/content/stream/2022-08-02/barrow_tesco_extra.jpg deleted file mode 100644 index 29e6d8c..0000000 Binary files a/content/stream/2022-08-02/barrow_tesco_extra.jpg and /dev/null differ diff --git a/content/stream/2022-08-02/index.md b/content/stream/2022-08-02/index.md deleted file mode 100644 index 0fe7e2f..0000000 --- a/content/stream/2022-08-02/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "2022_08_02" -date: 2022-08-02T16:00:46+01:00 -draft: false -tags: ['photos'] ---- - -Barrow-in-Furness in August. - -![Barrow-in-Furness in the rain](barrow_tesco_extra.jpg) - diff --git a/content/stream/2022_08_04.md b/content/stream/2022_08_04.md index f94b4bf..0016b25 100644 --- a/content/stream/2022_08_04.md +++ b/content/stream/2022_08_04.md @@ -11,4 +11,4 @@ We ate lunch at [The Barn at Beal](http://barnatbeal.com/). Got home to find a bat in the sink, as detailed in the [cat kill log](../../blog/cats/cat_kills). -{{< figure src="img/holy_island_pyramid.jpg" alt="Holy Island Pyramid" title="Holy Island pyramid thing" >}} +{{< streamimage filename="holy_island_pyramid.jpg">}} diff --git a/content/stream/2022_08_11.md b/content/stream/2022_08_11.md index f00f1b2..30e55a5 100644 --- a/content/stream/2022_08_11.md +++ b/content/stream/2022_08_11.md @@ -10,4 +10,4 @@ Leaving Shetland today. This is the coastline at the northwestern corner of the Shetland mainland at Eshaness. Couldn't stay long as the children were scared of the cliffs! -{{< figure src="img/shetland_coast.jpg" alt="Shetland coastline at Eshaness" title="Shetland coastline at Eashaness" >}} +{{< streamimage filename="shetland_coast.jpg">}} diff --git a/content/stream/2022_08_14.md b/content/stream/2022_08_14.md index 3db85e5..fa83355 100644 --- a/content/stream/2022_08_14.md +++ b/content/stream/2022_08_14.md @@ -5,7 +5,6 @@ draft: false tags: ['berwick-upon-tweed', 'music'] --- - {{< streamimage filename="swimmer_medal_border.png" >}} I've had enough of BBC coverage of the European Championships (and latterly the Commonwealth Games). Too much positivity for my liking, it wears you down eventually. @@ -20,6 +19,6 @@ Listening to: [Carbon Based Lifeforms](https://en.wikipedia.org/wiki/Carbon_Base --- Went to Tesco today and filled a barrow two-thirds. -{{< figure src="img/trolleys_blur.jpg" alt="Tesco barrows" >}} +{{< streamimage filename="trolleys_blur.jpg" >}} Exciting things happening parallel to the mundane, just not reportable. diff --git a/content/stream/2023-10-21.md b/content/stream/2023-10-21.md index 8da0d97..bb77a0a 100644 --- a/content/stream/2023-10-21.md +++ b/content/stream/2023-10-21.md @@ -7,9 +7,6 @@ tags: ["golf", "quicknotes", "cats"] A [ginger cat](../blog/cats/cat_kills/#the-perpetrators) beneath a stool, sheltering from the rain: - -{{< figure src="img/cat_stool.jpg" >}} - {{< streamimage filename="cat_stool.jpg" >}} --- diff --git a/content/stream/2023_10_07.md b/content/stream/2023_10_07.md index 726bc6c..2b53f49 100644 --- a/content/stream/2023_10_07.md +++ b/content/stream/2023_10_07.md @@ -9,7 +9,7 @@ Absolutely pissing with rain here in Berwick since about 7pm last night, and for This is how it looks to Open AI - considerably brighter than reality but quite a nice little scene: -{{
}} +{{< streamimage filename="berwick-upon-tweed--northumberland--united-kingdom--october-7-at-9-17-am--light-rain.jpg" >}} --- @@ -24,5 +24,5 @@ Updated the [Programming](../about/programming) page with an update on my latest Scotland are playing Ireland in the World Cup tonight. Barely able to contain the dread. -{{
}} +{{< streamimage filename="stomping_war_propoganda.png" size="400" >}} diff --git a/content/stream/img/barrow_tesco_extra.jpg b/content/stream/img/barrow_tesco_extra.jpg new file mode 100644 index 0000000..29e6d8c Binary files /dev/null and b/content/stream/img/barrow_tesco_extra.jpg differ 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" }} - - -

{{ .Scratch.Get "toss" }}

- +{{ $size := .Get "size" }} + diff --git a/layouts/stream/list.html b/layouts/stream/list.html index 2fb46b4..7f3a92f 100644 --- a/layouts/stream/list.html +++ b/layouts/stream/list.html @@ -12,21 +12,17 @@

{{ .Date.Format "Monday, 2 January 2006" }}

-{{ $.Scratch.Set "toss" "toss" }}
{{ .Content }}
-{{ $.Scratch }} - -{{ if $paginator.HasPrev }} -

this page is paginated

- {{ $.Page.Scratch.Add "imgpath" "PAGINATED" }} -{{ else }} -

this page is NOT paginated

- {{ $.Page.Scratch.Set "imgpath" "img/" }} -{{ end }} - + + + + + + + {{ if .Params.tags }} -- cgit v1.2.3