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

Lightbox images in articles #20

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

juskuz
Copy link
Collaborator

@juskuz juskuz commented Apr 12, 2018

I made lightbox images in articles in left column (templates/article.html). And it works fine.

But pictures from files *.rst ( I edited firstproject.rst for test) show an error. Probably it's caused by multiplying atributte "class" for this image (see in output "firstproject.jpg").
I have no idea how can I change this bug (I don't know how the first atributte "class" is generated).

This is a part of #19

EDIT: The error is caused for sure by missing href for the image. Adding :target: in *.rst doesn't work properly - it creates an extra with href instead of creating image with href. Then clicking on image causes an error but clicking on the right of the image opens zoomed image.
Any idea how can I fix it?

@juskuz juskuz requested a review from magul April 12, 2018 11:44
@aniawsz
Copy link
Member

aniawsz commented May 6, 2018

The lightbox looks cool! I had a look at the problem and it seems that the changes from the commit 3a34d73 do the trick and fix displaying large images. The problem is related to the fact that the Magnific Popup uses the href property of images to determine what image to display. The images declared in the *.rst files are generated as wrapped in an a tag which has the correct value of href. I'd just add a class automatically added to the wrapper by the page generator as another class Magnific Popup acts on. Maybe the solution is not optimal, but does the trick.

@juskuz
Copy link
Collaborator Author

juskuz commented May 16, 2018

I've merged your changes but the photos from .rst still don't work. After rebuilding (command 'make html') clicking on the image causes an error. It's caused by missing 'href' in output in (e.g. line 74 in output/events/first-project). I don't know how it can be changed. If I copy and paste 'href' in it works fine. But how it can be done automaticaly?

@juskuz juskuz requested a review from aniawsz July 18, 2018 18:27
@juskuz
Copy link
Collaborator Author

juskuz commented Jul 18, 2018

@aniawsz
Lightbox images done ;) I had to change a little *.rst files and now it's working fine.
Unfortunately there are no arrows to scroll through pictures.

@juskuz juskuz changed the title Lightbox images in articles [WIP] Lightbox images in articles Jul 18, 2018
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

Successfully merging this pull request may close these issues.

2 participants