summaryrefslogtreecommitdiff
path: root/riki.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-09-08 19:25:05 +0300
committerLars Wirzenius <liw@liw.fi>2022-09-08 19:25:05 +0300
commita989d141eff5887ba46f65c217a0175a6ad53e1d (patch)
tree4958684fe22a511d8a764d20e30575a1ab39d5dc /riki.md
parentc6cb630275ef9edd8a9818a4883f2a2b59b4aa46 (diff)
downloadriki-a989d141eff5887ba46f65c217a0175a6ad53e1d.tar.gz
feat: img directive link generation
This is just simple enough for me for now. Sponsored-by: author
Diffstat (limited to 'riki.md')
-rw-r--r--riki.md41
1 files changed, 36 insertions, 5 deletions
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 src="img.jpg""
~~~
~~~{#img .file .markdown}
-[[!img img.jpg]]]
+[[!img img.jpg]]
~~~
~~~{#jpeg .file}
@@ -477,9 +477,9 @@ then file output/index.html contains "<img src="c.jpg" height="200">"
~~~
~~~{#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 "<a href="a.jpg"><img src="a.jpg""
+then file output/index.html doesn't contain "<a href="b.jpg"><img src="b.jpg""
+~~~
+
+~~~{#img-link .file .markdown}
+[[!img a.jpg]]
+[[!img b.jpg link=no]]
+~~~
+
+
+
### `meta title`
_Requirement: the `meta title` directive sets page title._