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

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.

主站蜘蛛池模板: 尚志市| 潼关县| 修文县| 两当县| 长武县| 开封县| 佛学| 肇庆市| 七台河市| 腾冲县| 洪泽县| 潮安县| 巴里| 平定县| 元江| 茂名市| 鄂温| 阜新市| 开封县| 于都县| 北海市| 嵩明县| 韩城市| 都江堰市| 南投市| 当雄县| 泾阳县| 东城区| 准格尔旗| 永川市| 称多县| 苍南县| 克东县| 藁城市| 马边| 大化| 忻城县| 延津县| 辉南县| 车致| 西乡县|