llgal icon indicating copy to clipboard operation
llgal copied to clipboard

Add <!--IMAGE-LINK--> keyword for templates

Open CharlesNepote opened this issue 7 years ago • 2 comments

To have more power in the templates, <!--IMAGE-LINK--> would provide the link to the image shown: .llgal/scaled_IMG_3832.JPG for example.

To let it work, I added a line in llgal.in right after line 1888: $line =~ s/<!--IMAGE-LINK-->/$entry->{scaled_url}/g ;

I can see many use cases for it:

  • add a "download image" link
  • use another HTML code than the one provided by
  • etc.

I don't know if there is more work to implement it, except the documentation. I can build a pull request if you agree with it.

CharlesNepote avatar Oct 31 '17 17:10 CharlesNepote

Sure, that's easy to add, so why not? Regarding documentation, you just need to add it to llgal.1 (likely right before ). If you can write the code, test it, and submit a PR, that'd be great.

bgoglin avatar Nov 02 '17 21:11 bgoglin

There was a little alert "Use of uninitialized value in substitution iterator" so I modified the previous code and also introduce two keywords instead of one, SCALE-IMAGE-LINK and FULL-IMAGE-LINK as is:

$line =~ s/<!--SCALED-IMAGE-LINK-->/$entry->{scaled_url}/g if defined $entry->{scaled_url};
$line =~ s/<!--FULL-IMAGE-LINK-->/$entry->{url}/g if defined $entry->{url};

I'll modify llgal.1 dans make a pull request if you agree with this proposition.

CharlesNepote avatar Nov 03 '17 11:11 CharlesNepote