Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App router #300

Merged
merged 6 commits into from Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
12 changes: 12 additions & 0 deletions app/layout.tsx
@@ -0,0 +1,12 @@
import React from "react";
import "../styles/main.css";

const RootLayout = ({ children }: { children: React.ReactNode }) => {
return (
<html lang="en">
<body>{children}</body>
</html>
);
};

export default RootLayout;
44 changes: 24 additions & 20 deletions pages/index.tsx → app/page.tsx
@@ -1,30 +1,34 @@
import type { GetStaticProps } from "next";
import Head from "next/head";
import React from "react";
import { Metadata } from "next";
import { AccountList } from "../components/account-list";
import { Contacts } from "../components/contacts";
import { LargeIcon } from "../components/large-icon";
import { getPresentations, Presentation } from "../lib/speakerdeck";
import { Presentation, getPresentations } from "../lib/speakerdeck";

export const metadata: Metadata = {
title: "utgw.net",
viewport: {
width: "device-width",
initialScale: 1,
maximumScale: 1,
userScalable: false,
},
openGraph: {
title: "&#xE000;utgw.net&#xE001;",
description: "&#xE000;utgw.net&#xE001;",
},
formatDetection: {
telephone: false,
},
icons: {},
};

interface HomeProps {
presentations: Presentation[];
}

const Home: React.FC<HomeProps> = ({ presentations }) => {
const Home = ({ presentations }: HomeProps) => {
return (
<>
<Head>
<title>utgw.net</title>
<meta charSet="utf-8" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<meta property="og:title" content="&#xE000;utgw.net&#xE001;" />
<meta property="og:description" content="&#xE000;utgw.net&#xE001;" />
<meta name="format-detection" content="telephone=no" />
<link href="/favicon.ico" rel="icon" type="image/png" />
</Head>
<h1>utgw.net</h1>
<LargeIcon />
<Contacts />
Expand Down Expand Up @@ -89,10 +93,10 @@ const Home: React.FC<HomeProps> = ({ presentations }) => {
);
};

export const getStaticProps: GetStaticProps<HomeProps> = async () => {
const Page = async () => {
const presentations = await getPresentations(5);

return { props: { presentations } };
return <Home presentations={presentations} />;
};

export default Home;
export default Page;
30 changes: 21 additions & 9 deletions next.config.js
@@ -1,11 +1,23 @@
module.exports = {
async redirects() {
return [
{
source: "/labs/:path*",
destination: "https://sugarheart.utgw.net/labs/:path*",
permanent: true,
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");

/**
* @type {import('next').NextConfig}
*/
module.exports = (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
return {
async redirects() {
return [
{
source: "/labs/:path*",
destination: "https://sugarheart.utgw.net/labs/:path*",
permanent: true,
},
];
},
];
},
};
}
return {
output: "export",
};
};
14 changes: 0 additions & 14 deletions pages/_app.tsx

This file was deleted.

24 changes: 20 additions & 4 deletions tsconfig.json
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
Expand All @@ -13,8 +17,20 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}