fix(config): update prerender origin to use PUBLIC_ORIGIN env variable

Update svelte.config.js to use PUBLIC_ORIGIN environment variable for prerender origin with fallback to localhost. Add PUBLIC_ORIGIN to .env.example and update README.md to reflect these changes.

ewancroft.uk 34f3d0e4 456e8d6a

verified
+4 -1
.env.example
··· 19 19 20 20 # Example DIDs: 21 21 # DIRECTORY_OWNER=did:plc:abc123def456ghi789jkl012mno345pqr678stu 22 - # PUBLIC_LINKAT_USERS=did:plc:user1,did:plc:user2,did:plc:user3,did:plc:user4 22 + # PUBLIC_LINKAT_USERS=did:plc:user1,did:plc:user2,did:plc:user3,did:plc:user4 23 + 24 + # Publicly accessible origin for prerendering (required) 25 + PUBLIC_ORIGIN=http://localhost:5713
+2 -2
README.md
··· 55 55 ```bash 56 56 npm run dev 57 57 ``` 58 - The application will be accessible at `http://localhost:5173`. 58 + The application will typically be accessible at `http://localhost:5173`. For prerendering, the `origin` defaults to `http://localhost:5713` unless the `PUBLIC_ORIGIN` environment variable is set. 59 59 60 60 ## Usage 61 61 ··· 74 74 - `src/lib/css/`: Global CSS styles, including `app.css` (for general styling) and `variables.css` (for CSS variables). 75 75 - `src/lib/utils/`: Utility functions, such as caching mechanisms. 76 76 - `src/lib/profile/profile.ts`: Logic for fetching and processing user profile data from Bluesky. 77 - - `svelte.config.js`: SvelteKit configuration, including prerendering settings. Note that the `origin` property in `prerender` has been removed for Vercel deployments to simplify the setup. 77 + - `svelte.config.js`: SvelteKit configuration, including prerendering settings. The `origin` property in `prerender` now defaults to `http://localhost:5713` unless overridden by the `PUBLIC_ORIGIN` environment variable. 78 78 79 79 ## Contributing 80 80
+1 -1
svelte.config.js
··· 14 14 adapter: adapter(), 15 15 prerender: { 16 16 entries: ['*'], 17 - origin: '' 17 + origin: process.env.PUBLIC_ORIGIN || 'http://localhost:5713' 18 18 }, 19 19 alias: { 20 20 '$components': './src/lib/components',