New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add jekyll-pwa-plugin #6533
add jekyll-pwa-plugin #6533
Conversation
docs/_docs/plugins.md
Outdated
@@ -960,6 +960,7 @@ You can find a few useful plugins at the following locations: | |||
- [Jekyll-Post](https://github.com/robcrocombe/jekyll-post): A CLI tool to easily draft, edit, and publish Jekyll posts. | |||
- [jekyll-numbered-headings](https://github.com/muratayusuke/jekyll-numbered-headings): Adds ordered number to headings. | |||
- [jekyll-pre-commit](https://github.com/mpchadwick/jekyll-pre-commit): A framework for running checks against your posts using a git pre-commit hook before you publish them. | |||
- [jekyll-pwa-plugin](https://github.com/lavas-project/jekyll-pwa): A plugin provides PWA support for Jekyll. Generate a service worker and provides precache and runtime cache with Google Workbox. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change Generate
to Generates
please?
I'm still learning about PWAs but I wasn't aware that there was a dependency there on Google Workbox. Is that just an implementation detail of your plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattr- It's an implementation by Google to make it easier to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks guys. As DirtyF says, Google Workbox has already developed a series of tools . If you use Webpack or Gulp as your build tool, you can easily generate a service worker with these tools. But in my blog, I don't want to use even npm, and I want to precache recent 10 posts so that they are offline available to visitors even though these posts were never opened by visitors before. That's why I try to integrate this function in Jekyll build process.
In the service worker generated by this plugin, I still use Workbox API such as precache and runtime cache routes inside. But through the relative configuration in _config.yml, I think it will help a lot for those who are not familiar with Workbox.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool plugin, will check it out. 🚀
@xiaoiver You might want to update the plugin's usage section. When i initially tried adding the gem and config block to my test site, Note: This should ideally be a bug report in your repo, but the plugin is only at |
Hi @ashmaroli , in this plugin I want to copy two files(a polyfill & workbox) under Dir.glob(File.expand_path('../vendor/**/*', __FILE__)) do |filepath_to_copy|
basename = File.basename(filepath_to_copy)
FileUtils.copy_file(filepath_to_copy, File.join(@site.dest, 'js', basename)) So in service worker generated, I can import these scripts correctly: Maybe I make a wrong assumption that users put their scripts in /js. |
@xiaoiver opened an issue ticket at your repo.. best, we continue there.. |
@jekyllbot: merge +site |
No description provided.