From d6706e05ee8240d2e3d657b58e5c77c253823184 Mon Sep 17 00:00:00 2001 From: Tommy Chu Date: Mon, 5 Apr 2021 18:25:27 +0200 Subject: [PATCH] Fix redirections to empty tabs (#290) Whenever href (url) attribute was omitted or had no value the click action would do nothing. With no URLs defined and `target="_blank"` attributes, which were recently added, anchor tags now redirect users to new blank tabs (side effect). This PR solves the issues by adding conditions before applying `target="_blank"` or in some cases by ommiting entire entities (e.g. the view_certificate button). --- layouts/partials/cards/accomplishments.html | 4 +++- layouts/partials/cards/project.html | 2 +- layouts/partials/cards/skill.html | 2 +- layouts/partials/sections/education-alt.html | 8 ++++++-- layouts/partials/sections/education.html | 6 +++++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/layouts/partials/cards/accomplishments.html b/layouts/partials/cards/accomplishments.html index 96e4685..de03a55 100644 --- a/layouts/partials/cards/accomplishments.html +++ b/layouts/partials/cards/accomplishments.html @@ -11,7 +11,9 @@

{{ .courseOverview | markdownify }}

diff --git a/layouts/partials/cards/project.html b/layouts/partials/cards/project.html index a5b589f..8950fb3 100644 --- a/layouts/partials/cards/project.html +++ b/layouts/partials/cards/project.html @@ -4,7 +4,7 @@ >
- +
{{ if .logo }} diff --git a/layouts/partials/cards/skill.html b/layouts/partials/cards/skill.html index 1056f4a..0dc873a 100644 --- a/layouts/partials/cards/skill.html +++ b/layouts/partials/cards/skill.html @@ -1,5 +1,5 @@
- +
{{ if .logo }} diff --git a/layouts/partials/sections/education-alt.html b/layouts/partials/sections/education-alt.html index 3864e3c..93be79c 100644 --- a/layouts/partials/sections/education-alt.html +++ b/layouts/partials/sections/education-alt.html @@ -27,7 +27,7 @@
{{ if .institution.url }} -
{{ .institution.name }}
+
{{ .institution.name }}
{{ else }}
{{ .institution.name }}
{{ end }} @@ -43,7 +43,11 @@
{{i18n "publications"}}
    {{ range .publications }} -
  • {{ .title }}
  • + {{ if .url }} +
  • {{ .title }}
  • + {{ else }} +
  • {{ .title }}
  • + {{ end }} {{ end }}
diff --git a/layouts/partials/sections/education.html b/layouts/partials/sections/education.html index 6130a94..7958c04 100644 --- a/layouts/partials/sections/education.html +++ b/layouts/partials/sections/education.html @@ -43,7 +43,11 @@
{{ i18n "publications"}}
    {{ range .publications }} -
  • {{ .title }}
  • + {{ if .url }} +
  • {{ .title }}
  • + {{ else }} +
  • {{ .title }}
  • + {{ end }} {{ end }}