Site Essentials for Statamic

Site Essentials for Statamic

Web Manifest Overview

The details used to generate your site's site.webmanifest file are contained within the site_essentials/webmanifest.php configuration file. Because of the large amount of options available when creating a manifest file, and the various customizations that may be desired, Site Essentials for Statamic does not provide a UI to manage your manifest file.

Site Essentials for Statamic ships with a slim manifest configuration by default. Anything added to the manifest value will be included in the final JSON output after generating the manifest file.

1<?php
2 
3return [
4 
5 /*
6 |--------------------------------------------------------------------------
7 | Webmanifest Public Path Configuration
8 |--------------------------------------------------------------------------
9 |
10 | Controls the public path where the generated webmanifest file
11 | will be saved. This path should be accessible to the web.
12 |
13 */
14 
15 'path' => public_path('site.webmanifest'),
16 
17 /*
18 |--------------------------------------------------------------------------
19 | Manifest File Configuration
20 |--------------------------------------------------------------------------
21 |
22 | The 'Manifest' option holds key/value pairs that are JSON-serialized for
23 | inclusion in generated manifest files. It integrates icons from favicon
24 | settings, ensuring they're represented in the resulting manifest file.
25 |
26 */
27 
28 'manifest' => [
29 'name' => config('app.name'),
30 'short_name' => config('app.name'),
31 'start_url' => '/',
32 'display' => 'standalone',
33 'background_color' => '#ffffff',
34 'theme_color' => '#ffffff',
35 'description' => '',
36 'prefer_related_applications' => false,
37 'related_applications' => [
38 
39 ],
40 ],
41 
42 /*
43 |--------------------------------------------------------------------------
44 | Manifest Meta Tag Attributes Configuration
45 |--------------------------------------------------------------------------
46 |
47 | The 'Tag Attributes' setting specifies key/value pairs to be appended as
48 | HTML attributes when generating the meta tag for the manifest file.
49 |
50 */
51 
52 'tag_attributes' => [
53 'rel' => 'manifest',
54 'crossorigin' => 'anonymous',
55 ],
56 
57];

If you are also utilizing the favicon generation feature, references to all generated favicons will be inserted into the final manifest file automatically.

#Generating Using the Command Line

The web manifest file for your site can be generated from the command line by running the following Artisan command from the root of your project:

1php artisan site-essentials:generate-web-manifest

#Programmatically Generating the Web Manifest

Manifest files may be generated programmatically using the WebManifest facade's generate method:

1<?php
2 
3use Stillat\StatamicSiteEssentials\Support\Facades\WebManifest;
4 
5WebManifest::generate();

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.