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
11 changes: 8 additions & 3 deletions apps/site/src/lib/seo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,20 @@ export function freeSoftwareSchema({
};
}

/** The pricing page: coss.com with its self-serve plans. */
/**
* The pricing page: coss.com with its self-serve plans. Not a schema.org `Product`: Google reads
* one as a shop's merchant listing, and refuses it for having no image.
*/
export function pricingSchema(description: string) {
return {
"@context": "https://schema.org",
"@type": "Product",
"@type": "SoftwareApplication",
name: SITE_NAME,
description,
url: abs("/pricing"),
brand: { "@id": ORGANIZATION_ID },
applicationCategory: "DeveloperApplication",
operatingSystem: "Any (HTTPS API)",
provider: { "@id": ORGANIZATION_ID },
offers: offers(),
};
}
Expand Down
6 changes: 5 additions & 1 deletion apps/site/test/seo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { withoutNestedFolders } from "../src/lib/docs-tree";
import { ALL_PRODUCT_LINKS, FOOTER_COLUMNS } from "../src/lib/nav";
import { singleOperationProps } from "../src/lib/openapi-single-operation";
import { rateTables } from "../src/lib/pricing";
import { metaDescription } from "../src/lib/seo";
import { metaDescription, pricingSchema } from "../src/lib/seo";
import { markdownResponse, PRODUCTS, SITE_DESCRIPTION } from "../src/lib/site";
import { FREE_TOOLS } from "../src/lib/tools";

Expand Down Expand Up @@ -273,3 +273,7 @@ describe("changelog", () => {
for (const entry of CHANGELOG) expect(markdown).toContain(entry.title);
});
});

test("the pricing page isn't a merchant listing, which Google refuses without an image", () => {
expect(pricingSchema("Plans.")["@type"]).toBe("SoftwareApplication");
});
Loading