官术网_书友最值得收藏!

Adding a manifest

Adding a web manifest file should be the first step in upgrading an existing website. You can create your site's manifest file in a matter of minutes. In the tooling chapter, I will review a few online resources that can help automate the process.

Registering a PWA's web manifest requires a special link element in the HTML head element. The following code shows how the 2048 manifest file is registered:

<head>
….
<link rel="manifest" href="manifest.json">
</head>

If you are familiar with referencing a style sheet, this syntax should look familiar. The difference is the rel attribute value being manifest. The href value points to the manifest file. You are free to name it anything, but manifest is the most common name.

The next chapter will go into more manifest file details. You can reference the project's manifest.json file to see how the 2048 game is configured. It contains the application's name, default URL, primary colors, and an array of icon image references.

主站蜘蛛池模板: 旬阳县| 永新县| 三江| 依安县| 桐庐县| 苏尼特左旗| 汉川市| 南充市| 霞浦县| 玉龙| 平昌县| 建瓯市| 焉耆| 绿春县| 来宾市| 饶阳县| 乐都县| 高碑店市| 许昌县| 溆浦县| 安平县| 南安市| 砚山县| 博客| 德化县| 徐闻县| 华亭县| 友谊县| 都江堰市| 霍州市| 南京市| 西丰县| 东乡县| 庐江县| 雅安市| 扶沟县| 青神县| 郧西县| 济南市| 巴彦淖尔市| 华安县|