My personal website and blog, built with 11ty and Workbox. Hosted on Cloudflare Pages.
- PWA with web application manifest
- RSS feed with @11ty/eleventy-plugin-rss
- webmentions sent to Webmention.io and collected by Bridgy
- WebC component to send webmentions using a Progressive Enhancement friendly HTML form
sitemap.xml
androbots.txt
for SEOsecurity.txt
in.well-known
directory- just-in-time preloading with instant.page
- Service worker generated with workbox-core and esbuild
- Modular type scale and fluid space system thanks to Utopia
- Performance reports with multiple performance budgets using the Lighthouse CLI and webhint
- HTML minified using html-minifier-terser (only when building for production)
- CSS on the critical path minified with clean-css and inlined in the
<head>
. All other CSS is managed by PostCSS. - Embeds for YouTube and Video thanks to eleventy-plugin-youtube-embed and eleventy-plugin-vimeo-embed
- Framework agnostic partial hydration with @11ty/is-land
- Custom HTTP headers for the Reporting API:
- Configurable text to speech synthesis, thanks to @jackdbd/eleventy-plugin-text-to-speech
- Scripts I use for various administrative tasks
Clone the repo:
git clone git@github.com:jackdbd/personal-website.git
This project should work on Node.js >=20.0.0.
ℹ️ What's that
devenv.nix
?This project uses devenv to create and manage a developer environment that has all the necessary dependencies. Thanks to devenv's automatic shell activation, this environment is activated automatically when you enter the root directory of this repository (you will just have to wait a few seconds).
If you don't use Nix, you can safely ignore the
devenv.nix
file in the repository root.In alternative to the Nix dev shell provided by this repository, you could use a Node.js version manager like nvm, asdf, or volta.
If you want to run scrips/tests that rely on Playwright, you will also need to install/update the browsers it uses:
npx playwright install
Watch all templates, CSS, JS, and automatically refresh the browser:
npm run dev
Go to http://localhost:8080/ to visit the website.
In alternative, develop and preview the site with wrangler (this is useful when developing functions that will be deployed to Cloudflare Pages Functions):
npm run wrangler
Go to http://localhost:8788/ to visit the website.
Build all templates, CSS, JS, _headers
file and the service worker:
npm run build
Serve the production build:
npm run site:serve
Just push to the remote repository. This GitHub workflow will automatically deploy the website to Cloudflare Pages.
- Each push on the
main
branch will trigger a production deployment. - Each push on any other branch will trigger a preview deployment.
⚠️ Node.js version on Cloudflare PagesDon't forget to set the environment variables
NODE_ENV
andNODE_VERSION
in the Cloudflare Pages dashboard. In particular,NODE_VERSION
is used by the Cloudflare Pages V2 build system.
Generate the _headers
file which will be used by Cloudflare Pages:
node scripts/headers.mjs
Check the Content-Security-Policy
and the other security headers with these online tools:
See SECURITY.md.
This project has 53 dependencies
.
This project has 19 devDependencies
: @hint/hint-performance-budget, @jackdbd/checks, @types/yargs, form-data, himalaya, hint, lighthouse, linkedin-api-client, openpgp, playwright-chromium, playwright-start, prettier-plugin-tailwindcss, pretty-error, serve, snoowrap, taze, typescript, uuid, yargs.
When developing, open Chrome DevTools, go to Application > Service Workers
and check that:
Update on reload
is enabled. This ensures that the latest service worker will be installed and activated on the page.Bypass for network
is disabled. This ensures that the route matchers, route handlers and runtime caches of the service worker will be used.
© 2020 - 2024 Giacomo Debidda // MIT License