mirror of
https://github.com/HananoshikaYomaru/openfreebooks.git
synced 2026-11-12 20:45:52 +00:00
Replace old Open Graph image with new static asset and integrate social meta tags into base template for improved sharing capabilities.
This commit is contained in:
parent
227404f623
commit
265bfd8cc0
4 changed files with 17 additions and 0 deletions
BIN
og.png
BIN
og.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 MiB |
BIN
static/og.png
Normal file
BIN
static/og.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 854 KiB |
|
|
@ -7,6 +7,7 @@
|
|||
{% block meta_description %}
|
||||
<meta name="description" content="{{ config.description | default(value=config.extra.site_title) }}" />
|
||||
{% endblock meta_description %}
|
||||
{% include "partials/social-meta.html" %}
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
|
|
|
|||
16
themes/openfreebooks/templates/partials/social-meta.html
Normal file
16
themes/openfreebooks/templates/partials/social-meta.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{# Open Graph + Twitter Card — shared site image on every page #}
|
||||
{% set og_image = get_url(path='og.png', trailing_slash=false) %}
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="{{ config.extra.site_title }}" />
|
||||
<meta property="og:title" content="{% if page %}{{ page.title }}{% elif section %}{{ section.title }}{% else %}{{ config.title }}{% endif %}" />
|
||||
<meta property="og:description" content="{% if page and page.description %}{{ page.description }}{% elif section and section.description %}{{ section.description }}{% else %}{{ config.description }}{% endif %}" />
|
||||
<meta property="og:url" content="{% if page %}{{ page.permalink }}{% elif section %}{{ section.permalink }}{% else %}{{ config.base_url }}{% endif %}" />
|
||||
<meta property="og:image" content="{{ og_image }}" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:image:alt" content="{{ config.extra.site_title }} — free, open textbooks for every learner" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="{% if page %}{{ page.title }}{% elif section %}{{ section.title }}{% else %}{{ config.title }}{% endif %}" />
|
||||
<meta name="twitter:description" content="{% if page and page.description %}{{ page.description }}{% elif section and section.description %}{{ section.description }}{% else %}{{ config.description }}{% endif %}" />
|
||||
<meta name="twitter:image" content="{{ og_image }}" />
|
||||
<meta name="twitter:image:alt" content="{{ config.extra.site_title }} — free, open textbooks for every learner" />
|
||||
Loading…
Add table
Add a link
Reference in a new issue