butschster / LaravelMetaTags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project
MIT License
540 stars 50 forks source link

How I can use multiple "Apple Touch Icon" with addLink() method? #36

Closed pirmax closed 3 years ago

pirmax commented 3 years ago

Trying to use addLink() method to add multiple apple-touch-icon but only one is added to HTML because the package use an array_merge. How I can to do this?

Meta::addLink('apple-touch-icon', [
    'href' => asset('apple-icon-57x57.png'),
    'sizes' => '57x57',
])
->addLink('apple-touch-icon', [
    'href' => asset('apple-icon-60x60.png'),
    'sizes' => '60x60',
])
...

Full HTML tags:

<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
butschster commented 3 years ago

Hi.

You can try this approach https://github.com/butschster/LaravelMetaTags#multiple-favicons

scvn1 commented 3 years ago

Unfortunately that didn't fix the issue. Implemented it as given in example but nothing outputs on all the pages for the new favicons. image image

All the other packages render just fine on all the pages. Just not this custom one.

butschster commented 3 years ago

Where did you create this package. It will be registered in ServiceProvider