From 8bffceaffd88061e4fb868ad3e82d4530e5bcf37 Mon Sep 17 00:00:00 2001 From: J Huang Date: Sun, 1 Jan 2017 00:23:22 +0800 Subject: [PATCH] README: add Install and Usage --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fcb8ae..666edf3 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,22 @@ [![Build Status](https://img.shields.io/travis/JLHwung/hexo-offline.svg?style=flat-square)](https://travis-ci.org/JLHwung/hexo-offline) [![Coverage Status](https://img.shields.io/coveralls/JLHwung/hexo-offline.svg?style=flat-square)](https://coveralls.io/github/JLHwung/hexo-offline) -## [demo](https://jhuang.me) +hexo-offline is intended to provide offline experience for [hexo](https://hexo.io) built static website. It uses *ServiceWorker* under the hood. Simply install this plugin to your website and it should be offline ready by caching most of static assets. + +## Install +```bash +npm i hexo-offline --save +``` +Once installed, run `hexo clean && hexo generate` to activate offline experience. + +## Usage +hexo-offline aims to provide out-of-the-box offline enhancement to your hexo project. Meanwhile it offers full list of options control from [sw-precache](https://github.com/GoogleChrome/sw-precache#options-parameter). Simply add your configuration to the root `_config.yml`. + +```yaml +# offline config passed to sw-precache +offline: + maximumFileSizeToCacheInBytes: 5242880 + verbose: true +``` + +## [Demo](https://jhuang.me)