Our great sponsors
-
personalize-with-http-referer
Use Netlify Edge Functions to intercept a request to a static page, check the value of the HTTP referer header, and enhance the response of the HTML before it's returned to the browser. No client-side JavaScript required.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
eleventy 🕚⚡️
A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
-
edge-functions-examples
Explore a library of reference examples for learning about Edge Functions on Netlify.
And lastly, you may want to check for multiple referer header values — in which case a single string may not suffice, and you may want to do something like I do on my website.
To see this code in action, visit the live demo site — which checks to see if you’ve been referred from Netlify, and includes the same functionality we set up in this guide. And finally, check out the demo repository on GitHub to explore the code, fork it, and make it your own.
My blog site is a static site — currently built using Eleventy
You’ve learned how you can modify static HTML pages based on the HTTP referer header, but did you know you can also perform actions based on other things like location, time, cookies and more? Check out the official Netlify Edge Functions docs, or browse our Edge Functions examples site for some inspiration. Happy coding! 👩🏻💻
Related posts
- Using custom error handling if a serverless function has crashed
- Eleventy - Create a global production flag
- Removing React is just weakness leaving your codebase
- Ask HN: What web development stack do you prefer in 2024?
- VS Code - Fix a task automation issue - `The terminal process failed to launch (exit code: 127`