fix(logos): svg class collision + svg RE match

This commit is contained in:
Matthieu Bessat 2023-05-21 23:05:00 +02:00
parent 7ad361d49f
commit 098f66df0e
3 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Calque_1" data-name="Calque 1" viewBox="0 0 1269.51 692.45"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Calque_1" data-name="Calque 1" viewBox="0 0 1269.51 692.45">
<defs> <defs>
<style>.cls-1{fill:url(#D&#xE9;grad&#xE9;_sans_nom_19);}.cls-2{font-size:147.13px;font-family:BonaNova-Regular, Bona Nova;letter-spacing:0.02em;}.cls-2,.cls-6{fill:#fff;}.cls-3{letter-spacing:0.03em;}.cls-4{font-size:175.11px;letter-spacing:0.05em;}.cls-5{letter-spacing:0.05em;}.cls-6{font-size:60.11px;font-family:Roboto-Medium, Roboto;font-weight:500;letter-spacing:0.28em;}</style> <style>.class-ss-1{fill:url(#D&#xE9;grad&#xE9;_sans_nom_19);}.class-ss-2{font-size:147.13px;font-family:BonaNova-Regular, Bona Nova;letter-spacing:0.02em;}.class-ss-2,.class-ss-6{fill:#fff;}.class-ss-3{letter-spacing:0.03em;}.class-ss-4{font-size:175.11px;letter-spacing:0.05em;}.class-ss-5{letter-spacing:0.05em;}.class-ss-6{font-size:60.11px;font-family:Roboto-Medium, Roboto;font-weight:500;letter-spacing:0.28em;}</style>
<linearGradient id="D&#xE9;grad&#xE9;_sans_nom_19" x1="347.14" y1="83.91" x2="347.14" y2="589.87" gradientUnits="userSpaceOnUse"> <linearGradient id="D&#xE9;grad&#xE9;_sans_nom_19" x1="347.14" y1="83.91" x2="347.14" y2="589.87" gradientUnits="userSpaceOnUse">
<stop offset="0.52" stop-color="#fff"/> <stop offset="0.52" stop-color="#fff"/>
<stop offset="0.58" stop-color="#fff" stop-opacity="0.9"/> <stop offset="0.58" stop-color="#fff" stop-opacity="0.9"/>
@ -10,7 +10,7 @@
<stop offset="1" stop-color="#fff" stop-opacity="0"/> <stop offset="1" stop-color="#fff" stop-opacity="0"/>
</linearGradient> </linearGradient>
</defs> </defs>
<path class="cls-1" d="M488.69,437.65,486.11,436a131.7,131.7,0,0,1-32-28.63l-74.37-88.21a5.49,5.49,0,0,1-1.34-3.38V300a3.16,3.16,0,0,0-2.77-3.21c-2.77-.4-3-2.82-3-4.51V245.38a1.3,1.3,0,0,1,1.31-1.31h2.24a.48.48,0,0,0,.36-.8c-5.17-5.66-6.71-15.72-24.75-17.5a1.52,1.52,0,0,1-1.38-1.5l-.39-47.93a2.44,2.44,0,0,1,3.88-2l28.1,20.42a1.16,1.16,0,0,0,1.78-1.29l-12.7-39.08a2.43,2.43,0,0,1,.89-2.73l33.24-24.15a1.16,1.16,0,0,0-.68-2.09H363.51a2.44,2.44,0,0,1-2.32-1.69l-12.7-39.08a1.58,1.58,0,0,0-2.7,0l-12.7,39.08a2.44,2.44,0,0,1-2.32,1.69H289.68a1.15,1.15,0,0,0-.68,2.09l33.24,24.15a2.43,2.43,0,0,1,.89,2.73l-12.7,39.08a1.16,1.16,0,0,0,1.78,1.29l28.1-20.42a2.44,2.44,0,0,1,3.88,2l-.39,47.93a1.52,1.52,0,0,1-1.38,1.5c-18,1.78-19.58,11.84-24.75,17.5a.48.48,0,0,0,.36.8h2.24a1.3,1.3,0,0,1,1.31,1.31v46.94c0,1.69-.19,4.11-3,4.51a3.16,3.16,0,0,0-2.77,3.21V315.8a5.49,5.49,0,0,1-1.34,3.38l-74.37,88.21a131.7,131.7,0,0,1-32,28.63l-2.58,1.63a1.74,1.74,0,0,0-.49,2.43,10,10,0,0,0,6.58,4.3,2.27,2.27,0,0,1,1.83,2.27V584.11a5.63,5.63,0,0,0,5.5,5.76H475.27a5.63,5.63,0,0,0,5.5-5.76V446.65a2.27,2.27,0,0,1,1.82-2.27,10,10,0,0,0,6.59-4.3A1.74,1.74,0,0,0,488.69,437.65ZM329.9,270.52c0-12.18,8.47-17,16.73-17l.51,0,.51,0c8.26,0,16.73,4.86,16.73,17v23.36a1.45,1.45,0,0,1-1.44,1.47h-31.6a1.45,1.45,0,0,1-1.44-1.47Zm49.9,278.71a2.33,2.33,0,0,1-2.34,2.33H316.82a2.33,2.33,0,0,1-2.34-2.33V441.3a32.19,32.19,0,0,1,32.3-32.07h.72a32.19,32.19,0,0,1,32.3,32.07Z"/> <path class="class-ss-1" d="M488.69,437.65,486.11,436a131.7,131.7,0,0,1-32-28.63l-74.37-88.21a5.49,5.49,0,0,1-1.34-3.38V300a3.16,3.16,0,0,0-2.77-3.21c-2.77-.4-3-2.82-3-4.51V245.38a1.3,1.3,0,0,1,1.31-1.31h2.24a.48.48,0,0,0,.36-.8c-5.17-5.66-6.71-15.72-24.75-17.5a1.52,1.52,0,0,1-1.38-1.5l-.39-47.93a2.44,2.44,0,0,1,3.88-2l28.1,20.42a1.16,1.16,0,0,0,1.78-1.29l-12.7-39.08a2.43,2.43,0,0,1,.89-2.73l33.24-24.15a1.16,1.16,0,0,0-.68-2.09H363.51a2.44,2.44,0,0,1-2.32-1.69l-12.7-39.08a1.58,1.58,0,0,0-2.7,0l-12.7,39.08a2.44,2.44,0,0,1-2.32,1.69H289.68a1.15,1.15,0,0,0-.68,2.09l33.24,24.15a2.43,2.43,0,0,1,.89,2.73l-12.7,39.08a1.16,1.16,0,0,0,1.78,1.29l28.1-20.42a2.44,2.44,0,0,1,3.88,2l-.39,47.93a1.52,1.52,0,0,1-1.38,1.5c-18,1.78-19.58,11.84-24.75,17.5a.48.48,0,0,0,.36.8h2.24a1.3,1.3,0,0,1,1.31,1.31v46.94c0,1.69-.19,4.11-3,4.51a3.16,3.16,0,0,0-2.77,3.21V315.8a5.49,5.49,0,0,1-1.34,3.38l-74.37,88.21a131.7,131.7,0,0,1-32,28.63l-2.58,1.63a1.74,1.74,0,0,0-.49,2.43,10,10,0,0,0,6.58,4.3,2.27,2.27,0,0,1,1.83,2.27V584.11a5.63,5.63,0,0,0,5.5,5.76H475.27a5.63,5.63,0,0,0,5.5-5.76V446.65a2.27,2.27,0,0,1,1.82-2.27,10,10,0,0,0,6.59-4.3A1.74,1.74,0,0,0,488.69,437.65ZM329.9,270.52c0-12.18,8.47-17,16.73-17l.51,0,.51,0c8.26,0,16.73,4.86,16.73,17v23.36a1.45,1.45,0,0,1-1.44,1.47h-31.6a1.45,1.45,0,0,1-1.44-1.47Zm49.9,278.71a2.33,2.33,0,0,1-2.34,2.33H316.82a2.33,2.33,0,0,1-2.34-2.33V441.3a32.19,32.19,0,0,1,32.3-32.07h.72a32.19,32.19,0,0,1,32.3,32.07Z"/>
<text class="cls-2" transform="translate(552.98 474.47)">l<tspan class="cls-3" x="45.5" y="0">&#x2019;</tspan><tspan class="cls-4" x="75.86" y="0">&#xC9;</tspan><tspan class="cls-5" x="194.4" y="0">toile</tspan></text> <text class="class-ss-2" transform="translate(552.98 474.47)">l<tspan class="class-ss-3" x="45.5" y="0">&#x2019;</tspan><tspan class="class-ss-4" x="75.86" y="0">&#xC9;</tspan><tspan class="class-ss-5" x="194.4" y="0">toile</tspan></text>
<text class="cls-6" transform="translate(557.02 548.55)">de Bethl&#xE9;em</text> <text class="class-ss-6" transform="translate(557.02 548.55)">de Bethl&#xE9;em</text>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -1,7 +1,7 @@
<header class="site-header"> <header class="site-header">
<div class="site-header__content page-container"> <div class="site-header__content page-container">
<a class="site-header__title" href="/"> <a class="site-header__title" href="/">
{{ partial "helpers/svg" (dict "path" "logo_horizontal_white_transparent" "class" "site-header__logo") }} {{ partial "helpers/svg" (dict "path" "all_logos/horizontal_white_transparent" "class" "site-header__logo") }}
<!-- {{ $image := resources.Get "images/all_logos/horizontal_white_transparent.svg" }} --> <!-- {{ $image := resources.Get "images/all_logos/horizontal_white_transparent.svg" }} -->
<!-- <img class="site-header__logo" --> <!-- <img class="site-header__logo" -->
<!-- src="{{ $image.RelPermalink }}" /> --> <!-- src="{{ $image.RelPermalink }}" /> -->

View file

@ -1,5 +1,5 @@
{{ $svg := .path }} {{ $svg := .path }}
{{ $match := `<svg (.*)>((\s|\S)*)</svg>` }} {{ $match := `<svg((\s|\S)*)>((\s|\S)*)</svg>` }}
{{ $replaceWith := printf `<svg class="%s" ${1}>${2}</svg>` .class }} {{ $replaceWith := printf `<svg class="%s" ${1}>${2}</svg>` .class }}
{{ $input := (printf "/assets/images/%s.svg" $svg | readFile) }} {{ $input := (printf "/assets/images/%s.svg" $svg | readFile) }}