Skip to content

jackdbd/personal-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

personal-website

HSTS preload HSTS preload HSTS preload

My personal website and blog, built with 11ty and Workbox. Hosted on Cloudflare Pages.

Features

Installation

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

Development

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.

Test the production build locally

Build all templates, CSS, JS, _headers file and the service worker:

npm run build

Serve the production build:

npm run site:serve

Deploy

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 Pages

Don't forget to set the environment variables NODE_ENV and NODE_VERSION in the Cloudflare Pages dashboard. In particular, NODE_VERSION is used by the Cloudflare Pages V2 build system.

Security

Run a security audit on the HTTP headers

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:

Security policy

See SECURITY.md.

Dependencies

Production dependencies

This project has 53 dependencies.

Package Version
@11ty/eleventy ^3.0.0
@11ty/eleventy-fetch ^4.0.1
@11ty/eleventy-navigation ^0.3.5
@11ty/eleventy-plugin-rss ^2.0.2
@11ty/eleventy-plugin-syntaxhighlight ^5.0.0
@11ty/eleventy-plugin-webc ^0.11.2
@11ty/is-land ^4.0.0
@chrisburnell/eleventy-cache-webmentions ^2.1.8
@google-cloud/storage ^7.13.0
@google-cloud/text-to-speech ^5.5.0
@jackdbd/content-security-policy ^3.0.0
@jackdbd/eleventy-plugin-ensure-env-vars ^1.2.0
@jackdbd/eleventy-plugin-telegram ^2.2.0
@jackdbd/eleventy-plugin-text-to-speech ^3.2.0
@jackdbd/hosting-utils ^1.0.0
@jackdbd/permissions-policy ^1.0.0
@thi.ng/transclude ^0.1.108
autoprefixer ^10.4.20
clean-css ^5.3.3
cloudinary ^2.5.1
cssnano ^7.0.6
debug ^4.3.7
eleventy-plugin-embed-cloudinary ^1.0.2
eleventy-plugin-embed-twitter ^1.4.1
eleventy-plugin-emoji ^1.1.0
eleventy-plugin-helmet ^0.2.2
eleventy-plugin-nesting-toc ^1.3.0
eleventy-plugin-reading-time ^0.0.1
eleventy-plugin-vimeo-embed ^1.3.8
eleventy-plugin-youtube-embed ^1.11.0
esbuild ^0.24.0
globby ^14.0.2
html-minifier-terser ^7.2.0
instant.page ^5.2.0
luxon ^3.5.0
markdown-it ^14.1.0
markdown-it-anchor ^9.2.0
npm-run-all ^4.1.5
pagefind ^1.1.1
postcss ^8.4.47
postcss-cli ^11.0.0
sanitize-html ^2.13.1
slugify ^1.6.6
stripe ^17.2.1
tailwindcss ^3.4.14
terser ^5.36.0
tsm ^2.3.0
workbox-build ^7.1.1
workbox-core ^7.1.0
workbox-expiration ^7.1.0
workbox-precaching ^7.1.0
workbox-routing ^7.1.0
zod ^3.23.8

Development 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.

Troubleshooting

Troubleshooting the service worker

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.

License

© 2020 - 2024 Giacomo Debidda // MIT License

About

My personal website and blog, built with 11ty and Workbox.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published