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

Duplicate slug names cause sections to fail grid layout #4

Closed
fkxr-dev opened this issue Dec 30, 2023 · 5 comments
Closed

Duplicate slug names cause sections to fail grid layout #4

fkxr-dev opened this issue Dec 30, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@fkxr-dev
Copy link

Here's a weird one, obviously a user error here but I ran into a problem where one of my sections would refuse to appear in a grid layout. All the images would appear full-width in a one-wide list, if that makes sense. I tracked it down to the problem being a duplicated slug identifier for two sections in my TOML, renaming one of them caused the issue to go away.

Naturally slugs ought to be unique and this is technically a user error, maybe some error reporting during building would be enough to address this already, but I figured it's worth reporting here nonetheless.

So the reproduction steps as far as I can tell are:

  • Make two sections
  • Set their slug names to identical text
  • Add layout.minColumn or more images to each section
  • The first section defined in the TOML file should appear correctly, the second one will not have a grid layout at all and simply show up as a list of images.

Let me know if you'd need any further information!

@waynezhang
Copy link
Owner

@fkxr-dev thanks for reporting! I just push a new version v.1.08 to add a guard logic. Could you please take a look at it? I did a big refactoring and hope it didn't break anything. 😆

@waynezhang waynezhang added the bug Something isn't working label Jan 1, 2024
@waynezhang waynezhang self-assigned this Jan 1, 2024
@fkxr-dev
Copy link
Author

fkxr-dev commented Jan 1, 2024 via email

@waynezhang
Copy link
Owner

@fkxr-dev thanks!

One related thing I noticed in the interim of testing this (on 1.0.7) was that when magnified/opened in the full-screen viewer, the exif-rotated portrait shots come out as squashed to their ‘original’ unrotated aspect ratio, the thumbnails are fine.

I see. Let me check it when I got time later. BTW did you try to clear both the cache (.foto folder) of foto and the cache of browser?

@fkxr-dev
Copy link
Author

fkxr-dev commented Jan 4, 2024

On the latest code (pulled from main) I'm now getting (correctly):

ERROR: Failed to build index. (Slug "20231229" already exists. Slug needs to be unique.) -- so the guards against duplicate slugs seems to work.

The squashed images in the enlarged view also seem to be resolved now; tried on a few different browsers and they all seem happy.

@waynezhang
Copy link
Owner

@fkxr-dev Nice! Thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants