Skip to content

Commit

Permalink
chore(remove): πŸ”§ βž– noopener no longer needed for security
Browse files Browse the repository at this point in the history
  • Loading branch information
vhscom committed Dec 12, 2023
1 parent 0809ff8 commit 37b82d8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ baseurl = "https://domain.example" # Controls base URL sitewide
languageCode = "en-US" # Controls site language
title = "$SITE_NAME" # Homepage title and page title suffix
paginate = 11 # Number of posts to show before paginating
copyright = "Copyright &copy; Copyright Owner. Licensed under <a target=\"_blank\" rel=\"external noopener license\" href=\"https://creativecommons.org/licenses/by-nd/4.0/\">CC-BY-ND-4.0</a>." # Optional, remove to suppress copyright notices
copyright = "Copyright &copy; Copyright Owner. Licensed under <a target=\"_blank\" rel=\"external license\" href=\"https://creativecommons.org/licenses/by-nd/4.0/\">CC-BY-ND-4.0</a>." # Optional, remove to suppress copyright notices
# Controls default theme and theme components
theme = [
Expand Down
2 changes: 1 addition & 1 deletion docs/config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
baseurl = "https://localhost:1414/" # Controls base URL sitewide
title = "After Dark" # Homepage title and page title suffix
paginate = 40 # Number of items to show before paginating
copyright = "Copyright &copy; VHS. Licensed under <a target=\"_blank\" rel=\"external noopener license\" href=\"https://www.gnu.org/licenses/agpl.html\">AGPL-3.0-or-later</a>."
copyright = "Copyright &copy; VHS. Licensed under <a target=\"_blank\" rel=\"external license\" href=\"https://www.gnu.org/licenses/agpl.html\">AGPL-3.0-or-later</a>."

# Controls default theme and theme components
theme = [
Expand Down
4 changes: 2 additions & 2 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ images = [
[[spotlight]]
name = "speed"
title = "Incredibly Fast"
description = "With <a target=\"_blank\" rel=\"external nofollow noopener\" href=\"https://forestry.io/blog/hugo-vs-jekyll-benchmark/\">0.615s average</a> builds and <strong><i>decisecond</i> page loads</strong> you could conceivably develop and serve your content from an <a target=\"_blank\" rel=\"external nofollow noopener\" href=\"https://amzn.to/2Wx7xJk\">ODROID</a> in space."
description = "With <a target=\"_blank\" rel=\"external nofollow\" href=\"https://forestry.io/blog/hugo-vs-jekyll-benchmark/\">0.615s average</a> builds and <strong><i>decisecond</i> page loads</strong> you could conceivably develop and serve your content from an <a target=\"_blank\" rel=\"external nofollow\" href=\"https://amzn.to/2Wx7xJk\">ODROID</a> in space."
icon = "lightning"
[[spotlight.link]]
href = "feature/fetch-injection/"
Expand All @@ -28,7 +28,7 @@ images = [
href = "https://tools.pingdom.com/#5a399f9666400000"
text = "Benchmark"
target = "_blank"
rel = "external nofollow noopener"
rel = "external nofollow"
[[spotlight]]
name = "privacy"
title = "Privacy Aware"
Expand Down
4 changes: 2 additions & 2 deletions docs/content/shortcode/external.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ With a trusted URL:
With external link styling removed:

```html
{{</* external rel="noopener" href="https://blog.domain.example" /*/>}}
{{</* external rel="author" href="https://blog.domain.example" /*/>}}
```

{{< external rel="noopener" href="https://blog.domain.example" />}}
{{< external rel="author" href="https://blog.domain.example" />}}

With internal link opening in a new window:

Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h2 class="muted">A retro dark theme for Hugo</h2>
</svg>
<small role="tooltip" id="source-label">Source</small>
</a>
<a target="_blank" class="cell -2of12" itemtype="significantLink" rel="noopener noreferrer nofollow" href="irc://chat.freenode.net:6667/after-dark">
<a target="_blank" class="cell -2of12" itemtype="significantLink" rel="noreferrer nofollow" href="irc://chat.freenode.net:6667/after-dark">
<svg id="chat" aria-labelledby="chat-label" class="i-message" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path d="M2 4 L30 4 30 22 16 22 8 29 8 22 2 22 Z" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/components/external.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
*/ -}}

{{- /**/ -}}
<a {{ with .itemtype }} itemprop itemtype="https://schema.org/{{ . }}"{{ end }} target="{{ .target | default "_blank" }}"{{ with .type }} type="{{ . }}"{{ end }}{{ with .title }} title="{{ . }}"{{ end }}{{ with .rel }} rel="{{ . }}"{{ else }} rel="{{ if ne .supress_external true }}external{{ end }} noopener"{{ end }}{{ if eq .trusted "true" }} href="{{ .href | safeURL }}"{{ else }} href="{{ .href }}"{{ end }}{{ with .referrerpolicy }} referrerpolicy="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }}>{{ .body | default (replaceRE "^https?://(.*)" "$1" .href) }}</a>
<a {{ with .itemtype }} itemprop itemtype="https://schema.org/{{ . }}"{{ end }} target="{{ .target | default "_blank" }}"{{ with .type }} type="{{ . }}"{{ end }}{{ with .title }} title="{{ . }}"{{ end }}{{ with .rel }} rel="{{ . }}"{{ else }} {{ if ne .supress_external true }}rel="external"{{ end }}{{ if eq .trusted "true" }} href="{{ .href | safeURL }}"{{ else }} href="{{ .href }}"{{ end }}{{ with .referrerpolicy }} referrerpolicy="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }}>{{ .body | default (replaceRE "^https?://(.*)" "$1" .href) }}</a>
{{- /**/ -}}
2 changes: 1 addition & 1 deletion layouts/partials/components/figure.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<figure{{ with .class }} class="{{ . }}"{{ end }}>
{{ if .link }}
<a href="{{ .link }}"{{ if .linktarget }} target="{{ .linktarget }}"{{ end }}{{ if eq .linktarget "_blank" }} rel="external noopener noreferrer"{{ end }} itemprop="url">
<a href="{{ .link }}"{{ if .linktarget }} target="{{ .linktarget }}"{{ end }}{{ if eq .linktarget "_blank" }} rel="external noreferrer"{{ end }} itemprop="url">
{{- if .lqipsrc -}}
<img class="lazyload blur-up" src="{{ .lqipsrc }}" data-src="{{ .src }}" {{ if or .alt .caption }}alt="{{ with .alt }}{{ . }}{{ else }}{{ .caption }}{{ end }}"{{ end }} itemprop="image">
{{- else -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/copyright-notice.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{{ range . }}
Copyright &copy; {{ .date }} {{ .owner }}.
{{ with (index $.Site.Data.licenses .license) }}
Licensed under {{ partial "components/external.html" (dict "href" .link "body" .shorthand "rel" "external noopener license") }}.
Licensed under {{ partial "components/external.html" (dict "href" .link "body" .shorthand "rel" "external license") }}.
{{ else }}
Copyright &copy; {{ .date }} {{ .owner }}.
{{ end }}
Expand Down

0 comments on commit 37b82d8

Please sign in to comment.