{# Damn you to hell, Drupal, this should not be anywhere near this complicated #}
{# Credit to leymannx, https://drupal.stackexchange.com/a/247807/4195 #}
{% if paragraph.field_link.0.url.external %}
  {% set url = paragraph.field_link.uri %}
{% elseif paragraph.field_link.0.url.routeName %}
  {% set url = path(paragraph.field_link.0.url.routeName, paragraph.field_link.0.url.routeParameters) %}
{% else %}
  {% set url = "" %}
{% endif %}
{# Include slide component template. #}
{%
  include '@agaric/components/slide.html.twig' with {
    image: content.field_image,
    text: content.field_text,
    url: url,
  } only
%}
