Images - colorbox

14 views
Skip to first unread message

Benny Simonsen

unread,
Nov 12, 2016, 2:54:25 AM11/12/16
to nikola-discuss
Hi,

When adding images via:
.. thumbnail:: /images/02a5509.jpg
    :alt: Image Title

then the title isn't shown, therefore I have added a title= to the <a> to let the title be shown in "colorbox mode" (when only the image is shown).
I have also added the title after the image in a <p>:

<a class="reference external image-reference" href="../../../images/02a5509.jpg" title="Image Title"><img alt="9" src="../../../images/02a5509.thumbnail.jpg"></a><p>Image Title</p>

My problem is to find where I should change the source code?
Is it the right way to do it? ... I think that I have seen that a .txt file could be placed in the images folder with the same basename as the image and it could contain the title - but I can't find that now.
In some cases I would like to get the titles from a separate file, and I can see an old thread about a JSON file with image info - but can't find the source for it - are there implementations where the titles are retreived from a separate file (relevant for both galleries and normal pages).

Br,
Benny

Chris Warrick

unread,
Nov 12, 2016, 7:36:30 AM11/12/16
to Nikola—Discuss
That would require making a custom version of the reST built-in
image/figure directives. Which may be hard.

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Benny Simonsen

unread,
Nov 12, 2016, 7:52:21 AM11/12/16
to nikola-discuss
Hi Chris,

Will it also be hard to copy the alt to <a ... title=...>?

Chris Warrick

unread,
Nov 12, 2016, 7:53:07 AM11/12/16
to Nikola—Discuss
On 12 November 2016 at 13:52, Benny Simonsen <be...@slbs.dk> wrote:
> Hi Chris,
>
> Will it also be hard to copy the alt to <a ... title=...>?

It will be hard to add title="" to <a>.
Reply all
Reply to author
Forward
0 new messages