Skip to content

Commit

Permalink
Generate IFS Image Structured Data
Browse files Browse the repository at this point in the history
  • Loading branch information
lordiii committed Mar 19, 2024
1 parent 2118c14 commit 3b6fdae
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
16 changes: 16 additions & 0 deletions templates/ifs/ifs-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@
decoding="async"
src="{{config.extra.ifs_base_path}}/.thumbs/750-{{page_data.extra.image_filename}}"/>
</a>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "ImageObject",
"contentUrl": "{{ config.extra.ifs_base_path ~ '/' ~ page_data.extra.image_filename | safe }}",
"license": "https://creativecommons.org/licenses/by-sa/4.0/",
"acquireLicensePage": "https://creativecommons.org/licenses/by-sa/4.0/",
"creditText": "Image From (The Hack-) Space",
"creator": {
"@type": "Person",
"name": "{{ config.author }}",
"url": "https://mainframe.io"
},
"copyrightNotice": "{{ config.author }}"
}
</script>
{% endfor %}
</div>

Expand Down
3 changes: 2 additions & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"@type": "Person",
"name": "{{ page.author | default(value=config.author) }}",
"url": "https://mainframe.io"
}]
}],
"description": {{ page.description | default(value=config.description) | json_encode | safe }}
}
</script>

Expand Down
17 changes: 17 additions & 0 deletions templates/shortcodes/ifs_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,20 @@
src="{{config.extra.ifs_base_path}}/.thumbs/1200-{{filename}}"
/>
</a>

<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "ImageObject",
"contentUrl": "{{ config.extra.ifs_base_path ~ '/' ~ filename | json_encode | safe }}",
"license": "https://creativecommons.org/licenses/by-sa/4.0/",
"acquireLicensePage": "https://creativecommons.org/licenses/by-sa/4.0/",
"creditText": "Image From (The Hack-) Space",
"creator": {
"@type": "Person",
"name": "{{ config.author }}",
"url": "https://mainframe.io"
},
"copyrightNotice": "{{ config.author }}"
}
</script>

0 comments on commit 3b6fdae

Please sign in to comment.