diff --git a/MEETING_NOTES.md b/MEETING_NOTES.md
index ee3b3d0d59..f69565dda4 100644
--- a/MEETING_NOTES.md
+++ b/MEETING_NOTES.md
@@ -1,21 +1,19 @@
-
# 2020-08-17 Blitz Contributor Call
- Attending: Brandon Bayer, Adam Markon, Kellen Mace, Myron Davis, Dwight Watson
- Brandon:
- - Auth out, set up by default in canary release
- - Need to work on a potential CSRF bug
- - Next major release will include auth by default and allow you to choose your form library
- - Next auth features are email confirmation
- - After that, logging and plugins are next
+ - Auth out, set up by default in canary release
+ - Need to work on a potential CSRF bug
+ - Next major release will include auth by default and allow you to choose your form library
+ - Next auth features are email confirmation
+ - After that, logging and plugins are next
- Adam:
- - Overhauled the recipe infrastructure. Now using jscodeshift instead of recast
- - Added support for conditional JSX in templates
- - Going to work on custom templates next
+ - Overhauled the recipe infrastructure. Now using jscodeshift instead of recast
+ - Added support for conditional JSX in templates
+ - Going to work on custom templates next
- Dwight
- - Has been opening issues for problems
- - Made a few PRs for some issues
-
+ - Has been opening issues for problems
+ - Made a few PRs for some issues
# 2020-07-07 Blitz Contributor Call
diff --git a/README.md b/README.md
index ecbe558950..145be4b4ba 100644
--- a/README.md
+++ b/README.md
@@ -332,6 +332,7 @@ Thanks to these wonderful people ([emoji key](https://allcontributors.org/docs/e
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index e1865b64a7..1f5359276b 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -1,3 +1,6 @@
+import {NextPage, NextComponentType} from "next"
+import {AppProps as NextAppProps} from "next/app"
+
export * from "./use-query"
export * from "./use-paginated-query"
export * from "./use-params"
@@ -22,13 +25,10 @@ export {
GetServerSideProps,
InferGetStaticPropsType,
InferGetServerSidePropsType,
- NextPage as BlitzPage,
NextApiRequest as BlitzApiRequest,
NextApiResponse as BlitzApiResponse,
} from "next"
-export {AppProps} from "next/app"
-
export {default as Head} from "next/head"
export {default as Link} from "next/link"
@@ -49,4 +49,14 @@ export {default as dynamic} from "next/dynamic"
export {default as ErrorComponent} from "next/error"
+export type BlitzComponentType = NextComponentType
+
+export interface AppProps extends NextAppProps {
+ Component: BlitzComponentType & {
+ getLayout?: (component: JSX.Element) => JSX.Element
+ }
+}
+export type BlitzPage
= NextPage
& {
+ getLayout?: (component: JSX.Element) => JSX.Element
+}
export {isLocalhost} from "./utils/index"
diff --git a/packages/generator/templates/app/app/layouts/Layout.tsx b/packages/generator/templates/app/app/layouts/Layout.tsx
new file mode 100644
index 0000000000..660ed995fb
--- /dev/null
+++ b/packages/generator/templates/app/app/layouts/Layout.tsx
@@ -0,0 +1,14 @@
+import { Head } from "blitz"
+
+const Layout = ({ title, children }) => (
+ <>
+
+ {title || "__name__"}
+
+
+
+ {children}
+ >
+)
+
+export default Layout
diff --git a/packages/generator/templates/app/app/pages/_app.tsx b/packages/generator/templates/app/app/pages/_app.tsx
index 0be54b8643..73ab70f6a7 100644
--- a/packages/generator/templates/app/app/pages/_app.tsx
+++ b/packages/generator/templates/app/app/pages/_app.tsx
@@ -4,6 +4,8 @@ import { queryCache } from "react-query"
import LoginForm from "app/auth/components/LoginForm"
export default function App({ Component, pageProps }: AppProps) {
+ const getLayout = Component.getLayout || ((page) => page)
+
return (
-
+ {getLayout()}
)
}
diff --git a/packages/generator/templates/app/app/pages/index.tsx b/packages/generator/templates/app/app/pages/index.tsx
index a82f314447..85282cc6de 100644
--- a/packages/generator/templates/app/app/pages/index.tsx
+++ b/packages/generator/templates/app/app/pages/index.tsx
@@ -1,4 +1,5 @@
-import { Head, Link, useSession } from "blitz"
+import Layout from "app/layouts/layout"
+import { Link, useSession } from "blitz"
import logout from "app/auth/mutations/logout"
/*
@@ -6,16 +7,11 @@ import logout from "app/auth/mutations/logout"
* You can delete everything in here and start from scratch if you like.
*/
-export default function Home() {
+const Home = () => {
const session = useSession()
return (
-
- __name__
-
-
-
@@ -249,3 +245,7 @@ export default function Home() {