Skip to content

Commit

Permalink
Prevent tabnapping exploit
Browse files Browse the repository at this point in the history
According to https://www.freecodecamp.org/news/how-to-use-html-to-open-link-in-new-tab/, this piece of code prevents phishing attacks from stealing newly made tabs. While I don't feel like this change is critical for this website, it's better to be safe than sorry ;)
  • Loading branch information
SpectralPixel committed Sep 15, 2024
1 parent 11d6acf commit c24f267
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions content/topics/cms.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ news_tag = "cms"
<ul class="pkg-list">
<li id="pkg-zola" class="pkg">
<span class="pkg-name">zola</span>
<a class="pkg-link" target="_blank" title="homepage" href="https://www.getzola.org/"><i class="fa fa-home"></i></a>
<a class="pkg-link" target="_blank" title="documentation" href="https://www.getzola.org/documentation/getting-started/overview/"><i class="fa fa-book"></i></a>
<a class="pkg-link" target="_blank" title="repository" href="https://github.com/getzola/zola"><i class="fa fa-code"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="homepage" href="https://www.getzola.org/"><i class="fa fa-home"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="documentation" href="https://www.getzola.org/documentation/getting-started/overview/"><i class="fa fa-book"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="repository" href="https://github.com/getzola/zola"><i class="fa fa-code"></i></a>
<p class="pkg-meta">
<img src="https://img.shields.io/github/last-commit/getzola/zola.svg">
</p>
Expand Down
8 changes: 4 additions & 4 deletions templates/macros/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

<div class="pkg-links">
{% if pkg.id %}
<a class="pkg-link" target="_blank" title="crates.io link" href="https://crates.io/crates/{{pkg.id}}"><i class="fa fa-cube"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="crates.io link" href="https://crates.io/crates/{{pkg.id}}"><i class="fa fa-cube"></i></a>
{% endif %}

{% if pkg.homepage %}
<a class="pkg-link" target="_blank" title="homepage" href="{{pkg.homepage}}"><i class="fa fa-home"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="homepage" href="{{pkg.homepage}}"><i class="fa fa-home"></i></a>
{% endif %}


{% if pkg.documentation %}
<a class="pkg-link" target="_blank" title="documentation" href="{{pkg.documentation}}"><i class="fa fa-book"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="documentation" href="{{pkg.documentation}}"><i class="fa fa-book"></i></a>
{% endif %}

{% if pkg.repository %}
<a class="pkg-link" target="_blank" title="repository" href="{{pkg.repository}}"><i class="fa fa-code"></i></a>
<a class="pkg-link" target="_blank" rel="noopener noreferrer" title="repository" href="{{pkg.repository}}"><i class="fa fa-code"></i></a>
{% endif %}

<a class="pkg-link action" title="permalink" href="#pkg-{{pkg.id | default(value=pkg.name)}}"><i
Expand Down

0 comments on commit c24f267

Please sign in to comment.