Skip to content

Commit

Permalink
Merge pull request #488 from cevdetarda/master
Browse files Browse the repository at this point in the history
feat(metas.ts): Simplify Twitter Card Tags
  • Loading branch information
oscarotero authored Sep 13, 2023
2 parents b4b12ce + c877758 commit 9739e36
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions plugins/metas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,12 @@ export default function (userOptions?: Partial<Options>) {
addMeta(document, "property", "og:image", image || icon);

// Twitter cards
addMeta(document, "name", "twitter:title", title, 65);
addMeta(document, "name", "twitter:description", description, 200);
addMeta(
document,
"name",
"twitter:card",
image ? "summary_large_image" : "summary",
);
addMeta(document, "name", "twitter:image", image || icon);
addMeta(document, "name", "twitter:site", twitter);

// Schema.org
Expand Down
9 changes: 0 additions & 9 deletions tests/__snapshots__/metas.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ snapshot[`metas plugin 3`] = `
<meta property="og:description" content="A very long custom description with a lot of text that will be truncated to a maximum of 155 characters and then append &quot;&quot; to the end. Lorem ipsum dolor…">
<meta property="og:url" content="http://localhost/page-1/">
<meta property="og:image" content="http://localhost/my-image.png">
<meta name="twitter:title" content="Custom title">
<meta name="twitter:description" content="A very long custom description with a lot of text that will be truncated to a maximum of 155 characters and then append &quot;&quot; to the end. Lorem ipsum dolor sit amet, consectetur adipiscing elit.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://localhost/my-image.png">
<meta name="twitter:site" content="@myUser">
<meta itemprop="name" content="Custom title">
<meta itemprop="description" content="A very long custom description with a lot of text that will be truncated to a maximum of 155 characters and then append &quot;&quot; to the end. Lorem ipsum dolor…">
Expand Down Expand Up @@ -180,10 +177,7 @@ snapshot[`metas plugin 3`] = `
<meta property="og:description" content="Tests the use of relative path (to page.data.url) when filling out the og:image or og:icon URL">
<meta property="og:url" content="http://localhost/page-2/">
<meta property="og:image" content="http://localhost/page-2/my-image.png">
<meta name="twitter:title" content="Relative paths">
<meta name="twitter:description" content="Tests the use of relative path (to page.data.url) when filling out the og:image or og:icon URL">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://localhost/page-2/my-image.png">
<meta name="twitter:site" content="@myUser">
<meta itemprop="name" content="Relative paths">
<meta itemprop="description" content="Tests the use of relative path (to page.data.url) when filling out the og:image or og:icon URL">
Expand Down Expand Up @@ -260,10 +254,7 @@ snapshot[`metas plugin 3`] = `
<meta property="og:description" content="This is page excerpt will be used as meta description.">
<meta property="og:url" content="http://localhost/page-3/">
<meta property="og:image" content="http://localhost/page-3/use-cover-as-meta-image.png">
<meta name="twitter:title" content="Title from page data">
<meta name="twitter:description" content="This is page excerpt will be used as meta description.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://localhost/page-3/use-cover-as-meta-image.png">
<meta name="twitter:site" content="@myUser">
<meta itemprop="name" content="Title from page data">
<meta itemprop="description" content="This is page excerpt will be used as meta description.">
Expand Down

0 comments on commit 9739e36

Please sign in to comment.