diff options
author | Sam Ettinger <ettingersam@gmail.com> | 2022-03-13 09:07:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-13 09:07:07 +0300 |
commit | 747311a1ca2deb36448c176d8685917cc3756ba5 (patch) | |
tree | 81e608b7e05569429d1cdcda0d003a3b9435574f | |
parent | 3b18fbe4ea3fb76474e5a9af1f78b02d1f16fc7d (diff) |
Ensure "title" attribute of Skill item is converted to a valid htmlID
-rw-r--r-- | layouts/index.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/index.html b/layouts/index.html index 3f87585..91d79b1 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -159,7 +159,7 @@ {{ if .Site.Data.homepage.skill.enable }} {{ range .Site.Data.homepage.skill.item }} -<div id="{{cond (isset . "titlealt") .titlealt (replace (replace .title ' ' '_') '.' '_') }}" uk-modal> +<div id="modal_{{cond (isset . "titlealt") .titlealt (replaceRE "\\W" "_" .title) }}" uk-modal> <div class="uk-modal-dialog uk-modal-body"> <button class="uk-modal-close-default" type="button" uk-close></button> <div class="uk-modal-header"> @@ -180,7 +180,7 @@ {{ range .Site.Data.homepage.skill.item }} <div class="imagemargin"> <img class="contain skills" src="{{.logo}}" alt="{{.company}}" loading="lazy" style="cursor: pointer" - uk-toggle="target: #{{ cond (isset . "titlealt") .titlealt (replace (replace .title ' ' '_') '.' '_')}}"> + uk-toggle="target: #modal_{{cond (isset . "titlealt") .titlealt (replaceRE "\\W" "_" .title) }}"> <h4>{{.title }}</h4> </div> {{ end }} |