feat: caching

This commit is contained in:
2026-01-20 20:07:14 +01:00
parent ff2a2fee48
commit 0f13d67f10
17 changed files with 333 additions and 224 deletions
+54 -13
View File
@@ -1,32 +1,73 @@
# Schreifuchs
# schreifuchs.ch
Schreifuchs.ch ist meine persönliche Webseite.
Personal portfolio website for Schreifuchs, featuring photography, informatics, music, and video.
## Developing
The site is built with **Svelte 5** and **SvelteKit**, and it is powered by a dynamic **Nextcloud** backend via WebDAV.
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
## Features
- **Dynamic Content:** Pages are automatically discovered based on the folder structure in Nextcloud.
- **Markdown Driven:** Content for each page is fetched from a corresponding Markdown file.
- **Asset Proxying:** Images and attachments are securely streamed from Nextcloud through a server-side proxy.
- **Performance:** In-memory caching for Nextcloud requests (15-minute TTL).
- **Responsive Design:** Styled with Tailwind CSS, optimized for all screen sizes.
## Tech Stack
- **Framework:** Svelte 5 (Runes) & SvelteKit
- **Styling:** Tailwind CSS
- **Backend:** Node.js (via `@sveltejs/adapter-node`)
- **Integration:** `webdav` library for Nextcloud communication
- **Content:** `@ts-stack/markdown` for rendering
## Configuration
The application requires the following environment variables in a `.env` file:
```env
NEXTCLOUD_URL=https://your-nextcloud-instance.com
NEXTCLOUD_USER=your_username
NEXTCLOUD_PASSWORD=your_app_password
NEXTCLOUD_BASE_DIR=WebsiteContent # Optional: Root folder for site content
```
## Content Management
To add or update content, manage files in your configured Nextcloud directory:
1. **Create a Page:** Create a folder (e.g., `Travel`).
2. **Add Content:** Inside that folder, create a Markdown file named after the folder (e.g., `Travel.md`).
3. **Add Header Image:** Upload a file named `cover.webp`, `cover.jpg`, or `cover.png` to the folder. This will be used as the header on the page and the tile on the homepage.
4. **Add Assets:** Any other images or files uploaded to the folder can be linked in the Markdown.
## Development
Install dependencies:
```bash
npm run dev
pnpm install
```
# or start the server and open the app in a new browser tab
npm run dev -- --open
Start the development server:
```bash
pnpm run dev
```
## Building
To create a production version of your app:
Build for production (Node.js):
```bash
npm run build
pnpm run build
```
You can preview the production build with `npm run preview`.
The output will be in the `build/` directory, ready to be served by Node.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
## Image Processing
## Resize images
To optimize images before uploading to Nextcloud:
```bash
convert input.png -resize 3000 -quality 80 output.webp
```
```