From 20710d34b9b61a3ab95922e4d0a359ddd6704292 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 22 Nov 2020 19:20:58 +0530 Subject: [PATCH] social-icons: Trim whitespace and Lowercase name - allows name like shown below socialIcons: - name: "TWitteR" url: "https://twitter.com" - name: "Codepen" url: "https://codepen.com" --- layouts/partials/svg.html | 85 +++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html index 74901a76..c65be8e1 100644 --- a/layouts/partials/svg.html +++ b/layouts/partials/svg.html @@ -1,25 +1,26 @@ -{{- if (eq .name "123rf") -}} +{{ $icon_name := ( trim .name " " | lower )}} +{{- if (eq $icon_name "123rf") -}} -{{- else if (eq .name "adobestock") -}} +{{- else if (eq $icon_name "adobestock") -}} -{{- else if (eq .name "behance") -}} +{{- else if (eq $icon_name "behance") -}} -{{- else if (eq .name "buymeacoffee") -}} +{{- else if (eq $icon_name "buymeacoffee") -}} @@ -57,7 +58,7 @@ d="M879.567 341.849L872.53 306.352C866.215 274.503 851.882 244.409 819.19 232.898C808.711 229.215 796.821 227.633 788.786 220.01C780.751 212.388 778.376 200.55 776.518 189.572C773.076 169.423 769.842 149.257 766.314 129.143C763.269 111.85 760.86 92.4243 752.928 76.56C742.604 55.2584 721.182 42.8009 699.88 34.559C688.965 30.4844 677.826 27.0375 666.517 24.2352C613.297 10.1947 557.342 5.03277 502.591 2.09047C436.875 -1.53577 370.983 -0.443234 305.422 5.35968C256.625 9.79894 205.229 15.1674 158.858 32.0469C141.91 38.224 124.445 45.6399 111.558 58.7341C95.7448 74.8221 90.5829 99.7026 102.128 119.765C110.336 134.012 124.239 144.078 138.985 150.737C158.192 159.317 178.251 165.846 198.829 170.215C256.126 182.879 315.471 187.851 374.007 189.968C438.887 192.586 503.87 190.464 568.44 183.618C584.408 181.863 600.347 179.758 616.257 177.304C634.995 174.43 647.022 149.928 641.499 132.859C634.891 112.453 617.134 104.538 597.055 107.618C594.095 108.082 591.153 108.512 588.193 108.942L586.06 109.252C579.257 110.113 572.455 110.915 565.653 111.661C551.601 113.175 537.515 114.414 523.394 115.378C491.768 117.58 460.057 118.595 428.363 118.647C397.219 118.647 366.058 117.769 334.983 115.722C320.805 114.793 306.661 113.611 292.552 112.177C286.134 111.506 279.733 110.801 273.333 110.009L267.241 109.235L265.917 109.046L259.602 108.134C246.697 106.189 233.792 103.953 221.025 101.251C219.737 100.965 218.584 100.249 217.758 99.2193C216.932 98.1901 216.482 96.9099 216.482 95.5903C216.482 94.2706 216.932 92.9904 217.758 91.9612C218.584 90.9319 219.737 90.2152 221.025 89.9293H221.266C232.33 87.5721 243.479 85.5589 254.663 83.8038C258.392 83.2188 262.131 82.6453 265.882 82.0832H265.985C272.988 81.6186 280.026 80.3625 286.994 79.5366C347.624 73.2301 408.614 71.0801 469.538 73.1014C499.115 73.9618 528.676 75.6996 558.116 78.6935C564.448 79.3474 570.746 80.0357 577.043 80.8099C579.452 81.1025 581.878 81.4465 584.305 81.7391L589.191 82.4445C603.438 84.5667 617.61 87.1419 631.708 90.1703C652.597 94.7128 679.422 96.1925 688.713 119.077C691.673 126.338 693.015 134.408 694.649 142.03L696.732 151.752C696.786 151.926 696.826 152.105 696.852 152.285C701.773 175.227 706.7 198.169 711.632 221.111C711.994 222.806 712.002 224.557 711.657 226.255C711.312 227.954 710.621 229.562 709.626 230.982C708.632 232.401 707.355 233.6 705.877 234.504C704.398 235.408 702.75 235.997 701.033 236.236H700.895L697.884 236.649L694.908 237.044C685.478 238.272 676.038 239.419 666.586 240.486C647.968 242.608 629.322 244.443 610.648 245.992C573.539 249.077 536.356 251.102 499.098 252.066C480.114 252.57 461.135 252.806 442.162 252.771C366.643 252.712 291.189 248.322 216.173 239.625C208.051 238.662 199.93 237.629 191.808 236.58C198.106 237.389 187.231 235.96 185.029 235.651C179.867 234.928 174.705 234.177 169.543 233.397C152.216 230.798 134.993 227.598 117.7 224.793C96.7944 221.352 76.8005 223.073 57.8906 233.397C42.3685 241.891 29.8055 254.916 21.8776 270.735C13.7217 287.597 11.2956 305.956 7.64786 324.075C4.00009 342.193 -1.67805 361.688 0.472751 380.288C5.10128 420.431 33.165 453.054 73.5313 460.35C111.506 467.232 149.687 472.807 187.971 477.556C338.361 495.975 490.294 498.178 641.155 484.129C653.44 482.982 665.708 481.732 677.959 480.378C681.786 479.958 685.658 480.398 689.292 481.668C692.926 482.938 696.23 485.005 698.962 487.717C701.694 490.429 703.784 493.718 705.08 497.342C706.377 500.967 706.846 504.836 706.453 508.665L702.633 545.797C694.936 620.828 687.239 695.854 679.542 770.874C671.513 849.657 663.431 928.434 655.298 1007.2C653.004 1029.39 650.71 1051.57 648.416 1073.74C646.213 1095.58 645.904 1118.1 641.757 1139.68C635.218 1173.61 612.248 1194.45 578.73 1202.07C548.022 1209.06 516.652 1212.73 485.161 1213.01C450.249 1213.2 415.355 1211.65 380.443 1211.84C343.173 1212.05 297.525 1208.61 268.756 1180.87C243.479 1156.51 239.986 1118.36 236.545 1085.37C231.957 1041.7 227.409 998.039 222.9 954.381L197.607 711.615L181.244 554.538C180.968 551.94 180.693 549.376 180.435 546.76C178.473 528.023 165.207 509.681 144.301 510.627C126.407 511.418 106.069 526.629 108.168 546.76L120.298 663.214L145.385 904.104C152.532 972.528 159.661 1040.96 166.773 1109.41C168.15 1122.52 169.44 1135.67 170.885 1148.78C178.749 1220.43 233.465 1259.04 301.224 1269.91C340.799 1276.28 381.337 1277.59 421.497 1278.24C472.979 1279.07 524.977 1281.05 575.615 1271.72C650.653 1257.95 706.952 1207.85 714.987 1130.13C717.282 1107.69 719.576 1085.25 721.87 1062.8C729.498 988.559 737.115 914.313 744.72 840.061L769.601 597.451L781.009 486.263C781.577 480.749 783.905 475.565 787.649 471.478C791.392 467.391 796.352 464.617 801.794 463.567C823.25 459.386 843.761 452.245 859.023 435.916C883.318 409.918 888.153 376.021 879.567 341.849ZM72.4301 365.835C72.757 365.68 72.1548 368.484 71.8967 369.792C71.8451 367.813 71.9483 366.058 72.4301 365.835ZM74.5121 381.94C74.6842 381.819 75.2003 382.508 75.7337 383.334C74.925 382.576 74.4089 382.009 74.4949 381.94H74.5121ZM76.5597 384.641C77.2996 385.897 77.6953 386.689 76.5597 384.641V384.641ZM80.672 387.979H80.7752C80.7752 388.1 80.9645 388.22 81.0333 388.341C80.9192 388.208 80.7925 388.087 80.6548 387.979H80.672ZM800.796 382.989C793.088 390.319 781.473 393.726 769.996 395.43C641.292 414.529 510.713 424.199 380.597 419.932C287.476 416.749 195.336 406.407 103.144 393.382C94.1102 392.109 84.3197 390.457 78.1082 383.798C66.4078 371.237 72.1548 345.944 75.2003 330.768C77.9878 316.865 83.3218 298.334 99.8572 296.355C125.667 293.327 155.64 304.218 181.175 308.09C211.917 312.781 242.774 316.538 273.745 319.36C405.925 331.405 540.325 329.529 671.92 311.91C695.906 308.686 719.805 304.941 743.619 300.674C764.835 296.871 788.356 289.731 801.175 311.703C809.967 326.673 811.137 346.701 809.778 363.615C809.359 370.984 806.139 377.915 800.779 382.989H800.796Z" fill="currentColor"> -{{- else if (eq .name "codepen") -}} +{{- else if (eq $icon_name "codepen") -}} @@ -66,7 +67,7 @@ -{{- else if (eq .name "cryptohack") -}} +{{- else if (eq $icon_name "cryptohack") -}} @@ -76,31 +77,31 @@ d="M309 489 c-19 -19 -20 -30 -17 -204 3 -163 5 -185 22 -204 23 -25 78 -28 97 -5 7 9 29 22 50 30 36 15 59 47 59 83 0 10 7 24 15 31 19 16 19 60 1 86 -8 10 -12 29 -9 41 3 15 -3 30 -19 46 -12 13 -30 37 -38 53 -10 19 -25 30 -42 32 -15 2 -32 10 -38 18 -18 20 -57 17 -81 -7z m71 -14 c7 -8 23 -15 35 -15 34 0 48 -22 34 -54 -10 -20 -19 -26 -46 -26 -34 0 -44 -13 -17 -24 28 -11 47 -7 70 15 30 28 48 16 41 -28 -4 -24 -2 -36 8 -39 20 -8 28 -40 15 -64 -11 -20 -63 -28 -86 -12 -17 11 -36 51 -29 62 3 5 1 11 -5 15 -16 10 -24 -25 -12 -57 9 -24 8 -30 -8 -38 -21 -11 -33 -37 -24 -52 4 -6 16 2 28 17 20 25 26 27 64 20 23 -4 44 -10 47 -14 9 -15 -26 -51 -49 -51 -14 0 -30 -10 -40 -25 -18 -27 -54 -33 -74 -13 -17 17 -17 384 1 391 22 9 34 7 47 -8z" /> -{{- else if (eq .name "dev") -}} +{{- else if (eq $icon_name "dev") -}} -{{- else if (eq .name "discogs") -}} +{{- else if (eq $icon_name "discogs") -}} -{{- else if (eq .name "discord") -}} +{{- else if (eq $icon_name "discord") -}} -{{- else if (eq .name "dreamstime") -}} +{{- else if (eq $icon_name "dreamstime") -}} -{{- else if (eq .name "dribbble") -}} +{{- else if (eq $icon_name "dribbble") -}} @@ -108,18 +109,18 @@ d="M5.858 19.136s2.343-5.79 8.161-6.422c5.818-.633 7.442.479 7.442.479M2.68 10.839s4.91.752 10.112-1.11c5.202-1.863 5.887-4.601 5.887-4.601" /> -{{- else if (eq .name "email") -}} +{{- else if (eq $icon_name "email") -}} -{{- else if (eq .name "facebook") -}} +{{- else if (eq $icon_name "facebook") -}} -{{- else if (eq .name "freepik") -}} +{{- else if (eq $icon_name "freepik") -}} -{{- else if (eq .name "github") -}} +{{- else if (eq $icon_name "github") -}} -{{- else if (eq .name "gitlab") -}} +{{- else if (eq $icon_name "gitlab") -}} -{{- else if (eq .name "hackerrank") -}} +{{- else if (eq $icon_name "hackerrank") -}} @@ -156,7 +157,7 @@ id="dgDKP06E5"> -{{- else if (eq .name "hackthebox") -}} +{{- else if (eq $icon_name "hackthebox") -}} @@ -165,32 +166,36 @@ -{{- else if (eq .name "instagram") -}} +{{- else if (eq $icon_name "instagram") -}} -{{- else if (eq .name "lastfm") -}} +{{- else if (eq $icon_name "lastfm") -}} -{{- else if (eq .name "linkedin") -}} +{{- else if (eq $icon_name "linkedin") -}} -{{- else if (eq .name "mastodon") -}} +{{- else if (eq $icon_name "mastodon") -}} - - + + -{{- else if (eq .name "medium") -}} +{{- else if (eq $icon_name "medium") -}} @@ -198,43 +203,43 @@ d="M0 380 l0 -380 380 0 380 0 0 380 0 380 -380 0 -380 0 0 -380z m334 85 c30 -63 57 -115 59 -115 2 0 16 30 31 68 15 37 37 88 49 115 l20 47 76 0 76 -1 -27 -20 -28 -21 0 -151 c0 -150 0 -151 27 -179 l27 -28 -109 0 -109 0 27 28 c26 27 27 32 26 143 0 131 3 134 -71 -58 -24 -62 -48 -113 -53 -113 -6 0 -17 16 -24 35 -7 19 -36 83 -64 142 l-52 108 -3 -98 c-3 -97 -2 -99 28 -133 16 -19 30 -39 30 -44 0 -6 -31 -10 -70 -10 -45 0 -70 4 -70 11 0 6 14 27 30 46 30 33 30 35 30 151 0 116 0 118 -31 155 l-30 37 75 0 76 0 54 -115z" /> -{{- else if (eq .name "mixcloud") -}} +{{- else if (eq $icon_name "mixcloud") -}} -{{- else if (eq .name "paypal") -}} +{{- else if (eq $icon_name "paypal") -}} -{{- else if (eq .name "qq") -}} +{{- else if (eq $icon_name "qq") -}} -{{- else if (eq .name "rss") -}} +{{- else if (eq $icon_name "rss") -}} -{{- else if (eq .name "soundcloud") -}} +{{- else if (eq $icon_name "soundcloud") -}} -{{- else if (eq .name "shutterstock") -}} +{{- else if (eq $icon_name "shutterstock") -}} -{{- else if (eq .name "slack") -}} +{{- else if (eq $icon_name "slack") -}} @@ -243,7 +248,7 @@ -{{- else if (eq .name "sourcerer") -}} +{{- else if (eq $icon_name "sourcerer") -}} @@ -265,36 +270,36 @@ d="M826 319 c-42 -33 -56 -71 -56 -149 0 -121 36 -170 125 -170 90 0 128 49 129 165 0 118 -43 175 -132 175 -25 0 -49 -8 -66 -21z m99 -63 c27 -19 34 -126 11 -161 -18 -27 -56 -34 -74 -12 -28 34 -26 142 4 172 19 19 35 19 59 1z" /> -{{- else if (eq .name "stackoverflow") -}} +{{- else if (eq $icon_name "stackoverflow") -}} -{{- else if (eq .name "steam") -}} +{{- else if (eq $icon_name "steam") -}} -{{- else if (eq .name "telegram") -}} +{{- else if (eq $icon_name "telegram") -}} -{{- else if (eq .name "twitch") -}} +{{- else if (eq $icon_name "twitch") -}} -{{- else if (eq .name "twitter") -}} +{{- else if (eq $icon_name "twitter") -}} -{{- else if (eq .name "youtube") -}} +{{- else if (eq $icon_name "youtube") -}} -{{- else if .name -}} +{{- else if $icon_name -}}