mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 23:16:47 +00:00
🔞
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import { Page404 } from 'components'
|
||||
import { Page404 } from '@/components'
|
||||
|
||||
export default Page404
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as React from 'react'
|
||||
import { GetStaticProps } from 'next'
|
||||
|
||||
import { NotionPage } from 'components'
|
||||
import { NotionPage } from '@/components'
|
||||
|
||||
import { domain, isDev } from 'lib/config'
|
||||
import { getSiteMap } from 'lib/get-site-map'
|
||||
import { resolveNotionPage } from 'lib/resolve-notion-page'
|
||||
import { PageProps, Params } from 'lib/types'
|
||||
import { domain, isDev } from '@/lib/config'
|
||||
import { getSiteMap } from '@/lib/get-site-map'
|
||||
import { resolveNotionPage } from '@/lib/resolve-notion-page'
|
||||
import { PageProps, Params } from '@/lib/types'
|
||||
|
||||
export const getStaticProps: GetStaticProps<PageProps, Params> = async (
|
||||
context
|
||||
|
||||
@@ -11,15 +11,6 @@ import posthog from 'posthog-js'
|
||||
import 'prismjs/themes/prism-coy.css'
|
||||
// core styles shared by all of react-notion-x (required)
|
||||
import 'react-notion-x/src/styles.css'
|
||||
|
||||
import { bootstrap } from 'lib/bootstrap-client'
|
||||
import {
|
||||
fathomConfig,
|
||||
fathomId,
|
||||
isServer,
|
||||
posthogConfig,
|
||||
posthogId
|
||||
} from 'lib/config'
|
||||
import 'styles/global.css'
|
||||
// this might be better for dark mode
|
||||
// import 'prismjs/themes/prism-okaidia.css'
|
||||
@@ -28,6 +19,15 @@ import 'styles/notion.css'
|
||||
// global style overrides for prism theme (optional)
|
||||
import 'styles/prism-theme.css'
|
||||
|
||||
import { bootstrap } from '@/lib/bootstrap-client'
|
||||
import {
|
||||
fathomConfig,
|
||||
fathomId,
|
||||
isServer,
|
||||
posthogConfig,
|
||||
posthogId
|
||||
} from '@/lib/config'
|
||||
|
||||
if (!isServer) {
|
||||
bootstrap()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { ErrorPage } from 'components'
|
||||
import { ErrorPage } from '@/components'
|
||||
|
||||
export default ErrorPage
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
parsePageId
|
||||
} from 'notion-utils'
|
||||
|
||||
import * as libConfig from 'lib/config'
|
||||
import { mapImageUrl } from 'lib/map-image-url'
|
||||
import { notion } from 'lib/notion-api'
|
||||
import { NotionPageInfo } from 'lib/types'
|
||||
import * as libConfig from '@/lib/config'
|
||||
import { mapImageUrl } from '@/lib/map-image-url'
|
||||
import { notion } from '@/lib/notion-api'
|
||||
import { NotionPageInfo } from '@/lib/types'
|
||||
|
||||
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method !== 'POST') {
|
||||
|
||||
@@ -3,8 +3,8 @@ import { NextRequest } from 'next/server'
|
||||
|
||||
import { ImageResponse } from '@vercel/og'
|
||||
|
||||
import { api, apiHost } from 'lib/config'
|
||||
import { NotionPageInfo } from 'lib/types'
|
||||
import { api, apiHost } from '@/lib/config'
|
||||
import { NotionPageInfo } from '@/lib/types'
|
||||
|
||||
const interRegularFontP = fetch(
|
||||
new URL('../../public/fonts/Inter-Regular.ttf', import.meta.url)
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
} from 'notion-utils'
|
||||
import RSS from 'rss'
|
||||
|
||||
import * as config from 'lib/config'
|
||||
import { getSiteMap } from 'lib/get-site-map'
|
||||
import { getSocialImageUrl } from 'lib/get-social-image-url'
|
||||
import { getCanonicalPageUrl } from 'lib/map-page-url'
|
||||
import * as config from '@/lib/config'
|
||||
import { getSiteMap } from '@/lib/get-site-map'
|
||||
import { getSocialImageUrl } from '@/lib/get-social-image-url'
|
||||
import { getCanonicalPageUrl } from '@/lib/map-page-url'
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
|
||||
if (req.method !== 'GET') {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as React from 'react'
|
||||
|
||||
import { NotionPage } from 'components'
|
||||
import { NotionPage } from '@/components'
|
||||
|
||||
import { domain } from 'lib/config'
|
||||
import { resolveNotionPage } from 'lib/resolve-notion-page'
|
||||
import { domain } from '@/lib/config'
|
||||
import { resolveNotionPage } from '@/lib/resolve-notion-page'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { GetServerSideProps } from 'next'
|
||||
|
||||
import { host } from 'lib/config'
|
||||
import { host } from '@/lib/config'
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
|
||||
if (req.method !== 'GET') {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { GetServerSideProps } from 'next'
|
||||
|
||||
import { host } from 'lib/config'
|
||||
import { getSiteMap } from 'lib/get-site-map'
|
||||
import type { SiteMap } from 'lib/types'
|
||||
import { host } from '@/lib/config'
|
||||
import { getSiteMap } from '@/lib/get-site-map'
|
||||
import type { SiteMap } from '@/lib/types'
|
||||
|
||||
export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
|
||||
if (req.method !== 'GET') {
|
||||
|
||||
Reference in New Issue
Block a user