Personal website and tech blog
NOTE: This could be simplified in the future to allow fully automatic builds.
- Git clone the talks repo https://github.com/Greenheart/talks
- To build all talks, go to the root directory of the
talksproject and runpnpm i && pnpm build. To build a specific talk, use the build command specific for that talk, and copy it over to the website repo. - In the website project, run
pnpm buildto build project with all talks. - Review the build output and remove unwanted HTML, CSS and JS. Replace favicon CDN imports. Replace font URLs to use the local fonts served together with this project.
- Verify everything works as expected and deploy.
- Make a copy of
.env.exampleand name it.env. - Add your email to
VITE_EMAILin.env. - Add a strong password to encrypt/decrypt your email to
VITE_PASSWORDin.env. - Open a terminal and run
pnpm encrypt:text. Then copy the output (make sure you get every character) and add it toVITE_PAYLOADin.env. - Now, the email should be accessible in the
<EncryptedEmail />component. Easily available for users, but most basic spambots will not be able to extract the email.
- Use
node scripts/title-case.tsto format headings. - Use
node scripts/format-code.tsto ensure code has a consistent style. - Add
<!-- prettier-ignore-start -->and<!-- prettier-ignore-end -->to wrap code blocks in blog posts to prevent the main Prettier instance of the codebase to re-format the code blocks after they already have been formatted withnode scripts/format-code.js. - It's possible to prevent post drafts from rendering by prefixing the file with
_.
To avoid checking in draft posts that start with the _ prefix, append the following ignore pattern to .git/info/exclude:
echo "src/content/posts/_*" >> .git/info/excludeThis will include the draft posts during local development, but instruct Git to ignore these filenames starting with _.
To publish a draft post, just rename the file and remove the _ prefix. Then both the production build will include the file, and Git will let make it available to stage and commit.
Note that this might exclude these files from project search results, so you might need to explicitly include search locations like src/**/* to get the results you want.
Also note that .git/info/exclude only applies to the local Git repository and needs to be added for newly clones repositories. The reason for using this approach instead of .gitignore is because this allows some tools (like for example Keystatic CMS) to include the file, while still instructing Git to ignore the file.
Copyright (c) 2015-2025 Samuel Plumppu
Source code licensed under Apache 2.0.