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

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.

主站蜘蛛池模板: 伊宁县| 富阳市| 文登市| 潜山县| 三原县| 闻喜县| 象州县| 仙居县| 东莞市| 怀仁县| 永修县| 望谟县| 黄陵县| 竹北市| 隆回县| 射洪县| 兴宁市| 武城县| 普宁市| 宁化县| 石棉县| 合江县| 芦溪县| 汝南县| 龙泉市| 石楼县| 乳源| 米脂县| 化州市| 冷水江市| 海南省| 洞口县| 济南市| 固镇县| 察哈| 沐川县| 来安县| 普格县| 临夏市| 土默特左旗| 南通市|