adfaure / kodama-theme

Theme for zola inspired by hugo academic theme.
https://adfaure.github.io/kodama-theme/
MIT License
18 stars 9 forks source link

ORCID icon #15

Closed plafourc closed 2 months ago

plafourc commented 2 months ago

Hello!

I would like to add a new icon on the home page for my orcid orcid record. I found a svg file for the icon on their website, but simply copying the code in a case of icons.html doesn’t seem to work. Do you have any idea?

Thanks for your help.

adfaure commented 2 months ago

Hello,

You can find an example here, I had to do it for my website also: https://github.com/adfaure/adfaure.github.io/blob/master/templates/macros/icons.html

And then I use it here: https://github.com/adfaure/adfaure.github.io/blob/a740a524cb6df63a95a06887ba23d114a7e881c2/content/_index.md?plain=1#L36

Let me know if it helps.

plafourc commented 2 months ago

Based on your tip I did manage to get what I wanted, but it wasn’t easy. For future reference, here is what I did:

  1. Using Inkscape, I modified the svg file to make it so it only contained a single path.
  2. In a text editor, I removed as much stuff as possible while still having a valid image
  3. I also replaced the style command with a fill (not sure if it was necessary)
  4. I finally added the class="{{classes}}"

Overall, this is the svg code I ended up with: <svg class="{{classes}}" viewBox="0 0 256 256" fill="#000000" xmlns="http://www.w3.org/2000/svg"> <path d="M 128,0 C 57.300071,0 0,57.300071 0,128 0,198.69993 57.300071,256 128,256 198.69993,256 256,198.69993 256,128 256,57.300071 198.69993,0 128,0 Z M 78.599609,46.699219 c 5.59999,0 10.09961,4.601574 10.09961,10.101562 0,5.49999 -4.49962,10.09961 -10.09961,10.09961 -5.599988,0 -10.099609,-4.59962 -10.099609,-10.09961 0,-5.599988 4.499621,-10.101562 10.099609,-10.101562 z m -7.699218,32.40039 h 15.40039 V 127.5 186.19922 h -15.40039 z m 37.999999,0 H 150.5 c 39.59992,0 57,28.299651 57,53.599611 0,27.49994 -21.50086,53.60156 -56.80078,53.60156 H 108.90039 Z M 124.30078,93 v 79.40039 h 24.5 c 34.89994,0 42.89844,-26.50119 42.89844,-39.70117 C 191.69922,111.19926 177.99994,93 148,93 Z" /> </svg>

plafourc commented 2 months ago

Also, while you are at it, you might consider adding this icon to the theme. ORCID seems to be a really important link for CS researchers these days.

Anyway, thanks for the help and this awesome theme!

adfaure commented 2 months ago

Thank you for showing the steps, I will add that to the documentation, I think it is valuable.

Why not adding this one in the theme, it makes sense for a template targeting researchers.

Closing the issue.

Thanks !