Created
July 2, 2024 15:44
-
-
Save apsolut/ff1f71079b2c4eaf8a5fd30d3aa0f4ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# add macro for video schema.org #} | |
{% import '../../macros/video-schemaorg.html' as video_macros %} | |
{{ video_macros.video_schema(module.options_video) }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro video_schema(options_video) %} | |
{% if module.options_video.enable_video %} | |
{% require_head %} | |
{% set videoName = module.options_video.video_name %} | |
{% set videoDesc = module.options_video.video_description %} | |
{% set videoThumb = module.options_video.video_thumb.src %} | |
{% set videoDate = module.options_video.video_date %} | |
{% set videoDateFormated = videoDate|datetimeformat("%Y-%m-%dT%H:%M:%S%z") %} | |
{% set videoURL = module.options_video.video_url %} | |
{% set videoRegion = module.options_video.video_region %} | |
<script type="application/ld+json"> | |
{ | |
"@context": "https://schema.org", | |
"@type": "VideoObject", | |
"name": "{{ videoName }}", | |
"description": "{{ videoDesc }}", | |
"thumbnailUrl": [ | |
"{{ videoThumb }}" | |
], | |
"uploadDate": "{{ videoDateFormated }}", | |
"contentUrl": "{{ videoURL }}" | |
{% if videoRegion %} | |
,"regionsAllowed": "{{ videoRegion }}" | |
{% endif %} | |
} | |
</script> | |
{% end_require_head %} | |
{% endif %} | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was original form: