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

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

View file

@ -1,7 +1,7 @@
<header class="site-header">
<div class="site-header__content page-container">
<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" }} -->
<!-- <img class="site-header__logo" -->
<!-- src="{{ $image.RelPermalink }}" /> -->

View file

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