Skip to content

Commit b676b34

Browse files
authored
Unify design of all release pages (php#1916)
* Use PHP 8.5 styling for all release pages Enables dark mode, syntax highlighting of variables, and unified design for all release pages. Release pages prior to 8.5 still lack the Key Features section. Also fixed inconsistent i18n language spelling in the dropdowns on a few release pages, and corrected an English grammar typo on the PHP 8.1 page. No other content has been changed. Also removed duplicate feature title translation strings. * Switch to CSS animations for hero background This allows Playwright to automatically disable the animations for stable screenshot testing.
1 parent 742ae5c commit b676b34

32 files changed

Lines changed: 2577 additions & 5219 deletions

playwright.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ export default defineConfig({
1414
workers: process.env.CI ? 1 : undefined,
1515
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
1616
reporter: 'html',
17+
expect: {
18+
toHaveScreenshot: {
19+
animations: 'disabled',
20+
},
21+
},
1722
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
1823
use: {
1924
/* Base URL to use in actions like `await page.goto('/')`. */

releases/8.0/common.php

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,22 @@
2222
];
2323

2424
function common_header(string $description): void {
25-
global $MYSITE;
25+
global $MYSITE, $lang;
2626

2727
$meta_image_path = \htmlspecialchars(
2828
\filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL));
2929
$meta_description = \htmlspecialchars($description);
3030

31-
\site_header("PHP 8.0.0 Release Announcement", [
32-
'current' => 'php8',
33-
'css' => ['php8.css'],
31+
$languages = [];
32+
foreach (LANGUAGES as $code => $text) {
33+
$languages[] = ['name' => $text, 'selected' => $lang === $code, 'url' => '/releases/8.0/' . $code . '.php'];
34+
}
35+
36+
\site_header("PHP 8.0 Release Announcement", [
37+
'current' => 'php85',
38+
'css' => ['php85.css'],
39+
'language_switcher' => $languages,
40+
'theme_switcher' => true,
3441
'meta_tags' => <<<META
3542
<meta name="twitter:card" content="summary_large_image" />
3643
<meta name="twitter:site" content="@official_php" />
@@ -49,28 +56,7 @@ function common_header(string $description): void {
4956
]);
5057
}
5158

52-
function language_chooser(string $currentLang): void {
53-
// Print out the form with all the options
54-
echo '
55-
<form action="" method="get" id="changelang" name="changelang">
56-
<fieldset>
57-
<label for="changelang-langs">Change language:</label>
58-
<select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs">
59-
';
60-
61-
$tab = ' ';
62-
foreach (LANGUAGES as $lang => $text) {
63-
$selected = ($lang === $currentLang) ? ' selected="selected"' : '';
64-
echo $tab, "<option value='$lang'$selected>$text</option>\n";
65-
}
66-
67-
echo ' </select>
68-
</fieldset>
69-
</form>
70-
';
71-
}
72-
73-
function message($code, $language = 'en')
59+
function message($code, $language = 'en'): string
7460
{
7561
$original = require __DIR__ . '/languages/en.php';
7662
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) {

0 commit comments

Comments
 (0)