{# Reusable meta tags include for SEO and social media. Parameters: - item: The content object (post or page) - content_type: "article" or "website" - include_keywords: Boolean to include keywords meta tag (default: false) - include_article_tags: Boolean to include article-specific OG tags (default: false) #} {# Set default values for optional parameters #} {% set include_keywords = include_keywords | default(false) %} {% set include_article_tags = include_article_tags | default(false) %} {# Standard SEO meta tags #} {% if item.metadata and item.metadata.get('author') %} {% endif %} {% if item.description %} {% endif %} {% if include_keywords and item.tags %} {% endif %} {# Open Graph meta tags #} {% if item.description %} {% endif %} {% if item.metadata and item.metadata.get('cover') %} {% set cover_url = item.metadata.get('cover') %} {% if cover_url.startswith('http://') or cover_url.startswith('https://') %} {% elif cover_url.startswith('/') %} {% else %} {% endif %} {% endif %} {# Article-specific Open Graph tags #} {% if include_article_tags %} {% if item.date %} {% endif %} {% if item.metadata and item.metadata.get('modified') %} {% elif item.date %} {% endif %} {% if item.metadata and item.metadata.get('author') %} {% endif %} {% if item.category %} {% endif %} {% if item.tags %} {% for tag in item.tags %} {% endfor %} {% endif %} {% endif %} {# Twitter Card meta tags #} {% if item.description %} {% endif %} {% if item.metadata and item.metadata.get('cover') %} {% set cover_url = item.metadata.get('cover') %} {% if cover_url.startswith('http://') or cover_url.startswith('https://') %} {% elif cover_url.startswith('/') %} {% else %} {% endif %} {% endif %} {% if item.metadata and item.metadata.get('twitter_creator') %} {% endif %} {% if item.metadata and item.metadata.get('twitter_site') %} {% endif %}