Joseph Hale's Technical Blog
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: `og:image` URL is incorrect (#1468)

Introduced by #1463

authored by

Cotes Chung and committed by
GitHub
(Jan 11, 2024, 2:11 AM +0800) b2d1cb68 3589a6ee

+14 -6
+1 -1
_includes/head.html
··· 26 26 {%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%} 27 27 {%- capture new_url -%}{{ img_url }}{%- endcapture -%} 28 28 29 - {% assign seo_tags = seo_tags | replace: old, new %} 29 + {% assign seo_tags = seo_tags | replace: old_url, new_url %} 30 30 {% endunless %} 31 31 32 32 {% elsif site.social_preview_image %}
+13 -5
_includes/img-url.html
··· 12 12 {% assign url = include.src %} 13 13 14 14 {%- if url -%} 15 - {%- comment -%} CND URL {%- endcomment -%} 16 - {% assign prefix = site.img_cdn | default: '' | relative_url %} 15 + {% unless url contains ':' %} 16 + {%- comment -%} CND URL {%- endcomment -%} 17 + {% assign prefix = site.img_cdn | default: '' | relative_url %} 17 18 18 - {%- comment -%} Add page image path prefix {%- endcomment -%} 19 - {% assign url = include.img_path | default: '' | append: '/' | append: url %} 19 + {%- comment -%} Add page image path prefix {%- endcomment -%} 20 + {% assign url = include.img_path | default: '' | append: '/' | append: url %} 20 21 21 - {% assign url = prefix | append: '/' | append: url | replace: '///', '/' | replace: '//', '/' | replace: ':', ':/' %} 22 + {% assign url = prefix 23 + | append: '/' 24 + | append: url 25 + | replace: '///', '/' 26 + | replace: '//', '/' 27 + | replace: ':', ':/' 28 + %} 29 + {% endunless %} 22 30 {%- endif -%} 23 31 24 32 {{- url -}}