Skip to content

Commit

Permalink
docs: document the PWA offline image
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Aug 2, 2022
1 parent cdf61fd commit e5d5504
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions exampleSite/content/docs/pwa/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ The `manifest.json` will be generated automatically.

## Offline

### Offline Page

The offline page will be shown in the case of requesting a new page without network.

We need to create an offline page called `offline/_index.md` in the `content` directory with the following front matter.
Expand All @@ -81,6 +83,11 @@ title = 'Offline'
+++
```

### Offline Image

Same as offline page, there is an offline image for requesting images without network. HBS provides a built-in offline image with the filename `assets/images/offline.png`.
You can override it by creating your own offline image with the same filename under your site root.

## Precache

{{< code-toggle filename="params">}}
Expand Down
7 changes: 7 additions & 0 deletions exampleSite/content/docs/pwa/index.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ PWAs([渐进式 web 应用程序](https://developer.mozilla.org/en-US/docs/Web/P

## 离线

### 脱机页面

如果在没有网络的情况下请求新页面,将显示脱机页面。

我们需要在 `content` 目录中创建一个名为 `offline/_index.md` 的脱机页面,其首要内容如下。
Expand All @@ -81,6 +83,11 @@ title = 'Offline'
+++
```

### 脱机图片

与脱机页面一样,有一个脱机图片用于在没有网络的情况下请求图片。HBS 提供了一个内置的离线图片,文件名是 `assets/images/offline.png`
你可以通过在你的网站根目录下创建你自己的具有相同文件名的离线图片来覆盖它。

## 预载

{{< code-toggle filename="params">}}
Expand Down
7 changes: 7 additions & 0 deletions exampleSite/content/docs/pwa/index.zh-hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ PWAs([漸進式 web 應用程序](https://developer.mozilla.org/en-US/docs/Web/P

## 離線

### 離線頁面

如果在沒有網絡的情况下請求新頁面,將顯示離線頁面。

我們需要在 `content` 目錄中創建一個名為 `offline/_index.md` 的離線頁面,其首要內容如下。
Expand All @@ -80,6 +82,11 @@ title = 'Offline'
+++
```

### 離線圖片

與離線頁面壹樣,有壹個脫機圖片用於在沒有網絡的情況下請求圖片。HBS 提供了壹個內置的離線圖片,文件名是 `assets/images/offline.png`
妳可以通過在妳的網站根目錄下創建妳自己的具有相同文件名的離線圖片來覆蓋它。

## 預載

{{< code-toggle filename="params">}}
Expand Down

0 comments on commit e5d5504

Please sign in to comment.