Skip to content

Commit

Permalink
Add nofollow rel to conference links
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmile committed Mar 14, 2024
1 parent ea5b40b commit aef97de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@ function markdown($text)
return '<div class="markdown">' . (new Parsedown())->text($text) . '</div>';
}
}

if (! function_exists('append_url')) {
function append_url($url, $params = null)
{
$char = Str::contains($url, '?') ? '&' : '?';

if (! is_array($params)) {
return false;
}

return $url . $char . http_build_query($params);
}
}
4 changes: 2 additions & 2 deletions resources/views/components/panel/conference.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<div class="mt-4 text-gray-500">URL:</div>
<a
href="{{ $conference->url }}"
href="{{ append_url($conference->url, ['rel' => 'nofollow']) }}"
class="hover:text-indigo-500"
>
{{ $conference->url }}
Expand All @@ -40,7 +40,7 @@ class="hover:text-indigo-500"
@if ($conference->has_cfp && $conference->cfp_url)
<div class="mt-4 text-gray-500">URL for CFP page:</div>
<a
href="{{ $conference->cfp_url }}"
href="{{ append_url($conference->cfp_url, ['rel' => 'nofollow']) }}"
class="hover:text-indigo-500"
>
{{ $conference->cfp_url }}
Expand Down

0 comments on commit aef97de

Please sign in to comment.