@@ -63,10 +63,11 @@ html-block html-blockcode html-index html-figure html-figure-@2x + html-image-link html-dialogue html-say html-verse html-link html-url @@ -155,10 +156,16 @@ (define alt-text (tx-strs `(span ,@(cdr elems)))) `(figure [[class "fullwidth"]] (img [[alt ,alt-text] [src ,src]]) (figcaption ,@(cdr elems)))) +;; Simple link to an image +(define (html-image-link . elems) + (define src (image-source (car elems))) + (define title (tx-strs `(span ,@(cdr elems)))) + `(a [[href ,(string-append web-root src)] [title ,title]] ,@(cdr elems))) + ;; There is no way in vanilla CSS to create a selector for “p tags that contain ;; a span of class ‘newthought’”. So we can handle it at the Pollen processing level. (define (detect-newthoughts block-xpr) (define (is-newthought? tx) ; Helper function (and (txexpr? tx)