Skip to content

Commit

Permalink
wip implementing PWA
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius Figge committed Sep 8, 2023
1 parent ccb0095 commit 5dca508
Show file tree
Hide file tree
Showing 7 changed files with 3,739 additions and 273 deletions.
6 changes: 6 additions & 0 deletions _includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
<style>{% getBundle "css" %}</style>
{#- Renders the CSS bundle using a separate file, if you can't set CSP directive style-src: 'unsafe-inline' #}
{#- <link rel="stylesheet" href="{% getBundleFileUrl "css" %}"> #}

<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js");
}
</script>
</head>
<body>
<a href="#skip" class="visually-hidden">Skip to main content</a>
Expand Down
4 changes: 4 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const pluginDrafts = require("./eleventy.config.drafts.js");
const pluginImages = require("./eleventy.config.images.js");

const pluginPWA = require("eleventy-plugin-pwa-v2");

module.exports = function(eleventyConfig) {
// Copy the contents of the `public` folder to the output folder
// For example, `./public/css/` ends up in `_site/css/`
Expand Down Expand Up @@ -92,6 +94,8 @@ module.exports = function(eleventyConfig) {
});
});

eleventyConfig.addPlugin(pluginPWA);

// Features to make your build faster (when you need them)

// If your passthrough copy gets heavy and cumbersome, add this line
Expand Down
Loading

0 comments on commit 5dca508

Please sign in to comment.