[web-php] master: Add home page social preview (#524)
| From: | Lucas Azevedo via GitHub | Date: | Wed, 15 Jun 2022 09:54:54 +0000 |
| Subject: | [web-php] master: Add home page social preview (#524) | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-30047@lists.php.net to get a copy of this message | ||
Author: Lucas Azevedo (lhsazevedo)
Committer: GitHub (web-flow)
Pusher: saundefined
Date: 2022-06-15T12:49:23+03:00
Commit: https://github.com/php/web-php/commit/bab1fa9a92166054b50f2b919866238e0ecbcf47
Raw diff: https://github.com/php/web-php/commit/bab1fa9a92166054b50f2b919866238e0ecbcf47.diff
Add home page social preview (#524)
Changed paths:
A images/meta-image.png
M index.php
Diff:
diff --git a/images/meta-image.png b/images/meta-image.png
new file mode 100644
index 000000000..4f535f9bb
Binary files /dev/null and b/images/meta-image.png differ
diff --git a/index.php b/index.php
index 3be49af4a..34f7b2a30 100644
--- a/index.php
+++ b/index.php
@@ -120,6 +120,9 @@
EOF;
// Write out common header
+$meta_image_path = $MYSITE . 'images/meta-image.png';
+$meta_description = "PHP is a popular general-purpose scripting language that powers
everything from your blog to the most popular websites in the world.";
+
site_header("Hypertext Preprocessor",
array(
'current' => 'home',
@@ -146,7 +149,24 @@
),
'css' => array('home.css'),
- 'intro' => $intro
+ 'intro' => $intro,
+ 'meta_tags' => <<<META
+<meta name="Description" content="{$meta_description}" />
+
+<meta name="twitter:card" content="summary_large_image" />
+<meta name="twitter:site" content="@official_php" />
+<meta name="twitter:title" content="PHP: Hypertext Preprocessor" />
+<meta name="twitter:description" content="{$meta_description}" />
+<meta name="twitter:creator" content="@official_php" />
+<meta name="twitter:image:src" content="{$meta_image_path}" />
+
+<meta itemprop="name" content="PHP: Hypertext Preprocessor" />
+<meta itemprop="description" content="$meta_description" />
+<meta itemprop="image" content="{$meta_image_path}" />
+
+<meta property="og:image" content="{$meta_image_path}" />
+<meta property="og:description" content="$meta_description" />
+META
)
);