fix: icon now shown in other languages.

This commit is contained in:
Junyi Hou 2024-09-11 12:06:53 +08:00
parent 422f416612
commit ac2950a4c0
No known key found for this signature in database
4 changed files with 113 additions and 2 deletions

View file

@ -2,13 +2,13 @@
<div class="post-header">
<header>
{{ $random := (md5 .Title) }}
{{ $iconPath := printf "%s/icon.svg" .File.Dir }}
{{ $iconPath := printf "%sicon.svg" .File.Dir }}
{{ if fileExists $iconPath }}
<style>
.post-icon-{{ $random }}::before {
display: inline-block;
content: '';
background: url("{{ $iconPath }}");
background: url("/{{ $iconPath }}");
width: 1.2em;
height: 1.2em;
background-size: auto 100%;