Merge pull request #516 from meirroth/master

Fix favicon paths
This commit is contained in:
Mike Cao 2021-03-04 20:38:48 -08:00 committed by GitHub
commit 24206a652a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -1,14 +1,17 @@
import React from 'react';
import Head from 'next/head';
import { useRouter } from 'next/router';
import Header from 'components/layout/Header';
import Footer from 'components/layout/Footer';
export default function Layout({ title, children, header = true, footer = true }) {
const { basePath } = useRouter();
return (
<>
<Head>
<title>umami{title && ` - ${title}`}</title>
<link rel="icon" href="favicon.ico" />
<link rel="icon" href={`${basePath}/favicon.ico`} />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"
rel="stylesheet"

View File

@ -1,5 +1,6 @@
import React from 'react';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { IntlProvider } from 'react-intl';
import { Provider } from 'react-redux';
import { useStore } from 'redux/store';
@ -25,15 +26,16 @@ const Intl = ({ children }) => {
export default function App({ Component, pageProps }) {
useForceSSL(process.env.FORCE_SSL);
const store = useStore();
const { basePath } = useRouter();
return (
<Provider store={store}>
<Head>
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<link rel="manifest" href="site.webmanifest" />
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5" />
<link rel="apple-touch-icon" sizes="180x180" href={`${basePath}/apple-touch-icon.png`} />
<link rel="icon" type="image/png" sizes="32x32" href={`${basePath}/favicon-32x32.png`} />
<link rel="icon" type="image/png" sizes="16x16" href={`${basePath}/favicon-16x16.png`} />
<link rel="manifest" href={`${basePath}/site.webmanifest`} />
<link rel="mask-icon" href={`${basePath}/safari-pinned-tab.svg`} color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1" />