Using 11ty Serverless to create serverless search
Progressive enhancement is an important topic when creating any web site or app. What happens when a user’s browser isn’t able to handle any JavaScript or the specific JavaScript you’re using? If your front end fails, you need a fallback to allow basic functionality to keep working.
What’s so hard about that?
When you’re working in the Jamstack, that can be harder than traditional stacks. No server means no server rendering. Sure you can use serverless functions, but then you have to recreate your frontend and don’t have any of the benefits of your static site generator’s templates… Or at least, you DIDN’T!
With 11ty Serverless, we can create a fully server-rendered search page using all the same templates and syntax with love with 11ty. No additional codebase; no additional template languages; no adapting your lovely liquid into terrible template literals (alliteration only, I love template literals, but you get the point!). Install the 11ty Serverless plugin, get request-time information, and pass that information into an 11ty filter to get customized data for a search page. No frontend JS required.
Bryan Robinson (He/Him)
Bryan is a designer and developer with 15 years of experience building experiences and leading teams on the web. He writes and records about HTML, CSS, the power of static sites (11ty, amirite?!) and good, clean design.