lavas-project / jekyll-pwa

Jekyll plugin for PWA
MIT License
107 stars 19 forks source link

Service worker not being injected #8

Open Rubydesic opened 6 years ago

Rubydesic commented 6 years ago

I have followed the installations instructions of Option 1 and the plugin is installed

However, when I load any page, the service worker is simply not injected into it. There is no service worker at all <script> tag to be found. However, the sw-register.js file is produced as is workman in assets/js.

Any thoughts? If it is relevant, I am using the dactl theme

jizusun commented 6 years ago

@Rubyjunk

Are you experimenting with GitHub Pages or local Jekyll?

For me, the local Jekyll would successfully inject the service worker, while the GitHub Pages would not.

This is because (according to Jekyll docs)

Plugins on GitHub Pages GitHub Pages is powered by Jekyll. However, all Pages sites are generated using the --safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages. You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.

image

Rubydesic commented 6 years ago

@jizusun Local jekyll with gitlab pages