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
Thumbnails on gallery's index #1771 #1779
Conversation
nikola/conf.py.in
Outdated
GALLERIES_USE_THUMBNAIL = True | ||
|
||
# Columns of thumbnails list in galleries index | ||
GALLERIES_COLUMNS = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use THUMBNAIL_SIZE as a guide for the sice of the thumbs, then this is probably not needed, just put them one after the other and as many as can fil will fit.
Keeping this setting means we have to ask themes to respect it and that's going to be difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you calculate "How many columns?" based on the THUMBNAIL_SIZE? I used that setting to put a <div class="row">
or a <div class="col-md-4">
.
I know nothing about Bootstrap, so if you know another better way to do that, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose using divs with display:inline will fit as many as possible per row then wrap. But hey, no HTML expert here :-)
Sorry, I did a new push by merging the latest tag into this branch. I'm using this branch in my project at http://argentinaenpython.com/ , so from time to time I do a merge but I'm not sure if you like this. Anyway, is this something still interesting for you to be part of nikola or not. In case the answer is "yes", please let me know what are the changes I should make to this PR. This is very old and I haven't read the new nikola source code since that, so probably there are many new things that I'm not aware. Thanks! |
I think this is a good idea. But note that you’ll need to rebase this branch, or perhaps recreate it from scratch, based on Delete your local copy of the branch, create new branch from master, and force-push. (If you do (Sorry, apparently nobody got around to reviewing this in 2 years. Happens sometimes.) |
New settings to allow thumbnails in gallery's index.
* Do not use a fixed number of columns * Translatable index title * False in GALLERIES_USE_THUMBNAIL to make it backward compatible * Use filter "h" in Mako templates for display titles
This is not a good way to do it because there are fixed values for sizing. We should use more dynamic CSS rules to be adjusted properly to the content and cover more use cases.
eb07976
to
38023d5
Compare
Hi! I rebased this PR onto I saw that bootstrap3 is not more available, so I will need to test this a little more in bootstrap4. Maybe, in 3 years more we can merge it 😆 |
<div class="row"> | ||
% for folder, ftitle, fpost in folders: | ||
<div class="col-md-4 col-sm-6 col-xs-12" style="min-height: 425px;"> | ||
<div class="thumbnail"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m afraid that doesn’t work in bs4. The new card
classes would have to be used.
I used the I have no idea of CSS, so I tweak it a little to make it look "kind of pretty" but probably it need more work to make it more configurable and nicer. I tested this by using this branch and running:
|
@@ -15,11 +15,36 @@ | |||
</p> | |||
%endif | |||
%if folders: | |||
% if galleries_use_thumbnail: | |||
<% card_min_size = thumbnail_size + 100 %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a setting also: GALLERIES_CARD_HEIGHT
and GALLERY_CARD_WIDTH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, you can’t use this syntax in templates (Jinja2 doesn’t support arbitrary Python code)
Closed with thanks :-) |
New settings to allow thumbnails in gallery's index.
Fixes #1771.