Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CharlesNepote opened this issue Oct 31, 2017 · 2 comments
Open

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

CharlesNepote opened this issue Oct 31, 2017 · 2 comments

Comments

@CharlesNepote
Copy link

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.

@bgoglin
Copy link
Owner

bgoglin commented Nov 2, 2017

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.

@CharlesNepote
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants