Files
godot-website/_layouts/default.html
Adam Scott f18a4e1810 Ensure new cover images only use basic image formats (#1229)
- Add new filter `ensure_magic_type` (`_plugins/ensure_magic_type.rb`) that checks the input magic type and compares it to its parameter. If it doesn't match, it fails the build. There's optional context parameters to explain the check.

- Add new filter `is_legacy_cover_image` (`_plugins/is_legacy.rb`) that
is essentially a grand-fathered clause check to see if we apply
a `ensure_magic_type` check for the cover image.
2026-01-21 11:40:32 +01:00

60 lines
3.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="{% current_lang %}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Godot Engine">
<meta name="description" content="{% if page.description %}{{ page.description }}{% elsif page.excerpt %}{{ page.excerpt }}{% else %}{% t meta.description %}{% endif %}">
<!-- Plausible -->
<script defer data-domain="godotengine.org" src="https://plausible.godot.foundation/js/script.file-downloads.outbound-links.js"></script>
<!-- Social meta tags -->
<meta property="og:site_name" content="Godot Engine">
<meta property="og:url" content="https://godotengine.org{{ page.url }}">
<meta property="og:type" content="website">
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% elsif page.excerpt %}{{ page.excerpt }}{% else %}{% t meta.description %}{% endif %}">
{% assign page_image = page.image | default: '/assets/share-image.jpg' %}
{% assign is_page_image_legacy = page_image | is_legacy_cover_image %}
{% if is_page_image_legacy != true %}
{% assign page_image = page_image | ensure_magic_type: 'jpeg,png,gif', 'Some websites (like Reddit) seem to fail to render cover images in formats other than basic ones.', 'webp:We know that WebP is one of the best formats for the Web. But for now, we ban the use of WebP images only in the context of cover images.' %}
{% endif %}
<meta property="og:image" content="{{ site.url }}{{ page_image }}">
<!-- meta tags -->
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="godotengine.org">
<meta property="twitter:url" content="https://godotengine.org{{ page.url }}">
{% if page.title[current_lang] or page.title %}
{% if page.title[current_lang] %}
<meta property="og:title" content="{{ page.title[current_lang] | remove: " - Godot Engine" }}{% if page.notitlesuffix != true %} Godot Engine{% endif %}">
<title>{{ page.title[current_lang] | remove: " - Godot Engine" }}{% if page.notitlesuffix != true %} Godot Engine{% endif %}</title>
{% else %}
<meta property="og:title" content="{{ page.title | remove: " - Godot Engine" }}{% if page.notitlesuffix != true %} Godot Engine{% endif %}">
<title>{{ page.title | remove: " - Godot Engine" }}{% if page.notitlesuffix != true %} Godot Engine{% endif %}</title>
{% endif %}
{% else %}
<meta property="og:title" content="Godot Engine">
<title>Godot Engine</title>
{% endif %}
<link rel="alternate" type="application/rss+xml" title="Godot News" href="/rss.xml">
<link rel="alternate" type="application/json" title="Godot News" href="/rss.json" />
<link rel="alternate" type="application/atom+xml" title="Godot News" href="/atom.xml" />
<link rel="icon" href="/assets/favicon.png" sizes="any">
<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/assets/css/main.css?122">
<link rel="stylesheet" href="/assets/css/header.css?7">
<link rel="stylesheet" href="/assets/css/tobii.min.css">
<link rel="preload" as="font" href="/assets/fonts/Montserrat-Italic-VariableFont_wght.woff2" crossorigin>
<link rel="preload" as="font" href="/assets/fonts/Montserrat-VariableFont_wght.woff2" crossorigin>
<link rel="me" href="https://mastodon.gamedev.place/@godotengine">
</head>
<body>
{{ content }}
</body>
</html>