Jekyll和浏览器无法获取帖子的图像。怎么了?
Facebook的:
<meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
{% if page.image %}
<meta property="og:image" content="{{ site.url }}{{page.image }}">
{% else %}
<meta property="og:image" content="{{ "/assets/imagem/blog-image.png" | prepend: site.baseurl | prepend: site.url }}">
{% endif %}
<meta property="og:description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<meta property="og:site_name" content="{{ site.title }}">
微博
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@amenezesw">
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta name="twitter:description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
{% if page.image %}
<meta property="twitter:image:src" content="{{ site.url }}{{page.image }}">
{% else %}
<meta property="twitter:image:src" content="{{ "/assets/imagem/blog-image.png" | prepend: site.baseurl | prepend: site.url }}">
{% endif %}
G +
<meta itemprop="name" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"/>
<meta itemprop="description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<meta itemprop="image" content="{{ "/assets/imagem/blog-image.png" | prepend: site.baseurl | prepend: site.url }}"/>
enter code here
答案 0 :(得分:1)
尝试替换
{{ site.url }}{{ page.image }}
通过
{{ site.url }}{{ site.baseurl }}{{ page.image }}
或
{{ page.image | prepend: site.baseurl | prepend: site.url }}