Added basePath

This commit is contained in:
Meir Roth 2021-03-05 00:20:53 +00:00 committed by GitHub
parent 81f6ecb128
commit 3087fa5dc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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"