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
7 changes: 4 additions & 3 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Link from "next/link";
import { ArticleBody } from "@/components/content/article-body";
import { formatDate } from "@/components/content/format-date";
import { Button, Eyebrow, container } from "@/components/site/page-kit";
import { SITE_NAME, blogPostingJsonLd, excerptOf, jsonLdString, pageTitle, withSocial } from "@/lib/seo";
import { SITE_NAME, blogPostingJsonLd, excerptOf, jsonLdString, pageTitle, snippetOf, withSocial } from "@/lib/seo";

const backLink =
"inline-flex min-h-11 items-center text-[15px] font-medium text-[#5C5C5C] transition-colors hover:text-[#0A0A0A]";
Expand All @@ -31,9 +31,10 @@ export async function generateMetadata({
if (!fs.existsSync(filePath)) return { title: "Post not found", robots: { index: false } };
const { data, content } = matter(fs.readFileSync(filePath, "utf-8"));
const date = data.date ? new Date(data.date) : undefined;
const description = data.description ?? excerptOf(content);
const description = snippetOf(data.description) ?? excerptOf(content);
return withSocial({
title: pageTitle(data.title),
// seoTitle is a shorter headline for the browser tab and search results only
title: pageTitle(data.seoTitle ?? data.title),
description,
alternates: { canonical: `/blog/${slug}` },
openGraph: {
Expand Down
2 changes: 1 addition & 1 deletion app/dwosi/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

const title = "DWOSI · Dev Weekends Open Source Initiative"
const description =
"Where early-career engineers prove their work in public. A free open source initiative where contributors build live products, with every pull request reviewed by product maintainers."
"Where early-career engineers prove their work in public. A free open source initiative: contributors build live products, maintainers review every pull request."

export const metadata: Metadata = {
title: { absolute: title },
Expand Down
6 changes: 3 additions & 3 deletions app/guides/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Metadata } from "next";
import { ArticleBody } from "@/components/content/article-body";
import { formatDate } from "@/components/content/format-date";
import { Button, Eyebrow, container } from "@/components/site/page-kit";
import { blogPostingJsonLd, jsonLdString, pageTitle, withSocial } from "@/lib/seo";
import { blogPostingJsonLd, jsonLdString, pageTitle, snippetOf, withSocial } from "@/lib/seo";
import { svgSize } from "@/lib/svg-size";

const guidesDir = path.join(process.cwd(), "content", "guides");
Expand Down Expand Up @@ -35,8 +35,8 @@ export async function generateMetadata({
const guide = readGuide(slug);
if (!guide) return { title: "Guide not found", robots: { index: false } };
return withSocial({
title: pageTitle(guide.data.title),
description: guide.data.description ?? "",
title: pageTitle(guide.data.seoTitle ?? guide.data.title),
description: snippetOf(guide.data.description) ?? "",
alternates: { canonical: `/guides/${slug}` },
});
}
Expand Down
1 change: 1 addition & 0 deletions app/llms-full.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Everything Dev Weekends runs is free for members. Any page below can be read as
- [Ambassadors](${SITE_URL}/ambassadors): The people who represent and grow the community around the world
- [Sessions](${SITE_URL}/sessions): Past and upcoming talks and workshops
- [Projects](${SITE_URL}/projects): Projects built by members
- [Resources](https://resources.devweekends.com): The free learning hub on its own site: system design, low-level design, DSA patterns, AWS, AI engineering, operating systems, courses and case studies
- [Partners](${SITE_URL}/partners): The organisations and communities working with Dev Weekends
- [Network](${SITE_URL}/network): Mentors and mentees and how they connect

Expand Down
1 change: 1 addition & 0 deletions app/llms.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Every public page is also available as Markdown: request it with the header \`Ac
- [Community](https://www.devweekends.com/community): Discord, WhatsApp groups and live sessions, and how to join
- [Partners](https://www.devweekends.com/partners): The organisations and communities working with Dev Weekends
- [Projects](https://www.devweekends.com/projects): Projects built by members
- [Resources](https://resources.devweekends.com): The free learning hub on its own site: system design, low-level design, DSA patterns, AWS, AI engineering, operating systems, courses and case studies
- [Blog](https://www.devweekends.com/blog): News, guides and articles

## Machine-readable discovery
Expand Down
2 changes: 1 addition & 1 deletion app/mentorship/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const metadata: Metadata = withSocial({
alternates: { canonical: "/mentorship" },
title: "Mentorship",
description:
"Dev Weekends mentorship: a free 3-month program with a personal mentor, live coding sessions and job preparation. It runs all year, except while a fellowship is running.",
"Dev Weekends mentorship: a free 3-month program with a personal mentor, live coding sessions and job preparation. It runs all year, except during a fellowship.",
})

const body = "mt-3 text-[15px] leading-[1.6] text-[#5C5C5C]"
Expand Down
1 change: 1 addition & 0 deletions content/blog/fellowship-2025-impact-report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Summer Fellowship 2025 impact report: 800 fellows, 100 certified, 442 projects"
seoTitle: "Summer Fellowship 2025 impact report: 800 fellows, 442 projects"
date: "2025-09-21"
category: "news"
featured: false
Expand Down
1 change: 1 addition & 0 deletions content/blog/fellowship-2026-impact-report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Fellowship 2026 impact report: 1,072 fellows, 474 projects, 79 internships"
seoTitle: "Fellowship 2026 impact report: 1,072 fellows, 474 projects"
date: "2026-11-06"
category: "news"
featured: false
Expand Down
1 change: 1 addition & 0 deletions content/blog/fellowship-2026-next-steps.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Fellowship 2026 applications are now closed. Here is what comes next"
seoTitle: "Fellowship 2026 applications are closed. What comes next"
date: "2026-06-05"
category: "news"
featured: true
Expand Down
1 change: 1 addition & 0 deletions content/blog/gsoc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "9 Dev Weekends contributors got into Google Summer of Code 2026, and 5 more into other open-source programs"
seoTitle: "9 Dev Weekends contributors got into Google Summer of Code 2026"
date: "2026-05-06"
category: "news"
featured: true
Expand Down
1 change: 1 addition & 0 deletions content/blog/lfx-mentorship-2026-talha-amjad.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Talha Amjad selected for LFX Mentorship 2026 at CNCF, contributing to Volcano"
seoTitle: "Talha Amjad selected for LFX Mentorship 2026 at CNCF"
date: "2026-09-23"
category: "news"
featured: true
Expand Down
19 changes: 19 additions & 0 deletions lib/seo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ export function excerptOf(markdown: string, max = 155): string | undefined {
return `${text.slice(0, text.lastIndexOf(' ', max - 1)).replace(/[\s,;:.]+$/, '')}...`
}

/**
* A description cut to what a search result shows (about 160 characters):
* whole sentences while they fit, otherwise the first one cut at a word. The
* page itself still shows the full text.
*/
export function snippetOf(text: string | undefined, max = 160): string | undefined {
if (!text) return undefined
const clean = text.replace(/\s+/g, ' ').trim()
if (clean.length <= max) return clean
let kept = ''
for (const sentence of clean.split(/(?<=[.!?])\s+(?=[A-Z0-9"'])/)) {
const next = kept ? `${kept} ${sentence}` : sentence
if (next.length > max) break
kept = next
}
if (kept.length >= 70) return kept
return `${clean.slice(0, clean.lastIndexOf(' ', max - 4)).replace(/[\s,;:.]+$/, '')}...`
}

/** Long headlines fill the search result by themselves, so they go without the site name */
export function pageTitle(title: string): string | { absolute: string } {
return title.length > 48 ? { absolute: title } : title
Expand Down
Loading