Skip to content

Commit

Permalink
Merge pull request #748 from readthedocs/davidfischer/rel-sponsored
Browse files Browse the repository at this point in the history
Add rel=sponsored to ad links
  • Loading branch information
davidfischer committed Jun 2, 2023
2 parents 1d06b85 + 480a896 commit a4aa5f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion adserver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,8 @@ def render_links(self, link=None, preview=False):

return mark_safe(
ad_html.replace(
"<a>", '<a href="%s" rel="nofollow noopener" target="_blank">' % url
"<a>",
'<a href="%s" rel="nofollow noopener sponsored" target="_blank">' % url,
)
)

Expand Down
2 changes: 1 addition & 1 deletion adserver/templates/adserver/advertisement.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% spaceless %}
<div class="ethical-ad">
{% if image_url %}
<a href="{{ link_url }}" rel="nofollow" target="_blank">
<a href="{{ link_url }}" rel="nofollow noopener sponsored" target="_blank">
<img src="{{ image_url }}">
</a>
{% elif view_url and publisher.render_pixel %}
Expand Down

0 comments on commit a4aa5f2

Please sign in to comment.