You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/default-theme-config/README.md
+15-9
Original file line number
Diff line number
Diff line change
@@ -356,26 +356,32 @@ Note that it's `off` by default. If given `string`, it will be displayed as a pr
356
356
Since `lastUpdated` is based on `git`, you can only use it in a `git` repository. As well, since the timestamp used comes from the git commit, it will display only after a first commit for a given page, and update only on subsequent commits of that page.
357
357
:::
358
358
359
-
## Service Workers
359
+
## Service Worker
360
360
361
-
The `themeConfig.serviceWorker` option allows you to configure about service workers.
361
+
The `themeConfig.serviceWorker` option allows you to configure about service worker.
362
362
363
-
### Popup UI to refresh contents
363
+
::: tip
364
+
Please do not confuse this option with [Config > serviceWorker](../config/README.md#serviceworker), [Config > serviceWorker](../config/README.md#serviceworker) is **site-level**, while this option is **theme-level**.
365
+
:::
364
366
365
-
The `themeConfig.serviceWorker.updatePopup` option enables the popup to refresh contents. The popup will be shown when the site is updated (the service worker is updated). It provides `refresh` button to allow users to refresh contents immediately.
367
+
### Popup UI to refresh contents <Badgetext="0.13.0+"/>
366
368
367
-
::: tip NOTE
368
-
If without the `refresh` button, the new service worker will be active after all clients are closed.
369
-
This means that visitors cannot see new contents until they close all tabs of your site.
369
+
The `themeConfig.serviceWorker.updatePopup` option enables the popup to refresh contents. The popup will be shown when the site is updated (i.e. service worker is updated). It provides `refresh` button to allow users to refresh contents immediately.
370
370
371
-
But the `refresh` button activates the new service worker immediately.
371
+
::: tip NOTE
372
+
If without the `refresh` button, the new service worker will be active after all [clients](https://developer.mozilla.org/en-US/docs/Web/API/Clients) are closed. This means that visitors cannot see new contents until they close all tabs of your site. But the `refresh` button activates the new service worker immediately.
372
373
:::
373
374
374
375
```js
375
376
module.exports= {
376
377
themeConfig: {
377
378
serviceWorker: {
378
-
updatePopup:true| {message:"New content is available.", buttonText:"Refresh"}
379
+
updatePopup:true// Boolean | Object, default to undefined.
380
+
// If set to true, the default text config will be:
0 commit comments