pelican-plugins / photos

Pelican plugin that adds photos to articles
24 stars 15 forks source link

Plugin only work with article not on pages #113

Open keulemaster opened 7 months ago

keulemaster commented 7 months ago

Sorry i dont know where to ask for help.

i can put the gallery in articles and it works nice. but when i cut the gallery-header-line and paste it into a page, nothing showing. also no error. my directory structure is simple:

root --articles --images --pages

i just want to show all images in the imagefolder on a page called 'images'

is there maybe a hidden switch/config? googeling around doesnt show anything in this direction.

i use markdown for the sites.

phibos commented 7 months ago

Most of the examples are for articles only. Did you modify the examples to also work with pages?

keulemaster commented 7 months ago

sorry i dont understand what you mean...i dont try the examples in the repo.

i am using the elegant theme and adding the gallery meta tag in an article shows me a gallery. thats fine. but if i do the same in a page file (in the pages dir), pelican doesnt put the html code to the output.

Thanks for your help!

phibos commented 7 months ago

I had a look at the source of the elegant theme. Looks like the theme you use does only support galleries in articles.

Template for articles with gallery support https://github.com/Pelican-Elegant/elegant/blob/ad1bcea67f5515c8c448e1c7009f3ba01965d574/templates/article.html#L64-L74

Template for pages without gallery support https://github.com/Pelican-Elegant/elegant/blob/ad1bcea67f5515c8c448e1c7009f3ba01965d574/templates/page.html#L44

The included PhotoSwipe template does not add images to the output https://github.com/Pelican-Elegant/elegant/blob/ad1bcea67f5515c8c448e1c7009f3ba01965d574/templates/_includes/photoswipe.html

To add gallery support to all themes without modifying the theme itself would be to add a config switch to append the gallery to the generated content. This might improve the handling for people just want to start without modifying HTML source and still give the flexibility to experienced users.