Skip to content

Commit

Permalink
enforce 50 <= description length <= 160
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Feb 26, 2024
1 parent 9832c8a commit 463e9a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/commands/checkMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ const readMetadata = async (filePath: string): Promise<Record<string, any>> => {
};

const isValidMetadata = (metadata: Record<string, any>): boolean =>
metadata.title && metadata.description;
metadata.title &&
metadata.description &&
metadata.title != metadata.description &&
metadata.description.length <= 160 &&
metadata.description.length >= 50;

const main = async (): Promise<void> => {
const args = readArgs();
Expand Down Expand Up @@ -106,7 +110,7 @@ function handleErrors(mdErrors: string[], notebookErrors: string[]): void {
---
The title should be the page title: it's used for browser tabs and the top line of search results. The description should describe the page
in <160 characters, ideally using some keywords. The description is what
in at least 50 but no more than 160 characters, ideally using some keywords. The description is what
shows up as the text in search results. See https://github.com/Qiskit/documentation/issues/131 for some tips.
Please fix these files:\n\n${mdErrors.join("\n")}
Expand Down

0 comments on commit 463e9a4

Please sign in to comment.