feat!: allow using both icons loaded as CSS classes and as images

BREAKING CHANGE: config files
This commit is contained in:
f-dinucci 2022-06-01 22:33:27 +02:00 committed by Giuseppe Masino
parent 1f34459bd6
commit f25b6460f7
2 changed files with 12 additions and 8 deletions

View File

@ -3,8 +3,8 @@ id = "skills"
text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil." text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus quia, nulla! Maiores et perferendis eaque, exercitationem praesentium nihil."
[[list]] [[list]]
name = "go" name = "Music"
icon = "https://devicons.github.io/devicon/devicon.git/icons/go/go-original.svg" iconClass = "fa fa-headphones"
text = """ text = """
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Voluptatibus quia, nulla! Maiores et perferendis eaque, Voluptatibus quia, nulla! Maiores et perferendis eaque,
@ -12,7 +12,7 @@ text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus q
""" """
[[list]] [[list]]
name = "React" name = "React"
icon = "https://devicons.github.io/devicon/devicon.git/icons/react/react-original.svg" iconImg = "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/react/react-original.svg"
text = """ text = """
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Voluptatibus quia, nulla! Maiores et perferendis eaque, Voluptatibus quia, nulla! Maiores et perferendis eaque,
@ -20,7 +20,7 @@ text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus q
""" """
[[list]] [[list]]
name = "C/C++" name = "C/C++"
icon = "https://devicons.github.io/devicon/devicon.git/icons/cplusplus/cplusplus-original.svg" iconImg = "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/cplusplus/cplusplus-original.svg"
text = """ text = """
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Voluptatibus quia, nulla! Maiores et perferendis eaque, Voluptatibus quia, nulla! Maiores et perferendis eaque,

View File

@ -17,11 +17,15 @@
<div class=""> <div class="">
<div class="font-bold text-xl mb-2 py-2 px-6 bg-gray-500"> <div class="font-bold text-xl mb-2 py-2 px-6 bg-gray-500">
<div class="flex"> <div class="flex">
{{if .iconClass}}
<i class="{{.iconClass }} text-4xl bg-gray-300 py-1 px-1 rounded-full"></i>
{{else if .iconImg}}
<img <img
src="{{ .icon }}" src="{{ .iconImg }}"
width="50px" width="50px"
class="bg-gray-300 py-1 px-1 rounded-full" class="bg-gray-300 py-1 px-1 rounded-full"
/> />
{{end}}
<div class="my-auto ml-2"> <div class="my-auto ml-2">
{{ .name }} {{ .name }}
</div> </div>