From a989d141eff5887ba46f65c217a0175a6ad53e1d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 8 Sep 2022 19:25:05 +0300 Subject: feat: img directive link generation This is just simple enough for me for now. Sponsored-by: author --- riki.md | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'riki.md') diff --git a/riki.md b/riki.md index 988777b..199130e 100644 --- a/riki.md +++ b/riki.md @@ -447,7 +447,7 @@ then file output/index.html contains "" ~~~ ~~~{#img-size .file .markdown} -[[!img a.jpg size="100x200"]]] -[[!img b.jpg size="100x"]]] -[[!img c.jpg size="x200"]]] +[[!img a.jpg size="100x200"]] +[[!img b.jpg size="100x"]] +[[!img c.jpg size="x200"]] ~~~ #### Image attributes @@ -511,9 +511,40 @@ then file output/index.html contains "vspace="vspc"" ~~~{#img-attr .file .markdown} [[!img img.jpg alt="halt malt" title="tightle" class="klass" align="malign" - id="kid" hspace="hspc" vspace="vspc"]]] + id="kid" hspace="hspc" vspace="vspc"]] ~~~ +#### Image link generation + +_Requirement: the `img` directive can make an image be a link._ + +The [ikiwiki img +directive](http://ikiwiki.info/ikiwiki/directive/img/) allows +arguments: + +> The link parameter is used to control whether the scaled image links +> to the full size version. By default it does; set "link=somepage" to +> link to another page instead, or "link=no" to disable the link, or +> "link=http://url" to link to a given url. + +~~~scenario +given an installed riki +given file site/index.mdwn from img-link +given file site/a.jpg from jpeg +given file site/b.jpg from jpeg +when I run riki build site output +when I run cat output/index.html +then file output/index.html contains "