Skip to content

Commit

Permalink
Fix manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jun 8, 2024
1 parent 3682f50 commit beecd6b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<link rel="icon" href="./assets/icon/favicon-32x32.png" sizes="32x32" />
<link rel="icon" href="./assets/icon/android-chrome-192x192.png" sizes="192x192" />
<link rel="apple-touch-icon" href="./assets/icon/apple-touch-icon.png" />
<link rel="manifest" href="./manifest.json" />
<link rel="stylesheet" href="./css/style.css" />
<meta name="theme-color" content="#31d53d" />
</head>
<body>
<script src="./manifest.js" type="module"></script>
<div id="app"></div>
<script src="./js/index.js" type="module" ></script>
</body>
Expand Down
25 changes: 25 additions & 0 deletions src/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// eslint-disable-next-line import/no-unresolved
import logoUrl from './assets/imgs/logo.png?url';

// Add manifest.json to the home screen
const link = document.createElement('link');
link.rel = 'manifest';
const manifest = {
name: 'Blocknotes',
short_name: 'Blocknotes',
start_url: new URL('index.html', window.origin).toString(),
display: 'standalone',
icons: [
{
src: new URL(logoUrl, window.origin).toString(),
sizes: '512x512',
type: 'image/png',
},
],
background_color: '#000000',
theme_color: '#000000',
};

const blob = new Blob([JSON.stringify(manifest)], { type: 'application/json' });
link.href = URL.createObjectURL(blob);
document.head.appendChild(link);
13 changes: 0 additions & 13 deletions src/manifest.json

This file was deleted.

0 comments on commit beecd6b

Please sign in to comment.