Skip to content

Commit f288812

Browse files
committed
feat(seo): name the category and use in the home page title
Set the home page and default <title> to "Memos - Open-source, self-hosted notes for everyday thoughts" so the search result says what Memos is on an ambiguous brand query. Social titles keep the headline.
1 parent 2bbf292 commit f288812

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎src/app/(public)/(site)/page.test.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ vi.mock("@/features/marketing/components/home-faq-section", () => ({
2727
HomeFaqSection: () => <section data-testid="home-faq" />,
2828
}));
2929

30-
import { BRAND_DESCRIPTION, BRAND_HEADLINE } from "@/shared/lib/branding";
31-
import HomePage from "./page";
30+
import { BRAND_DESCRIPTION, BRAND_HEADLINE, BRAND_SEARCH_TITLE, BRAND_TITLE } from "@/shared/lib/branding";
31+
import HomePage, { metadata } from "./page";
3232

3333
describe("HomePage", () => {
3434
it("pairs the canonical headline and description in the hero", () => {
@@ -39,6 +39,12 @@ describe("HomePage", () => {
3939
expect(screen.getByText(BRAND_DESCRIPTION)).toBeVisible();
4040
});
4141

42+
it("uses the search title for the page title and the headline for social titles", () => {
43+
expect(metadata.title).toEqual({ absolute: BRAND_SEARCH_TITLE });
44+
expect(metadata.openGraph?.title).toBe(BRAND_TITLE);
45+
expect(metadata.twitter?.title).toBe(BRAND_TITLE);
46+
});
47+
4248
it("emphasizes only everyday thoughts with the shared brand accent", () => {
4349
render(<HomePage />);
4450

‎src/app/(public)/(site)/page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { HomeFaqSection } from "@/features/marketing/components/home-faq-section
55
import { HomeFindSection } from "@/features/marketing/components/home-find-section";
66
import { HomeOwnSection } from "@/features/marketing/components/home-own-section";
77
import { HomeWriteSection } from "@/features/marketing/components/home-write-section";
8-
import { BRAND_DESCRIPTION, BRAND_HEADLINE, BRAND_TITLE } from "@/shared/lib/branding";
8+
import { BRAND_DESCRIPTION, BRAND_HEADLINE, BRAND_SEARCH_TITLE, BRAND_TITLE } from "@/shared/lib/branding";
99
import { buildDefaultOpenGraphImages, DEFAULT_OG_IMAGE } from "@/shared/lib/seo";
1010

1111
export const metadata: Metadata = {
1212
title: {
13-
absolute: BRAND_TITLE,
13+
absolute: BRAND_SEARCH_TITLE,
1414
},
1515
description: BRAND_DESCRIPTION,
1616
keywords: ["memos", "quick thoughts", "timeline", "Markdown notes", "private notes", "daily notes"],

‎src/app/layout.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Inter, Source_Serif_4 } from "next/font/google";
44
import { ThemeProvider } from "next-themes";
55
import type { ReactNode } from "react";
66
import { BRAND_ASSETS_PATH, BRAND_LOGO_URL } from "@/shared/lib/brand-assets";
7-
import { BRAND_DESCRIPTION, BRAND_TITLE } from "@/shared/lib/branding";
7+
import { BRAND_DESCRIPTION, BRAND_SEARCH_TITLE, BRAND_TITLE } from "@/shared/lib/branding";
88
import { buildSiteNavigationJsonLd, DEFAULT_OG_IMAGE, DEFAULT_OG_IMAGE_ALT, GITHUB_REPO_URL } from "@/shared/lib/seo";
99

1010
const inter = Inter({
@@ -22,7 +22,7 @@ const displaySerif = Source_Serif_4({
2222
export const metadata: Metadata = {
2323
metadataBase: new URL("https://usememos.com"),
2424
title: {
25-
default: BRAND_TITLE,
25+
default: BRAND_SEARCH_TITLE,
2626
template: "%s - Memos",
2727
},
2828
description: BRAND_DESCRIPTION,

‎src/shared/lib/branding.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { readFileSync } from "node:fs";
22
// @vitest-environment node
33
import { describe, expect, it } from "vitest";
4-
import { BRAND_DESCRIPTION, BRAND_FULL_INTRODUCTION, BRAND_HEADLINE, BRAND_TITLE } from "./branding";
4+
import { BRAND_DESCRIPTION, BRAND_FULL_INTRODUCTION, BRAND_HEADLINE, BRAND_SEARCH_TITLE, BRAND_TITLE } from "./branding";
55
import { buildDefaultOpenGraphImages } from "./seo";
66

77
describe("product branding", () => {
88
it("keeps the approved copy from BRAND.md", () => {
99
expect(BRAND_HEADLINE).toBe("Simple note-taking for your everyday thoughts.");
10+
expect(BRAND_SEARCH_TITLE).toBe("Memos - Open-source, self-hosted notes for everyday thoughts");
1011
expect(BRAND_DESCRIPTION).toBe(
1112
"Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.",
1213
);

‎src/shared/lib/branding.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Change upstream BRAND.md first, then propagate these strings verbatim.
33
export const BRAND_HEADLINE = "Simple note-taking for your everyday thoughts.";
44
export const BRAND_TITLE = `Memos - ${BRAND_HEADLINE}`;
5+
/** Home page and default <title>, shown in search results and browser tabs. Not yet a row in upstream BRAND.md. */
6+
export const BRAND_SEARCH_TITLE = "Memos - Open-source, self-hosted notes for everyday thoughts";
57
export const BRAND_DESCRIPTION =
68
"Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.";
79
export const BRAND_FULL_INTRODUCTION =

0 commit comments

Comments
 (0)