Københavnerkuglen: shakeable Copenhagen snow globe (Advent of AI Slop Day 3)
This commit is contained in:
commit
bb3abcf85c
18 files changed
+2252
No files matched your search
@@ -0,0 +1,53 @@
|
||||
# My Advent of AI Slop entry
|
||||
|
||||
One small web page, made for one day of [Advent of AI Slop](https://advent-of-slop.quesma.com) (1 to 24 December
|
||||
2026). The task of each day is behind its door there. One repository per day, named
|
||||
`advent-of-slop-<day>-<title>`, for example `advent-of-slop-01-living-fishtank`.
|
||||
|
||||
## What is here
|
||||
|
||||
- `index.html` and `src/main.ts`: the page.
|
||||
- `src/badge.ts`: the label in the top right corner, "Advent of AI Slop [Day 1] Living fishtank", which links to the
|
||||
calendar and to the day.
|
||||
- `public/preview.png`: the picture shown when the link is shared.
|
||||
- `.github/workflows/pages.yml`: publishes the page on GitHub Pages after every push to `main`.
|
||||
|
||||
## Building it
|
||||
|
||||
What the page does and how it looks is free: any library, any framework, any style. Add packages with pnpm.
|
||||
|
||||
Keep these in `index.html`:
|
||||
|
||||
- `<title>`, the description and the `og:` tags, rewritten for what was built.
|
||||
- `<advent-badge day="N" name="...">` with the day this is for and the title of that day, and the script that loads
|
||||
`src/badge.ts`.
|
||||
|
||||
Replace `public/preview.png` with a 1200 by 630 screenshot of the finished page.
|
||||
|
||||
The page is served from `https://<login>.github.io/<repository>/`, so:
|
||||
|
||||
- Links and file paths are relative (`./`), never starting with `/`.
|
||||
- There is no server. Everything runs in the browser, and anything in the page, API keys included, is public.
|
||||
|
||||
## Commands
|
||||
|
||||
```sh
|
||||
pnpm install
|
||||
pnpm dev # http://localhost:5173/
|
||||
pnpm build # typecheck and build to dist/; must pass before a push
|
||||
```
|
||||
|
||||
## Publishing
|
||||
|
||||
Push to `main`. A minute later the page is at `https://<login>.github.io/<repository>/`.
|
||||
|
||||
Once per repository, GitHub Pages has to take its site from GitHub Actions (Settings > Pages > Source), or:
|
||||
|
||||
```sh
|
||||
gh api -X POST "repos/{owner}/{repo}/pages" -f build_type=workflow
|
||||
```
|
||||
|
||||
A push made before that fails in the "Publish" workflow: run it again (`gh run rerun --failed`).
|
||||
|
||||
To be listed on the calendar, the repository is public and belongs to the person's own account, not an
|
||||
organization. They submit the address of the page and of the repository on the day's page.
|
||||
Reference in new issue
Block a user