1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 21:53:26 +00:00

refactor: enhance the setting of preview image path

This commit is contained in:
Cotes Chung
2022-11-18 22:16:35 +08:00
parent f6e9a3fccf
commit da7d7e25b6
3 changed files with 9 additions and 14 deletions

View File

@@ -107,13 +107,7 @@
<!-- Add image path -->
{% if page.img_path %}
{% assign _path = page.img_path %}
{% assign last_char = _path | slice: -1 %}
{% unless last_char == '/' %}
{% assign _path = _path | append: '/' %}
{% endunless %}
{% assign _path = page.img_path | append: '/' | replace: '//', '/' %}
{% assign _src_prefix = _src_prefix | append: _path %}
{% endif %}