# Cozy Den - Developer Documentation ## Project Overview Cozy Den is a landing page for hiddenden.cafe built with Astro. The site features a warm, cozy aesthetic inspired by coffee shops and hidden dens, representing values of privacy, self-hosting, and open-source software. **Tech Stack:** - Astro 4.x (Static Site Generator) - TypeScript (strict mode) - Vanilla CSS with CSS Custom Properties - Docker + Nginx for deployment - Node.js 18+ ## Project Structure ``` cozy-den/ ├── src/ │ ├── content/ │ │ ├── config.ts # Content collection schema │ │ └── blog/ │ │ └── *.md # Blog posts (Markdown) │ ├── layouts/ │ │ └── BaseLayout.astro # Base HTML layout with global styles │ ├── pages/ │ │ ├── index.astro # Main landing page │ │ ├── 404.astro # Custom 404 error page │ │ └── blog/ │ │ ├── index.astro # Blog listing page (/blog) │ │ └── [...slug].astro # Individual post pages (/blog/) ├── public/ │ ├── favicon.svg # Site favicon (coffee emoji) │ ├── robots.txt # Search engine directives │ └── blog/ # Blog post images (per-post subdirectory) ├── astro.config.mjs # Astro configuration with sitemap ├── package.json # Node dependencies ├── tsconfig.json # TypeScript configuration ├── Dockerfile # Multi-stage Docker build ├── docker-compose.yml # Docker Compose setup ├── nginx.conf # Nginx configuration for production ├── .gitignore # Git ignore rules └── README.md # User-facing documentation ``` ## Color Palette The site uses CSS custom properties for theming. All colors are defined in `src/layouts/BaseLayout.astro`: ```css --color-bg: #1e1e2e /* Dark background (Catppuccin Mocha base) */ --color-text: #cdd6f4 /* Light text */ --color-text-dim: #a6adc8 /* Dimmed text for less emphasis */ --color-accent: #cba6f7 /* Mauve accent */ --color-accent-bright: #f5c2e7 /* Pink accent for highlights */ --color-surface: #313244 /* Surface color for borders/cards */ --color-blue: #89b4fa /* Blue for links */ --color-green: #a6e3a1 /* Green for code */ --color-peach: #fab387 /* Peach for labels */ ``` ## Component Architecture ### BaseLayout.astro The base layout provides: - HTML structure and meta tags - Global CSS reset and typography - CSS custom properties for theming - Global animations (fadeIn) ### index.astro The main page includes these sections: 1. **Header** - Title 2. **About** - Introduction, age, status 3. **Cryptographic Keys** - PGP fingerprint and SSH public key 4. **Games** - Games Latte plays 5. **Socials** - Links to social platforms 6. **Services** - Self-hosted services 7. **Support** - Crypto donation addresses 8. **Blog** - Link to `/blog` 9. **Footer** - Credits ### blog/index.astro Blog listing page at `/blog`. Fetches all non-draft posts from the `blog` content collection, sorted by date descending. ### blog/[...slug].astro Individual blog post page. Renders Markdown content using Astro's `` component. Styles for prose content (headings, paragraphs, code blocks, images, etc.) are scoped within `.content :global(...)`. ### src/content/config.ts Defines the `blog` content collection schema: - `title` (string) — post title - `date` (date) — publish date, used for sorting - `description` (string) — shown on the listing page - `draft` (boolean, optional) — set to `true` to hide from listing ### 404.astro Custom error page with: - Themed styling matching the cozy aesthetic - Clear error message ("Lost in the Den?") - Action buttons to return home or visit Gitea - Responsive design for all devices ## Development Workflow ### Local Development 1. Install dependencies: ```bash npm install ``` 2. Start dev server (with hot reload): ```bash npm run dev ``` Server runs at `http://localhost:4321` 3. Build for production: ```bash npm run build ``` Output goes to `dist/` directory 4. Preview production build: ```bash npm run preview ``` ### Making Changes **Adding a new section:** 1. Edit `src/pages/index.astro` 2. Add a new `
` block 3. Style it in the `