Skip to content

Commit

Permalink
Merge pull request #849 from UN-OCHA/RW-997-twitter-to-x
Browse files Browse the repository at this point in the history
chore: switch remaining twitter links to handle x instead
  • Loading branch information
orakili committed Jul 11, 2024
2 parents c8cba0d + 90df96e commit e9cca1a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion config/reliefweb_entities.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ allowed_social_media_links:
instagram: Instagram
medium: Medium
linkedin: LinkedIn
twitter: Twitter
twitter: X
x: X
youtube: YouTube
cron:
embargoed_reports_limit: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ allowed_social_media_links:
instagram: 'Instagram'
medium: 'Medium'
linkedin: 'LinkedIn'
twitter: 'Twitter'
twitter: 'X'
x: 'X'
youtube: 'YouTube'
# Entity related cron task settings.
cron:
Expand Down
10 changes: 5 additions & 5 deletions html/modules/custom/reliefweb_entities/src/DocumentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ public function getShareLinks() {
],
]),
];
$links['twitter'] = [
'title' => $this->t('Share this on Twitter'),
'url' => Url::fromUri('https://twitter.com/share', [
$links['x'] = [
'title' => $this->t('Share this on X'),
'url' => Url::fromUri('https://x.com/share', [
'query' => [
'url' => $url . '&utm_source=twitter.com',
// Truncate the title as text for twitter to stay within the allowed
'url' => $url . '&utm_source=x.com',
// Truncate the title as text for X to stay within the allowed
// number of characters.
'text' => Unicode::truncate($title, 90, FALSE, TRUE),
'via' => 'reliefweb',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{% apply spaceless %}
<div>
<a href="https://www.facebook.com/reliefweb">Facebook</a><span> - </span>
<a href="https://twitter.com/reliefweb">Twitter</a><span> - </span>
<a href="https://x.com/reliefweb">X</a><span> - </span>
<a href="https://www.linkedin.com/company/reliefweb">LinkedIn</a><span> - </span>
<a href="https://www.instagram.com/reliefweb1996/">Instagram</a><span> - </span>
<a href="https://t.me/+8QT4PI32MbY3MDdh">Telegram</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
.rw-entity-social-media-links--icons-only a[href*="facebook"]:before {
background: var(--rw-icons--social-media--facebook-full--48--dark-blue);
}
.rw-entity-social-media-links--icons-only a[href*="twitter"]:before {
.rw-entity-social-media-links--icons-only a[href*="x.com"]:before {
background: var(--rw-icons--social-media--twitter-full--48--dark-blue);
}
.rw-entity-social-media-links--icons-only a[href*="linkedin"]:before {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</a>
</li>
<li class="cd-footer-social__item">
<a href="https://twitter.com/reliefweb" class="cd-footer-social__link">
<span class="visually-hidden">Twitter</span>
<a href="https://x.com/reliefweb" class="cd-footer-social__link">
<span class="visually-hidden">X</span>

<svg class="cd-icon cd-icon--twitter" aria-hidden="true" focusable="false" width="32" height="32">
<use xlink:href="#cd-icon--sm-tt-def"></use>
Expand Down

0 comments on commit e9cca1a

Please sign in to comment.