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

Fully static-compatible theme (full-featured with shareable links not needing JS). #392

Open
fidergo-stephane-gourichon opened this issue Jun 20, 2020 · 2 comments

Comments

@fidergo-stephane-gourichon
Copy link

fidergo-stephane-gourichon commented Jun 20, 2020

Hi @saimn !

Context: Sigal is great!

First, I want to say loud and clear how sigal design is reaaally good!
The design separates concerns, which allows to indeed write themes without mixing sigal logic with theme logic.

More than 20 years agoI have written my own quick-and-dirty static gallery generator and hacked it, but without good design things turn into a giant blob. By contrast, Sigal makes a very good basis to build upon!

Building with nice layers allows to keep simple things simple, have an end result that degrades gracefully (lack of script / features, lack of CSS, text browser), all with relatively low complexity at all times.

Themes, please advertise more

I've played with sigal for a while, first chose galleria theme because of fullscreen for all photos, might use soon photoswipe theme because of image list appearing in HTML, buttons in fullscreen view (shortcut-keys-only is not viable for guest visitors), transitions between miniature and fullscreen. Will have to adjust to get all, or use another mentioned on Wiki.

I did not notice the Wiki at first. Please consider linking to the wiki from the template configuration file, especially on the theme option documentation.

WIP 10-foot UI theme

So far, I have hacked a variation of galleria that, in the HTML, expands a list of pictures and in the fullscreen area, shows buttons for slideshow/pause/fullscreen/download_picture
https://github.com/fidergo-stephane-gourichon/sigal/commits/fsg_my_experimental_changes_on_b1f2e947700e618425e170e8758b1fbb82c91acb

The aim is something really simple and intuitive.

Main course: a fully static-compatible theme (shareable links not needing JS)

I'm wishing, and willing to implement with some feedback, either a new theme, or an option for an existing theme (not sure if a theme-agnostic plugin would work), that restores some universality, that it "do not break traditional features of a website".

That includes :

  • at all time, the URL shown can be shared to anyone and show the same (gallery view or specific photo),
  • the receiver of the link can see the same thing (gallery or specific photo)
  • whether sender and recipient (any combination) have Javascript enabled or not.

This also does not break what people call "organic SEO" (when whey break things with dynamic web sites and sites that are broken without JavaScript). Search engine see pages with descriptions.

Good news, I mostly know how to do it and it's relatively simple.

Incomplete battle plan

  • The media_page plugin allows to generate per-image HTML, which is a very nice start.
  • Non-Javascript visitors ever see static HTML pages (gallery page, and per-image page, possibly fullscreen with CSS vw and wh unit, not sure how to handle screen aspect ratio and black bars). Implementation: just make sure the URL in Javascript-enabled browsers matches a generated static HTML file at all times.
  • Javascript-enabled visitors have usual extra benefits: no page reload, icons that appear/disappear based on mouse motion, key shortcut navigation. For seamless user experiences, there is only one case needing specific handling: when arriving to a specific image page via a URL, if Javascript-enabled visitor, then show image, then only if visitor switches to gallery view, then transition to album page. So, simple to do.
  • For the rest, reuse existing things, like Justified Gallery for, well, the miniature gallery, and Photoswipe or similar for fullscreen and interactivity, with simple HTML written so that non-Javascript browsers (and search engine) just get meaningful content, with visual layout via CSS as usual.

Open to feedback. For instance, any hints from you as how to keep things simple and compatible with many cases.

Thanks again for Sigal, it's great!

@saimn
Copy link
Owner

saimn commented Jun 26, 2020

Thanks for the kind words :)

I did not notice the Wiki at first. Please consider linking to the wiki from the template configuration file, especially on the theme option documentation.

Yes, good idea.

Implementing a static theme would be very valuable for sure !
In that case we should probably consider including the possibility to generate per-image HTML in the core, instead of the media_page plugin. There is some room for improvements in the HTML writer, to have a more general way to render templates.

@fidergo-stephane-gourichon
Copy link
Author

In that case we should probably consider including the possibility to generate per-image HTML in the core, instead of the media_page plugin.

Okay, I didn't expect what. I have not started to try, perhaps some things will be complicated if per-image HTML is in a plugin, and simpler if in core?

There is some room for improvements in the HTML writer, to have a more general way to render templates.

Mmh, can you elaborate? What happens without the improvements?

Thanks!

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

No branches or pull requests

2 participants