Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/skills/add-blog-post/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,22 @@ Never invent names like `bp.md`, `bp.lg`, `bp.sm` — they will cause a Sass com

### 5. Add a cover image

Place the cover image at:
Place the cover image under `static/images/posts/<post-slug>/`. Use an **SEO-friendly filename** — a descriptive kebab-case name that reflects the post topic, not a generic name like `cover.webp`:

```
static/images/posts/<post-slug>/cover.webp
static/images/posts/<post-slug>/descriptive-kebab-case-name.webp
```

For example, for a post about submitting trackers to newTrackon:

```
static/images/posts/submitting-trackers-to-newtrackon/submitting-bittorrent-tracker-to-newtrackon.webp
```

Update `coverImage` in `metadata.ts` to match the exact filename you chose:

```typescript
coverImage: '/images/posts/<post-slug>/descriptive-kebab-case-name.webp',
```

- Preferred format: WebP
Expand Down
14 changes: 14 additions & 0 deletions src/routes/blog/submitting-trackers-to-newtrackon/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { getMetadata } from '$lib/data/metadata';
import type { PageServerLoad } from './$types';

export const load: PageServerLoad = async ({ url }) => {
const slug = url.pathname.split('/').filter(Boolean).pop();
if (!slug) throw new Error('Slug could not be determined.');

const metadata = await getMetadata();
const currentPost = metadata.find((post) => post.slug === slug);

if (!currentPost) throw new Error(`Post not found: ${slug}`);

return { currentPost, allPosts: metadata };
};
Loading
Loading