Q:

Adding external css with attributes in layout?

I want to add the following css to magento 2 at layout.xml in my theme of header blocks
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">

But how to add "integrity" and "crossorigin" also?
<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/style.css"/>
        <css src="https://use.fontawesome.com/releases/v5.1.0/css/all.css" src_type="url"/>
    </head>

A:

I think you can do it by following 
<body>
    <referenceBlock name="head.additional">
    <block class="Magento\Framework\View\Element\Text" name="my_script">
        <action method="setText">
            <argument translate="true" name="text" xsi:type="string">
                <![CDATA[<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">]]>
            </argument>
        </action>
    </block>
    </referenceBlock>
</body>

