Merge branch 'main' of https://github.com/timlrx/tailwind-nextjs-starter-blog into upstream
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import { NewsletterAPI } from 'pliny/newsletter'
|
||||
import siteMetadata from '@/data/siteMetadata'
|
||||
|
||||
export const dynamic = 'force-static'
|
||||
|
||||
const handler = NewsletterAPI({
|
||||
// @ts-ignore
|
||||
provider: siteMetadata.newsletter.provider,
|
||||
|
@ -21,11 +21,10 @@ const layouts = {
|
||||
PostBanner,
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: { slug: string[] }
|
||||
export async function generateMetadata(props: {
|
||||
params: Promise<{ slug: string[] }>
|
||||
}): Promise<Metadata | undefined> {
|
||||
const params = await props.params
|
||||
const slug = decodeURI(params.slug.join('/'))
|
||||
const post = allBlogs.find((p) => p.slug === slug)
|
||||
const authorList = post?.authors || ['default']
|
||||
@ -78,7 +77,8 @@ export const generateStaticParams = async () => {
|
||||
return allBlogs.map((p) => ({ slug: p.slug.split('/').map((name) => decodeURI(name)) }))
|
||||
}
|
||||
|
||||
export default async function Page({ params }: { params: { slug: string[] } }) {
|
||||
export default async function Page(props: { params: Promise<{ slug: string[] }> }) {
|
||||
const params = await props.params
|
||||
const slug = decodeURI(params.slug.join('/'))
|
||||
// Filter out drafts in production
|
||||
const sortedCoreContents = allCoreContent(sortPosts(allBlogs))
|
||||
|
@ -11,7 +11,8 @@ export const generateStaticParams = async () => {
|
||||
return paths
|
||||
}
|
||||
|
||||
export default function Page({ params }: { params: { page: string } }) {
|
||||
export default async function Page(props: { params: Promise<{ page: string }> }) {
|
||||
const params = await props.params
|
||||
const posts = allCoreContent(sortPosts(allBlogs))
|
||||
const pageNumber = parseInt(params.page as string)
|
||||
const initialDisplayPosts = posts.slice(
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { MetadataRoute } from 'next'
|
||||
import siteMetadata from '@/data/siteMetadata'
|
||||
|
||||
export const dynamic = 'force-static'
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
return {
|
||||
rules: {
|
||||
|
@ -2,6 +2,8 @@ import { MetadataRoute } from 'next'
|
||||
import { allBlogs } from 'contentlayer/generated'
|
||||
import siteMetadata from '@/data/siteMetadata'
|
||||
|
||||
export const dynamic = 'force-static'
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const siteUrl = siteMetadata.siteUrl
|
||||
|
||||
|
@ -1 +1 @@
|
||||
{"python":1,"projects":1,"code":1,"cygnus":1,"self-hosted":1,"server":1}
|
||||
{"python":1,"projects":1,"code":1,"cygnus":1,"self-hosted":1,"server":1}
|
||||
|
@ -8,7 +8,10 @@ import { genPageMetadata } from 'app/seo'
|
||||
import { Metadata } from 'next'
|
||||
import { notFound } from 'next/navigation'
|
||||
|
||||
export async function generateMetadata({ params }: { params: { tag: string } }): Promise<Metadata> {
|
||||
export async function generateMetadata(props: {
|
||||
params: Promise<{ tag: string }>
|
||||
}): Promise<Metadata> {
|
||||
const params = await props.params
|
||||
const tag = decodeURI(params.tag)
|
||||
return genPageMetadata({
|
||||
title: tag,
|
||||
@ -31,7 +34,8 @@ export const generateStaticParams = async () => {
|
||||
return paths
|
||||
}
|
||||
|
||||
export default function TagPage({ params }: { params: { tag: string } }) {
|
||||
export default async function TagPage(props: { params: Promise<{ tag: string }> }) {
|
||||
const params = await props.params
|
||||
const tag = decodeURI(params.tag)
|
||||
// Capitalize first letter and convert space to dash
|
||||
const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1)
|
||||
|
Reference in New Issue
Block a user