mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
new logo and styling tweaks
This commit is contained in:
42
src/pages/site.webmanifest.jsx
Normal file
42
src/pages/site.webmanifest.jsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import checkAndCopyConfig, { getSettings } from "utils/config/config";
|
||||
import themes from "utils/styles/themes";
|
||||
|
||||
export async function getServerSideProps({ res }) {
|
||||
checkAndCopyConfig("settings.yaml");
|
||||
const settings = getSettings();
|
||||
|
||||
const color = settings.color || "slate";
|
||||
const theme = settings.theme || "dark";
|
||||
|
||||
const manifest = {
|
||||
name: "Homepage",
|
||||
short_name: "Homepage",
|
||||
icons: [
|
||||
{
|
||||
src: "/android-chrome-192x192.png?v=2",
|
||||
sizes: "192x192",
|
||||
type: "image/png",
|
||||
},
|
||||
{
|
||||
src: "/android-chrome-512x512.png?v=2",
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
},
|
||||
],
|
||||
theme_color: themes[color][theme],
|
||||
background_color: themes[color][theme],
|
||||
display: "standalone",
|
||||
};
|
||||
|
||||
res.setHeader("Content-Type", "application/manifest+json");
|
||||
res.write(JSON.stringify(manifest));
|
||||
res.end();
|
||||
|
||||
return {
|
||||
props: {},
|
||||
};
|
||||
}
|
||||
|
||||
export default function Webmanifest() {
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user