yard / webmanifest
Creates web app manifests
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
pkg:composer/yard/webmanifest
Requires
- php: >=8.1
- intervention/image: ^3.9
- spatie/laravel-data: ^4.11
- spatie/laravel-package-tools: ^1.16
- webmozart/assert: ^1.11
Requires (Dev)
- 10up/wp_mock: ^0.4.2
- larastan/larastan: ^2.0
- orchestra/testbench: ^8.23
- pestphp/pest: ^2.34
- szepeviktor/phpstan-wordpress: ^1.0
- yard/php-cs-fixer-rules: ^1.0
README
This package for WordPress (Sage & Acorn) automatically generates a manifest.webmanifest JSON file. It also creates maskable versions of the favicon that will be used as the icons.
Requirements
Installation
To install this package using Composer, follow these steps:
-
Install this package with Composer:
composer require yard/webmanifest
-
Run the Acorn WP-CLI command to discover this package:
wp acorn package:discover
You can publish the config file with:
wp acorn vendor:publish --provider="Yard\Webmanifest\WebmanifestServiceProvider"
Usage
In theory you don't have to do anything, the Webmanifest works out of the box. This packages uses the favicon set in the theme to generate icons.
But you can alter behavior via the configuration.
Manually configuring icons
You can do this by adding them to the icons array in the config
'icons' => [ [ 'src' => 'path/to/icon.png', 'sizes' => '192x192', 'type' => 'image/png', ], ],
Theme settings
You can set the background and theme color by changing the config values below.
'background_color' => '#add8eb', 'theme_color' => '#ffffff',
Icon sizes
'iconSizes' => [192, 384, 512, 1024],
Webmanifest URL path
'url' => '/manifest.webmanifest',
Webmanifest icons url
'iconUrl' => '/webmanifest/icon',