From 6774d18d0eacd80d3f40aa06812b2cd4880fa79d Mon Sep 17 00:00:00 2001 From: Fabio Fenoglio Date: Sat, 11 Dec 2021 11:24:00 +0100 Subject: [PATCH] added skill popup with breakdown --- layouts/partials/cards/skill-popup.html | 56 +++++++++++++++++++++++++ layouts/partials/cards/skill.html | 55 ++++++++++++++++++++---- 2 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 layouts/partials/cards/skill-popup.html diff --git a/layouts/partials/cards/skill-popup.html b/layouts/partials/cards/skill-popup.html new file mode 100644 index 0000000..4ca6e81 --- /dev/null +++ b/layouts/partials/cards/skill-popup.html @@ -0,0 +1,56 @@ +{{ if .skill.popup }} + + {{ $skillID := replace (lower .skill.name) " " "-" }} + {{ if .skill.id }} + {{ $skillID = .skill.id }} + {{ end }} + + {{ $logoImage := "" }} + {{ if .skill.logo }} + {{ $logoImage = resources.Get .skill.logo }} + {{/* svg don't support "Fit" operation */}} + {{ if ne $logoImage.MediaType.SubType "svg" }} + {{ $logoImage = $logoImage.Fit "24x24" }} + {{ end }} + {{ end }} + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/cards/skill.html b/layouts/partials/cards/skill.html index cba5529..02f684f 100644 --- a/layouts/partials/cards/skill.html +++ b/layouts/partials/cards/skill.html @@ -1,22 +1,59 @@ +{{ $skillID := replace (lower .name) " " "-" }} +{{ if .id }} + {{ $skillID = .id }} +{{ end }} +{{ $logoImage := "" }} +{{ if .logo }} + {{ $logoImage = resources.Get .logo }} + + {{/* svg don't support "Fit" operation */}} + {{ if ne $logoImage.MediaType.SubType "svg" }} + {{ $logoImage = $logoImage.Fit "24x24" }} + {{ end }} + +{{ end }}
- +
- {{ if .logo }} - {{ $logoImage := resources.Get .logo }} - - {{/* svg don't support "Fit" operation */}} - {{ if ne $logoImage.MediaType.SubType "svg" }} - {{ $logoImage = $logoImage.Fit "24x24" }} - {{ end }} - + {{ if $logoImage }} {{ .name }} {{ end }}
{{ .name }}

{{ .summary | markdownify }}

+ + {{ if or .popup .icons }} +
+
+ {{ if .icons }} + {{ range $icon := .icons }} + {{ $iconImage := "" }} + {{ $iconImage = resources.Get $icon }} + {{ if ne $iconImage.MediaType.SubType "svg" }} + {{ $iconImage = $iconImage.Fit "32x32" }} + {{ end }} + + {{ end }} + {{ end }} +
+ {{ if and .popup ( .popup.showButton | default true ) }} +
+ +
+ {{ end }} +
+ {{ end }}
+{{ if .popup }} +{{ partial "partials/cards/skill-popup.html" (dict "skill" .) }} +{{ end }} \ No newline at end of file