-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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? #81
Comments
Are you talking about HTTPS? |
No, Server Side Includes
https://en.m.wikipedia.org/wiki/Server_Side_Includes
…On Feb 19, 2018 2:09 PM, "Ritwick Dey" ***@***.***> wrote:
Are you talking about HTTPS?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAeB4Mhs93nh-W6NEghnyZ6NNTupPIsdks5tWccGgaJpZM4SJs_D>
.
|
@peterbenoit yes you can do SSI which php support. Link. |
I think you got isolation. I am closing this issue now. Thank you for reporting this issue. |
Is server side includes possible in vscode live server? |
@rjoydip SSI is server feature, It has nothing to do with PHP. Regarding php actual mature (apache, nginx, etc) server must be set up. If its on why bother with Live Server at all. So the question is: will Live Server support SSI in the future. I choose Live Server for html layout, support for SSI would be nice feature. |
I wanted SSI in Live Server so I could develop a static HTML-site without repeating code all over. Since it is not supported in Live Server, I ended up creating a little "client side includes" javascript snippet. If anyone is interested, please feel free to use: Note that it will only allow you to load stuff between the Usage in HTML<!-- Partial: Hero with Carousel -->
<div data-include="partials/hero-with-carousel.html"></div> Script$(function() {
// process "client side includes"
processPartials($("div[data-include]"), function() {
// continue with the rest of the "on DOM ready" functionality
processSite()
});
function processPartials(selector, callback){
jQuery.ajaxSetup({async:false});
var partials = selector.toArray();
while(partials.length > 0){
// get first item
var el = $(partials[0]);
// get contents of include
$.get(el.data("include"), function(data) {
var $newElement = $(data);
el.replaceWith($newElement);
// process possible includes
$newElement.find("[data-include]").each(function(index, item){
partials.push(item);
});
}).always(function(){
// remove this item from partials list
partials.splice($.inArray(partials[0], partials),1);
});
}
callback();
}
}); |
Check the Live Server browser extension for Chrome (same author as Live Server). You can have VS Code launch IIS Express (which supports SSI, it is a separate extension to install) and then use the Chrome extension which basically bridges Live Server and IIS Express through the browser. I tested this and it works perfectly. Make sure the file extension is of a type that goes through the SSI handlers that are configured in applicationhost.config, for example index.shtml or index.asp. |
Works well, thanks! but should be a native feature on this plugin.. |
How would lazy loading parts of a web page effect SEO? Wouldn't Lighthouse complain about above the fold content being lazy loaded? Also creates unnecessary HTTP requests. Would make much more sense to use SSG. Not sure why live server doesn't support SSIs still in 2024. I guess there's not a demand for it anymore as everyone uses frameworks. |
Is there support (or planned support) for SSIs?
The text was updated successfully, but these errors were encountered: