Skip to content

Commit

Permalink
chore(*): Update Next.js from 13 to 14
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbaumgertner committed Mar 3, 2024
1 parent ecc9cb3 commit 6752684
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Enable custom domain
run: cp CNAME ./out

- name: Delpoy 🚀
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
17 changes: 17 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: 'export',

// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
// trailingSlash: true,

// Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
// skipTrailingSlashRedirect: true,

// Optional: Change the output directory `out` -> `dist`
distDir: 'out',
}

module.exports = nextConfig
119 changes: 51 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Alex Baumgertner <[email protected]>",
"dependencies": {
"gray-matter": "^4.0.3",
"next": "^13.5.4",
"next": "^14.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remark": "^14.0.3",
Expand Down
6 changes: 0 additions & 6 deletions pages/_app.tsx

This file was deleted.

20 changes: 7 additions & 13 deletions pages/diagnostics/index.tsx → src/app/diagnostics/page.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
import path from 'path'
import Head from 'next/head'

import Layout from '../../src/layouts/Layuot'
import getFileData from '../../src/helpers/getFileData'
import getFileData from '@/helpers/getFileData'

const diagnosticsDirectory = path.join(process.cwd(), 'content', 'diagnostics')

export async function getStaticProps () {
const fileData = await getFileData(path.join(diagnosticsDirectory, `screening-tests.md`))
return {
props: {
fileData,
},
}
async function getData () {
return await getFileData(path.join(diagnosticsDirectory, `screening-tests.md`))
}

function DiagnosticPage ({ fileData }) {

async function DiagnosticPage () {
const fileData = await getData()
return (
<Layout>
<div className="DiagnosticPage">
<Head>
<title>{fileData.metaData.title}</title>
</Head>
<article>
<h2>{fileData.metaData.title}</h2>
<div dangerouslySetInnerHTML={{ __html: fileData.html }} />
</article>
</Layout>
</div>
)
}

Expand Down
42 changes: 42 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Metadata } from 'next'

import {
Menu,
Footer,
} from '../components'

import '@/styles/index.css'
import Head from 'next/head'

export const metadata: Metadata = {
authors: [{ name: 'Alex Baumgertner' }],
title: 'HHT (Рандю-Ослева-Вебера) болезнь',
description: 'HHT (Рандю-Ослева-Вебера) болезнь',
keywords: 'Болезнь Рандю́ — О́слера (Рандю — Ослера — Ве́бера), синдром Ослера, семейная наследственная телеангиэктазия наследственная геморрагическая телеангиэктазия, геморрагический ангиоматоз',
}

export default function RootLayout ({ children }) {
return (
<html lang="ru">
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet" />
</Head>
<body>
<div className="columns">
<div className="columns__col columns__col_left">
<Menu />
</div>
<div className="columns__col columns__col_right">
<main>{children}</main>
</div>
</div>

<Footer />
</body>
</html>
)
}
20 changes: 7 additions & 13 deletions pages/life-style/index.tsx → src/app/life-style/page.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
import path from 'path'
import Head from 'next/head'

import Layout from '../../src/layouts/Layuot'
import getFileData from '../../src/helpers/getFileData'
import getFileData from '@/helpers/getFileData'

const diagnosticsDirectory = path.join(process.cwd(), 'content', 'life-style')

export async function getStaticProps () {
const fileData = await getFileData(path.join(diagnosticsDirectory, `blood-thinners.md`))
return {
props: {
fileData,
},
}
async function getData () {
return await getFileData(path.join(diagnosticsDirectory, `blood-thinners.md`))
}

function LifeStylePage ({ fileData }) {

async function LifeStylePage () {
const fileData = await getData();
return (
<Layout>
<div className="LifeStylePage">
<Head>
<title>{fileData.metaData.title}</title>
</Head>
<article>
<h2>{fileData.metaData.title}</h2>
<div dangerouslySetInnerHTML={{ __html: fileData.html }} />
</article>
</Layout>
</div>
)
}

Expand Down
Loading

0 comments on commit 6752684

Please sign in to comment.