Add favicon to standalone build

This commit is contained in:
Thomas Weber committed 2021-10-27 18:45:02 -05:00
1 parent 8a73556d82
commit eb6e8865e9
1 file changed
+12 -3
+12 -3
View File
@@ -6,9 +6,18 @@
<% const {LONG_NAME, WEBSITE} = require('../packager/brand.js'); %>
<title><%= LONG_NAME %></title>
<meta name="description" content="Converts Scratch projects into HTML files, zip archives, or executable programs for Windows, macOS, and Linux.">
<% if (!process.env.STANDALONE) { %>
<link rel="shortcut icon" href="favicon.ico?v=2" />
<% } %>
<% if (process.env.STANDALONE) { %>
<%
const fs = require('fs');
const path = require('path');
const faviconPath = path.resolve('static/favicon.ico');
if (fs.existsSync(faviconPath)) {
%>
<link rel="shortcut icon" href="data:image/vnd.microsoft.icon;base64,<%= fs.readFileSync('static/favicon.ico').toString('base64') %>">
<% } %>
<% } else {%>
<link rel="shortcut icon" href="favicon.ico?v=2">
<% }%>
<style>
body[p4-splash-theme="dark"]:not([p4-loaded]) {
background-color: #111;