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

Server Side Includes #97

Open
Dexus opened this issue Apr 10, 2022 · 5 comments
Open

Server Side Includes #97

Dexus opened this issue Apr 10, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed v2 v2 release

Comments

@Dexus
Copy link

Dexus commented Apr 10, 2022

Is your feature request related to a problem? Please describe.
Have a way to use SSI (https://en.wikipedia.org/wiki/Server_Side_Includes)
Something like https://nginx.org/en/docs/http/ngx_http_ssi_module.html

Describe the solution you'd like
Support at least SSI include <!--# include file="footer.html" --> and <!--# include virtual="/remote/body.php?argument=value" -->
Good would be a minimal support like http://acme.com/software/thttpd/ssi_man.html but with the possibility to use ../ until we reach the base dir.

Describe alternatives you've considered
switch to other servers

Additional context
Add any other context or screenshots about the feature request here if needed.

@joseluisq
Copy link
Collaborator

Do you have some use cases for SSI and is that feature really use it nowadays?
I'm not aware about it so It would be useful if you can provide more context.

@Dexus
Copy link
Author

Dexus commented Apr 12, 2022

Yes badly our website is mostly static, but some parts need tokens, and other dynamic includes. Would nice to have one more point to change from nginx or apache.

@joseluisq joseluisq added enhancement New feature or request help wanted Extra attention is needed v2 v2 release labels Apr 21, 2022
@tuta-amb
Copy link

tuta-amb commented Nov 3, 2023

Possibly including a opt-in build with Handlebars might be useful?

@double-daruma
Copy link

Using Handlebars or Terra might be easier than implementing SSI as there are already implementations that are widely used. Are there things that SSI can do that Rust template engines cannot do? Including a template engine like this could be a very nice feature for SWS but it would of course introduce extra dependencies and complexity.

@joseluisq
Copy link
Collaborator

@double-daruma Handlebars and Terra look like good alternatives also askama but I will need to explore them a bit to decide which one.

But I'm in favor of going with a template engine rather than implementing SSI. Also, I can see other benefits like sharing request information (URI, headers, etc) with the templates apart from control flow, importing other template files, etc.

Another benefit that I can see is using this feature to power also the directory listing and the error pages as templates so users can customize them as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed v2 v2 release
Projects
None yet
Development

No branches or pull requests

4 participants