From 57d73646b872871c127043bbe934b316cf0ee061 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Wed, 3 Jul 2024 21:33:59 -0500 Subject: [PATCH] remove `target='_blank'` from external links for better security and accessibility --- config/_default/menu.toml | 12 ------------ content/changelog.md | 5 ++++- content/posts/the-slash-page-scoop/index.md | 8 ++++---- layouts/partials/about.html | 4 ++-- layouts/partials/archive.html | 4 ++-- layouts/partials/footer.html | 4 ++-- layouts/partials/header.html | 2 +- 7 files changed, 15 insertions(+), 24 deletions(-) diff --git a/config/_default/menu.toml b/config/_default/menu.toml index 9c0f11a..260de17 100644 --- a/config/_default/menu.toml +++ b/config/_default/menu.toml @@ -9,45 +9,33 @@ name = "self-hosting" url = "/categories/self-hosting/" weight = 1 - [[main.params]] - target = "_self" [[main]] identifier = "tips" name = "tips" url = "/categories/tips/" weight = 1 - [[main.params]] - target = "_self" [[main]] identifier = "code" name = "code" url = "/categories/code/" weight = 1 - [[main.params]] - target = "_self" [[main]] identifier = "backstage" name = "backstage" url = "/categories/backstage/" weight = 1 - [[main.params]] - target = "_self" [[main]] identifier = "slashes" name = "slashes" url = "/slashes/" weight = 10 - [[main.params]] - target = "_self" [[main]] identifier = "notes" name = "notes↗" url = "https://notes.runtimeterror.dev" weight = 100 - [[main.params]] - target = "_blank" diff --git a/content/changelog.md b/content/changelog.md index abcfe95..5d48d4c 100644 --- a/content/changelog.md +++ b/content/changelog.md @@ -1,7 +1,7 @@ --- title: "/changelog" date: "2024-05-26T21:19:08Z" -lastmod: "2024-06-29T03:55:04Z" +lastmod: "2024-07-04T02:32:27Z" description: "Maybe I should keep a log of all my site-related tinkering?" featured: false toc: false @@ -10,6 +10,9 @@ categories: slashes --- *High-level list of config/layout changes to the site. The full changelog is of course [on GitHub](https://github.com/jbowdre/runtimeterror/commits/main/).* +**2024-07-03:** +- Remove `target="_blank"` from external links for improved security and accessibility + **2024-06-28:** - Add [recentfm.js](https://recentfm.rknight.me/) recently-played widget to sidebar - Use [Hugo render-hook](https://gohugo.io/render-hooks/links/#examples) to add ↗ marker to external links diff --git a/content/posts/the-slash-page-scoop/index.md b/content/posts/the-slash-page-scoop/index.md index 4f124bc..b69c7ec 100644 --- a/content/posts/the-slash-page-scoop/index.md +++ b/content/posts/the-slash-page-scoop/index.md @@ -1,7 +1,7 @@ --- title: "The Slash Page Scoop" date: 2024-06-02 -# lastmod: 2024-05-30 +lastmod: "2024-07-04T02:23:41Z" description: "I've added new slash pages to the site to share some background info on who I am, what I use, and how this site works." featured: false toc: true @@ -101,7 +101,7 @@ Of course, I'd like to include a link to [slashpages.net](https://slashpages.net {{ if .IsHome }}

{{ site.Params.indexTitle | markdownify }}

{{ else }} -

{{ .Title | markdownify }}{{ if eq .Kind "term" }}  

+

{{ .Title | markdownify }}{{ if eq .Kind "term" }}  

{{ with .Description }}{{ . }}
{{ else }}
{{ end }} {{ end }}{{ end }} {{ .Content }} @@ -122,9 +122,9 @@ Line 9 is where I had already modified the template to conditionally add an RSS {{ else }} {{ if eq .Title "/slashes" }}

{{ .Title | markdownify }}

- My collection of slash pages.
+ My collection of slash pages↗.
{{ else }} -

{{ .Title | markdownify }}{{ if eq .Kind "term" }}  

+

{{ .Title | markdownify }}{{ if eq .Kind "term" }}  

{{ with .Description }}{{ . }}
{{ else }}
{{ end }} {{ end }} {{ end }}{{ end }} diff --git a/layouts/partials/about.html b/layouts/partials/about.html index 6e8fc01..f78bae7 100644 --- a/layouts/partials/about.html +++ b/layouts/partials/about.html @@ -1,7 +1,7 @@ {{ with .Site.Params.about }}
{{ with .logo }}{{ end }} -

{{ .title }}  

+

{{ .title }}  

{{ partial "tagline.html" . }}
 {{ site.Params.Author.name }} @@ -10,7 +10,7 @@ diff --git a/layouts/partials/archive.html b/layouts/partials/archive.html index dafba78..e1d7888 100644 --- a/layouts/partials/archive.html +++ b/layouts/partials/archive.html @@ -8,9 +8,9 @@ {{ else }} {{ if eq .Title "/slashes" }}

{{ .Title | markdownify }}

- My collection of slash pages.
+ My collection of slash pages↗.
{{ else }} -

{{ .Title | markdownify | lower }}{{ if eq .Kind "term" }}  

+

{{ .Title | markdownify | lower }}{{ if eq .Kind "term" }}  

{{ with .Description }}{{ . }}{{ end }} {{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index edaebb2..e82425f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,6 +1,6 @@ {"/slashes": [{{- range $i, $link := .Site.Params.slashPages }}{{ if $i }}, {{ end }}"{{ $link.title }}"{{ end }}]} -
{"copyright": ["content": "CC BY-NC-SA 4.0", "code": "MIT"]} -
<view source> +
{"copyright": ["content": "CC BY-NC-SA 4.0↗", "code": "MIT↗"]} +
<view source↗> {{ $jsToTop := resources.Get "js/back-to-top.js" | minify }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7bf4fcf..45c46ce 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -3,7 +3,7 @@

{{ .Site.Title }}

{{ $currentPage := . }} {{ range .Site.Menus.main }} - + {{ end }}