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

Allow templates to use external ressources (css/imgs). #415

Open
ArKam opened this issue Oct 14, 2024 · 4 comments
Open

Allow templates to use external ressources (css/imgs). #415

ArKam opened this issue Oct 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ArKam
Copy link

ArKam commented Oct 14, 2024

Describe the bug
I was working on a template that I would like to contribute to you and find out that all ressources needs to be embedded onto the html page itself.

Althrough it's doable, it would make that page almost unreadable as the CSS part for this page is rather lengthy.

Context

  • Sablier version: [beta-1.8.22]
  • Provider: [kubernetes v1.29.9]
  • Reverse proxy: [Traefik v2.8.5]
  • Sablier running inside a container? yes

Expected behavior
The template renderer should have another css/imgs handler and allow for those ressources to be imported instead of embedded.

Additional context
I use a pretty standard structure with theme.html page and css/index.css and imgs/logo.png + imgs/favicon.png

Let me know if you need further informations such as a public copy of the theme etc.

@ArKam ArKam added the bug Something isn't working label Oct 14, 2024
@acouvreur
Copy link
Member

It is not possible to load files from local path as is.

Given how themes are loaded into Sablier and then rendered, Sablier won't expose static resources.

However, Sablier could embed those files at loading time.

Creating a single HTML file with the JS and CSS.

That's something that makes sense to me, what do you think?

@ArKam
Copy link
Author

ArKam commented Oct 15, 2024

Hi Alexis,
From a code standpoint, goTemplate and embed could load them if an new handler is added, however I can see the troubles that such thing can bring to sablier.

If I correctly understand your idea, we still continue to bring the html/css/imgs and then have sablier will create a bundeled single page at loading time right? If so yes that would make sense to me.

Another approach that you could leverage would be the same as the one taken by traefik error page middleware that indeed leverage external services to host the pages.

Exemple:
image

I'm fine with both ideas :D

@acouvreur
Copy link
Member

Hey @ArKam, I just wanted to let you know that I've released https://editor.sablierapp.dev/

However, no news for embedded assets support

@ArKam
Copy link
Author

ArKam commented Oct 21, 2024

oh cool! I’ll pass my theme on it and see how it goes with the online editor!

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