-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
og:image and og:type not always set #389
Comments
Alternatively, we could also use the {% if seo_tag.image %}
{% if seo_tag.image.path %}
<meta property="og:image" content="{{ seo_tag.image.path | default: seo_tag.image }}" />
{% endif %}
...
{% endif %} But ultimately with either of the route, the problem is that if |
I think this should suffice as workaround: {% if seo_tag.image %}
{% if seo_tag.image.path %}
<meta property="og:image" content="{{ seo_tag.image.path }}" />
/* Put the checks for width and height here */
{% else %}
{% if seo_tag.image.width or seo_tag.image.height %}
/* width and height are set, but image is an object -> do nothing */
{% else %}
<meta property="og:image" content="{{ seo_tag.image }}" />
{% endif %}
{% endif %}
{% endif %} Of course, this only checks for the |
Even better solution, using the {% if seo_tag.image.first %}
/* image is object */
{% if seo_tag.image.path %}
<meta property="og:image" content="{{ seo_tag.image.path }}" />
/* check if width and height are set */
{% if seo_tag.image.width %}
<meta property="og:image:width" content="{{ seo_tag.image.width }}" />
{% endif %}
{% if seo_tag.image.height %}
<meta property="og:image:height" content="{{ seo_tag.image.height }}" />
{% endif %}
{% endif %}
{% else %}
{% if seo_tag.image %}
/* image is string */
<meta property="og:image" content="{{ seo_tag.image }}" />
{% endif %}
{% endif %} |
This issue has been automatically marked as stale because it has not been commented on for at least two months. The resources of the Jekyll team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions. |
What about the pull requests? |
This issue has been automatically marked as stale because it has not been commented on for at least two months. The resources of the Jekyll team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions. |
If I see this correctly, the
og:image
is set toimage.path
(in this line). But if onlyimage: /url/to/image
is specified, the tag is not set becauseimage.path
is not present, right? Shouldn't there be the following:Also,
og:type
is not set anywhere when settingseo.type
, as specified in the advanced usage guide. Am I doing something wrong here? I tried settingseo.type
in the_config.yml
and also setting it in the front matter of pages and posts.The text was updated successfully, but these errors were encountered: