Theming link fields, getting URL value From a field template level, how can I get the link field URL value so I can theme this thing? Here is my overridden field template for this field:

{% for item in items %}
    {%
      set classes = [
        'btn',
        (loop.index0 == 0) ? 'btn--primary' : 'btn--inverted'
      ]
    %}

    &lt;a href="{{ item.content['#uri'] }}" class="{{ classes|join(' ') }}"&gt;{{ item.content['#title'] }}&lt;/a&gt;
{% endfor %}


It only holds two possible values.

I have tried every possible way to access the field value, but nothing seems to work.
Ok... found my answer. 

There are two ways you could do this. One way, is in the themename.theme file:

function mytheme_preprocess_field(&amp;$variables) {
  if ($variables['element']['#bundle'] == 'motivation_card' &amp;&amp; $variables['element']['#field_name'] == 'field_link') {
    foreach ($variables['items'] as $index =&gt; $item) {
      $variables['items'][$index]['content']['url'] = $item['content']['#url']-&gt;toString();
    }
  }
}


Another (preferable) way that I used is to use the render_var twig function.

{{ render_var(item.content['#url']) }}