img: Add a margin around images displayed by this directive.
authorJoey Hess <joey@kitenet.net>
Mon, 5 Jul 2010 18:04:49 +0000 (14:04 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 5 Jul 2010 18:04:49 +0000 (14:04 -0400)
Particularly important for floating images, which could before be placed
uncomfortably close to text.

IkiWiki/Plugin/img.pm
debian/changelog
doc/style.css

index eb1b6812482dab4065f40dbe6b8a4ebc96726a49..2375ead8968b6a9baf64ff8ac825dbde6a75b82d 100644 (file)
@@ -156,6 +156,13 @@ sub preprocess (@) {
                $imgurl="$config{url}/$imglink";
        }
 
+       if (exists $params{class}) {
+               $params{class}.=" img";
+       }
+       else {
+               $params{class}="img";
+       }
+
        my $attrs='';
        foreach my $attr (qw{alt title class id hspace vspace}) {
                if (exists $params{$attr}) {
index 9f1a33f2fd05fdde35b122e793399c4aa74556fa..d426be0196a6f35bd3b34202f5da63268ecc6419 100644 (file)
@@ -1,3 +1,9 @@
+ikiwiki (3.20100705) UNRELEASED; urgency=low
+
+  * img: Add a margin around images displayed by this directive.
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 05 Jul 2010 13:59:42 -0400
+
 ikiwiki (3.20100704) unstable; urgency=low
 
   * Changes to avoid display of ugly google openids, by displaying
index bf000dae189ac8d7c12a6780837a422a3773873c..8dd3b1c151905d0c2f8fdae03c0b8bda8c38bf55 100644 (file)
@@ -91,6 +91,10 @@ nav {
        text-align: center;
 }
 
+img.img {
+       margin: 0.5ex;
+}
+
 .align-left {
        float:left;
 }