{% component seo(title, desc, config, url = "", page_type = "website", image = "", colocated_path = "", published = "", updated = "", tags = [], lang = "") %} {%- set og_image = "" -%} {%- if image -%} {%- if image is starting_with(pat="http://") or image is starting_with(pat="https://") or image is starting_with(pat="//") -%} {%- set og_image = image -%} {%- elif image is starting_with(pat="/") -%} {%- set og_image = get_url(path=image) -%} {%- elif colocated_path -%} {%- set og_image = get_url(path=colocated_path ~ image) -%} {%- else -%} {%- set og_image = get_url(path=image) -%} {%- endif -%} {%- elif config.extra.og_image -%} {%- if config.extra.og_image is starting_with(pat="http://") or config.extra.og_image is starting_with(pat="https://") or config.extra.og_image is starting_with(pat="//") -%} {%- set og_image = config.extra.og_image -%} {%- else -%} {%- set og_image = get_url(path=config.extra.og_image) -%} {%- endif -%} {%- endif -%} {% if url %}{% endif %} {% if url %}{% endif %} {% if lang %}{% endif %} {% if og_image %}{% endif %} {% if page_type == "article" %} {% if published %}{% endif %} {% if updated %}{% endif %} {% if tags %}{% for tag in tags %} {% endfor %}{% endif %} {% endif %} {% if og_image %}{% endif %} {% endcomponent seo %}