All Projects → JLHwung → hexo-offline

JLHwung / hexo-offline

Licence: BSD-2-Clause license
Out-of-the-box hexo offline experience

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hexo-offline

Sw Precache Webpack Plugin
Webpack plugin that generates a service worker using sw-precache that will cache webpack's bundles' emitted assets. You can optionally pass sw-precache configuration options to webpack through this plugin.
Stars: ✭ 1,444 (+1992.75%)
Mutual labels:  offline, sw-precache
pyHeadspace
command-line script to download headspace packs, singles, everyday meditation and other sessions. You could also download all packs at once
Stars: ✭ 37 (-46.38%)
Mutual labels:  offline
choo-offline
🔧 offline first support for choo apps
Stars: ✭ 12 (-82.61%)
Mutual labels:  offline
hexo-theme-lanmiao
使用bootstrap构建的类单页博客,粉色系简洁Hexo主题
Stars: ✭ 16 (-76.81%)
Mutual labels:  hexo
hexo-auto-canonical
A generator automatically make canonical tag for hexo.
Stars: ✭ 15 (-78.26%)
Mutual labels:  hexo
global-upvote
A progressive web app that provides top voted stories across the web, summarized and updated every sixty seconds.
Stars: ✭ 25 (-63.77%)
Mutual labels:  offline
hexo-filter-responsive-images
Generate mutliple version of images for responsive Hexo blogs
Stars: ✭ 17 (-75.36%)
Mutual labels:  hexo
react-weather-app
⛅️ PWA Weather App made with ReactJS
Stars: ✭ 147 (+113.04%)
Mutual labels:  offline
yuanxiaosc.github.io
个人博客;论文;机器学习;深度学习;Python学习;C++学习;
Stars: ✭ 19 (-72.46%)
Mutual labels:  hexo
awesome-next
😎 Theme NexT, AWESOME NexT!
Stars: ✭ 47 (-31.88%)
Mutual labels:  hexo
notion-down
Notion >> Markdown. Python utility that converts Notion pages into MD files, along with intergation to build static webpages such as Hexo | 自动从 Notion 笔记生成 MD 文件,并部署到 Hexo 静态博客 | Notion Pages より Markdown Files をコンバートする、更に Hexo Webpages までの自動化も可能
Stars: ✭ 81 (+17.39%)
Mutual labels:  hexo
hexo-covers
Microbrowser covers for Hexo static site generator
Stars: ✭ 15 (-78.26%)
Mutual labels:  hexo
hexo-fontawesome
A utility function which helps to inline fontawesome SVG files.
Stars: ✭ 13 (-81.16%)
Mutual labels:  hexo
Canvas-Vision
📷 Wallpaper Downloading Android App
Stars: ✭ 14 (-79.71%)
Mutual labels:  offline
HelpOff
Providing help via offline system : Runner-Up at NMIMS Hackathon 2018
Stars: ✭ 20 (-71.01%)
Mutual labels:  offline
examples-android
Android demo application for GLMap framework
Stars: ✭ 14 (-79.71%)
Mutual labels:  offline
FastWebView
自定义本地缓存策略和资源加载策略,突破原生WebView缓存限制,实现多种缓存模式,支持离线加载和预加载,可大幅提升加载速度。
Stars: ✭ 211 (+205.8%)
Mutual labels:  offline
hexo-generator-tag
Tag generator plugin for Hexo.
Stars: ✭ 27 (-60.87%)
Mutual labels:  hexo
aws-mobile-appsync-events-starter-ios
GraphQL starter application with Realtime and Offline functionality using AWS AppSync
Stars: ✭ 99 (+43.48%)
Mutual labels:  offline
node-libzim
Binding to libzim, read/write ZIM files in Javascript
Stars: ✭ 23 (-66.67%)
Mutual labels:  offline

hexo-offline

npm version Build Status Coverage Status

hexo-offline is intended to provide offline experience for hexo 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.

See here for v1 docs.

Demo

Install

npm i hexo-offline --save

Once installed, run hexo clean && hexo generate to activate offline experience.

Usage

If the website serves all content from the origin server, you don't have to add any config. Simply install and run hexo clean && hexo generate.

While hexo-offline aims to provide zero-config offline enhancement to your hexo project, it does offer full list of options control from workbox-build. Create a hexo-offline.config.cjs in the hexo root directory

// offline config passed to workbox-build.
module.exports = {
  globPatterns: ["**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff}"],
  globDirectory: "/path/to/hexo/public",
  swDest: "/path/to/hexo/service-worker.js",
},

Again, the config is demo only and you don't have to copy and paste if you serves all contents from the origin server.

What if content is served via CDN?

Suppose that you have used two CDN scripts:

- https://cdn.example.com/script-name/script-version.js
- http://cdn.another-example.org/script-name/script-version.css

Add this config to root hexo-offline.config.cjs

// offline config passed to workbox-build.
module.exports = {
  runtimeCaching: [
    {
      urlPattern: /^https:\/\/cdn\.example\.com\/.*/,
      handler: "CacheFirst"
    },
    {
      urlPattern: /^https:\/\/cdn\.another-example\.org\/.*/,
      handler: "CacheFirst"
    }
  ]
},

For more information, see Workbox Runtime Caching Entry.

Note:

  1. As the CDN resources is runtime cached, it means that the resource will be cached only after a user-agent visit the page where the resource is referenced. Therefore, if you have included a CDN resource example.com/script.js in some-page.html only, the user who visit index.html only would not have example.com/script.js in cache.
  2. we use cacheFirst handler as CDN resources with specific version are not supposed to change in the future.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].