com web/php: use conference urls for cfp/announcements: bin/createNewsEntry
| From: | Peter Cowburn | Date: | Tue, 23 Jul 2019 19:23:53 +0000 |
| Subject: | com web/php: use conference urls for cfp/announcements: bin/createNewsEntry | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-28246@lists.php.net to get a copy of this message | ||
Commit: 4edd760ae980376d1e4f87cf059bdd6b6ca38213
Author: Peter Cowburn <salathe@php.net> Tue, 23 Jul 2019 20:18:23 +0100
Parents: 39daeda954b803b5bdcbca133e91b538672a027e
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=4edd760ae980376d1e4f87cf059bdd6b6ca38213
Log:
use conference urls for cfp/announcements
The createNewsEntry script was recently refactored (thanks Sara!) and a
regression slipped through.
For conference news entries before the refactor, we used to generate the
"alternate" links along the lines of:
http://php.net/conferences/index.php#id2019-01-01-1
After the refactor, that changed to the following:
https://www.php.net/index.php#id2019-01-01-1
And with this commit they look like:
https://www.php.net/conferences/index.php#id2019-01-01-1
Changed paths:
M bin/createNewsEntry
Diff:
diff --git a/bin/createNewsEntry b/bin/createNewsEntry
index de960b0..c83b184 100755
--- a/bin/createNewsEntry
+++ b/bin/createNewsEntry
@@ -128,12 +128,12 @@ function getEntry(string $id): array {
if (array_intersect($entry['categories'], ['cfp', 'conferences'])) {
$entry['href'] = BASE . '/conferences/index.php';
$entry['conf-time'] = getConfTime();
+ } else {
+ $entry['href'] = BASE . '/index.php';
}
$entry['image'] = getImage();
$entry['content'] = getContent();
-
- $entry['href'] = BASE . '/index.php';
$entry['archive'] = BASE . "/archive/" . date('Y',
$_SERVER['REQUEST_TIME']) . ".php#$id";
$entry['via'] = $entry['image']['link'] ??
$entry['archive'];