parent
a60a4562bf
commit
b8d1bcd3de
2 changed files with 26 additions and 3 deletions
|
@ -23,7 +23,30 @@
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% capture seo_tags %}
|
||||||
{% seo title=false %}
|
{% seo title=false %}
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
{% if site.img_cdn and seo_tags contains 'og:image' %}
|
||||||
|
{% assign properties = 'og:image,twitter:image' | split: ',' %}
|
||||||
|
|
||||||
|
{% for prop in properties %}
|
||||||
|
{% if site.img_cdn contains '//' %}
|
||||||
|
<!-- `site.img_cdn` cross-origin URL -->
|
||||||
|
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{% endcapture %}
|
||||||
|
{% capture replacement %}<meta property="{{ prop }}" content="{{ site.img_cdn }}{% endcapture %}
|
||||||
|
{% else %}
|
||||||
|
<!-- `site.img_cdn` is a local file path -->
|
||||||
|
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
||||||
|
{% assign replacement = target | append: site.img_cdn %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{{ seo_tags }}
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
{%- unless page.layout == "home" -%}
|
{%- unless page.layout == "home" -%}
|
||||||
|
|
|
@ -11,11 +11,11 @@ tail_includes:
|
||||||
|
|
||||||
{% include lang.html %}
|
{% include lang.html %}
|
||||||
|
|
||||||
{% if page.image.src %}
|
{% if page.image.path %}
|
||||||
{% capture bg %}
|
{% capture bg %}
|
||||||
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
|
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
<img src="{{ page.image.src }}" class="preview-img {{ bg | strip }}"
|
<img src="{{ page.image.path }}" class="preview-img {{ bg | strip }}"
|
||||||
alt="{{ page.image.alt | default: "Preview Image" }}"
|
alt="{{ page.image.alt | default: "Preview Image" }}"
|
||||||
|
|
||||||
{% if page.image.width %}
|
{% if page.image.width %}
|
||||||
|
|
Loading…
Reference in a new issue