Skip to content

Commit d82608d

Browse files
committed
nits
1 parent 740c836 commit d82608d

8 files changed

Lines changed: 39 additions & 30 deletions

File tree

conferences/index.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
$link = preg_replace('~^(http://php.net/|https://www.php.net/)~', '', $entry["id"]);
2020
$id = parse_url($entry["id"], PHP_URL_FRAGMENT);
2121
$date = date_format(date_create($entry["updated"]), 'Y-m-d');
22+
$date_w3c = date_format(date_create($entry["updated"]), DATE_W3C);
2223

23-
$content .= '<div class="news__item">';
24+
$content .= '<div class="news__item" itemscope itemtype="https://schema.org/Event">';
2425
$content .= '<div class="news__content">';
25-
$content .= '<div class="news__date">' . $date . '</div>';
26-
$content .= '<div class="news__title"><a href="' . $MYSITE . $link . '" id="' . $id . '">' . $entry["title"] . '</a></div>';
27-
$content .= '<div class="news__text">' . $entry["content"] . '</div>';
26+
$content .= '<div class="news__date" itemprop="startDate" content="$date_w3c">' . $date . '</div>';
27+
$content .= '<div class="news__title"><a href="' . $link . '" id="' . $id . '" itemprop="name">' . $entry["title"] . '</a></div>';
28+
$content .= '<div class="news__text" itemprop="description">' . $entry["content"] . '</div>';
2829
$content .= '</div>';
2930
$content .= '<div class="news__image">';
30-
$content .= sprintf('<a href="%s"><img src="/images/news/%s"></a>', $entry["newsImage"]["link"], $entry["newsImage"]["content"]);
31+
$content .= sprintf('<a href="%s"><img src="/images/news/%s" itemprop="image" alt="%s"></a>', $entry["newsImage"]["link"], $entry["newsImage"]["content"], $entry["title"]);
3132
$content .= '</div>';
3233
$content .= '</div>';
3334
}

include/footer.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if (isset($config['elephpants']) && $config['elephpants']) {
7171
<div class="footer-container">
7272
<div class="footer-grid">
7373
<div>
74-
<a href="/" class="footer-logo">
74+
<a href="/" class="footer-logo" aria-label="Go to Homepage">
7575
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -1 100 50" fill="currentColor">
7676
<path d="m7.579 10.123 14.204 0c4.169 0.035 7.19 1.237 9.063 3.604 1.873 2.367 2.491 5.6 1.855 9.699-0.247 1.873-0.795 3.71-1.643 5.512-0.813 1.802-1.943 3.427-3.392 4.876-1.767 1.837-3.657 3.003-5.671 3.498-2.014 0.495-4.099 0.742-6.254 0.742l-6.36 0-2.014 10.07-7.367 0 7.579-38.001 0 0m6.201 6.042-3.18 15.9c0.212 0.035 0.424 0.053 0.636 0.053 0.247 0 0.495 0 0.742 0 3.392 0.035 6.219-0.3 8.48-1.007 2.261-0.742 3.781-3.321 4.558-7.738 0.636-3.71 0-5.848-1.908-6.413-1.873-0.565-4.222-0.83-7.049-0.795-0.424 0.035-0.83 0.053-1.219 0.053-0.353 0-0.724 0-1.113 0l0.053-0.053"></path>
7777
<path d="m41.093 0 7.314 0-2.067 10.123 6.572 0c3.604 0.071 6.289 0.813 8.056 2.226 1.802 1.413 2.332 4.099 1.59 8.056l-3.551 17.649-7.42 0 3.392-16.854c0.353-1.767 0.247-3.021-0.318-3.763-0.565-0.742-1.784-1.113-3.657-1.113l-5.883-0.053-4.346 21.783-7.314 0 7.632-38.054 0 0"></path>

include/header.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ if (!isset($config["languages"])) {
164164

165165
<?php if (!empty($config['language_switcher'])) { ?>
166166
<div class="select header-languages">
167-
<select onchange="location = this.value">
167+
<select onchange="location = this.value" aria-label="Select language">
168168
<?php foreach ($config['language_switcher'] as $item) { ?>
169169
<option value="<?= $item['url'] ?>"<?= $item['selected'] ? ' selected' : '' ?>><?= $item['name'] ?></option>
170170
<?php } ?>

include/layout.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ function print_news($news, $dog, $max = 5, $return = false) {
412412
$published = substr($item["published"], 0, 10);
413413
$nixtimestamp = strtotime($published);
414414
$newsdate = date("d M Y", $nixtimestamp);
415+
$newsdate_w3c = date_format(date_create($nixtimestamp), DATE_W3C);
415416

416417
if ($return) {
417418
$retval[] = [
@@ -433,13 +434,13 @@ function print_news($news, $dog, $max = 5, $return = false) {
433434
}
434435

435436
echo <<<EOT
436-
<div class="news__item">
437+
<div class="news__item" itemscope itemtype="https://schema.org/Event">
437438
<div class="news__content">
438-
<div class="news__date"><time datetime="{$item["published"]}">{$newsdate}</time></div>
439+
<div class="news__date" itemprop="startDate" content="$newsdate_w3c">$newsdate</div>
439440
<div class="news__title">
440-
<a href="{$permlink}" id="{$id}" rel="bookmark">{$item["title"]}</a>
441+
<a href="{$permlink}" id="{$id}" rel="bookmark" itemprop="name">{$item["title"]}</a>
441442
</div>
442-
<div class="news__text">{$item["content"]}</div>
443+
<div class="news__text" itemprop="description">{$item["content"]}</div>
443444
</div>
444445
{$imageBlock}
445446
</div>

index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@
6565
$date_human = date_format($date, 'd M Y');
6666
$date_w3c = date_format($date, DATE_W3C);
6767
$content .= <<<NEWSENTRY
68-
<div class="news__item">
68+
<div class="news__item" itemscope itemtype="https://schema.org/Event">
6969
<div class="news__content">
70-
<div class="news__date"><time datetime="$date_w3c">$date_human</time></div>
70+
<div class="news__date" itemprop="startDate" content="$date_w3c">$date_human</div>
7171
<div class="news__title">
72-
<a href="{$MYSITE}{$link}" id="{$id}">{$entry["title"]}</a>
72+
<a href="{$link}" id="{$id}" itemprop="name">{$entry["title"]}</a>
7373
</div>
74-
<div class="news__text">{$entry["content"]}</div>
74+
<div class="news__text" itemprop="description">{$entry["content"]}</div>
7575
</div>
7676
</div>
7777
NEWSENTRY;

js/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ $(document).ready(function () {
423423
for (photo in data) {
424424
photo = data[photo];
425425
link = $('<a>');
426+
link.attr('aria-label', "See elephpant photo");
426427
link.attr('href', photo.url);
427428
link.attr('title', photo.title);
428429
image = $('<img>');

0 commit comments

Comments
 (0)