|
32 | 32 | - [🎈 Content creation helpers](#-content-creation-helpers) |
33 | 33 | - [Add a new post](#add-a-new-post) |
34 | 34 | - [🚚 Deployment](#-deployment) |
35 | | - - [S3 Deployment](#s3-deployment) |
36 | 35 | - [🏛 Licenses](#-licenses) |
37 | 36 | - [Posts](#posts) |
38 | 37 | - [Photos \& images](#photos--images) |
|
41 | 40 |
|
42 | 41 | ## 🎉 Features |
43 | 42 |
|
44 | | -The whole [blog](https://kremalicious.com) is a statically exported site built with [Astro](https://astro.build) and TypeScript. Almost all components are Astro or native Web Components, with some React components loaded client-side. |
| 43 | +The whole [blog](https://kremalicious.com) is a statically exported site built with [Astro](https://astro.build) and TypeScript. Almost all components are Astro or native Web Components, with some React components. |
45 | 44 |
|
46 | 45 | Styling happens through a combination of basic global styles and on components level either through CSS modules or CSS in `<style>` tags within Astro components. |
47 | 46 |
|
| 47 | +The high-level tech stack in a convenient buzzword list: |
| 48 | + |
| 49 | +- [Astro](https://astro.build) |
| 50 | +- [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) + [CSS Modules](https://github.com/css-modules/css-modules) |
| 51 | +- [TypeScript](https://www.typescriptlang.org) |
| 52 | +- [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) |
| 53 | +- [React](https://react.dev) |
| 54 | +- [Biome](https://biomejs.dev) |
| 55 | +- [Bun](https://bun.com) |
| 56 | + |
48 | 57 | Content lives under `content/` and Astro creates a content collection for each subfolder, which are then queried in components. Every post is a folder with a markdown file and all respective post assets co-located inside. |
49 | 58 |
|
50 | | -Retrieving content collections will enrich every post's frontmatter metadata, like extracting date and slug from the post folder name, or exif extraction for photos. |
| 59 | +Retrieving content collections enriches every post's frontmatter metadata, like extracting date and slug from the post folder name, or exif extraction for photos. |
51 | 60 |
|
52 | 61 | ### 🌅 Image handling |
53 | 62 |
|
@@ -132,11 +141,16 @@ If you want to know how this works, have a look at the respective component unde |
132 | 141 |
|
133 | 142 | ### 🌗 Theme Switcher |
134 | 143 |
|
135 | | -Includes a theme switcher which allows user to toggle between a light and a dark theme. Switching between them also happens automatically based on user's system preferences. |
| 144 | +Includes a theme switcher which allows to toggle between a light and a dark theme. Done without any dependencies: |
| 145 | + |
| 146 | +- before document renders, the theme is set based on system preference or session storage user preference in the `<head>` |
| 147 | +- the theme switch web component then listens/dispatches a custom event to sync its UI |
136 | 148 |
|
137 | | -If you want to know how, have a look at the respective components: |
| 149 | +If you want to know how this works in detail, have a look at the respective files: |
138 | 150 |
|
139 | | -- [`src/components/ThemeSwitch/`](src/components/ThemeSwitch/) |
| 151 | +- [`theme.ts`](src/features/theme-switch/lib/theme.ts) |
| 152 | +- [`theme-switch-element.ts`](src/features/theme-switch/components/theme-switch-element.ts) |
| 153 | +- [`ThemeSwitch.astro`](src/features/theme-switch/components/ThemeSwitch.astro) |
140 | 154 |
|
141 | 155 | ### 🎯 astro-redirect-from |
142 | 156 |
|
@@ -242,11 +256,7 @@ bun run new photo /path/to/photo1.jpg /path/to/photo2.jpg "Shared Title For Phot |
242 | 256 |
|
243 | 257 | ## 🚚 Deployment |
244 | 258 |
|
245 | | -Every branch or Pull Request is automatically deployed by [Vercel](https://vercel.com) with their GitHub integration for testing. A link to a preview deployment will appear under each Pull Request. Vercel is NOT used for the production deployment. |
246 | | - |
247 | | -### S3 Deployment |
248 | | - |
249 | | -The latest deployment of the `main` branch is automatically deployed to S3 from the GitHub Action as the production deployment, aliased to `kremalicious.com`. The deploy command calls the [`scripts/deploy-s3.sh`](scripts/deploy-s3.sh) script, syncing the contents of the `dist/` folder to S3: |
| 259 | +The latest deployment of the `main` branch is automatically deployed to S3 from the GitHub Action as the production deployment, aliased to `kremalicious.com`. The deploy command calls the [`scripts/deploy-s3.sh`](scripts/deploy-s3.sh) script, syncing the contents of the `dist/` folder to S3 with proper caching headers applied: |
250 | 260 |
|
251 | 261 | ```bash |
252 | 262 | bun run deploy:s3 |
|
0 commit comments