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:
@@ -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 %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user