mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-30 15:10:55 +00:00
feat: initial webapp structure from notion2site
This commit is contained in:
34
components/temp
Normal file
34
components/temp
Normal file
@@ -0,0 +1,34 @@
|
||||
pageLink: ({ href = '', ...rest }) => {
|
||||
const parts = href
|
||||
.split('?')[0]
|
||||
.split('/')
|
||||
.filter((p: string) => !!p.trim())
|
||||
let pagesPath =
|
||||
parts.length <= 1 ? '/[domain]' : '/[domain]/[pageId]'
|
||||
let as = href
|
||||
|
||||
if (isDemo) {
|
||||
pagesPath = '/[domain]'
|
||||
} else if (isDev) {
|
||||
// localhost
|
||||
} else {
|
||||
// prod, non-demo
|
||||
as = `/${site.domain}${href}`
|
||||
}
|
||||
|
||||
console.log({ href, parts, domain: site.domain, as })
|
||||
// const MyButton = React.forwardRef(
|
||||
// ({ href: href2, ...rest }, ref) => {
|
||||
// return (
|
||||
// <a {...rest} href={href2} ref={ref}>
|
||||
// Click Me
|
||||
// </a>
|
||||
// )
|
||||
// }
|
||||
// )
|
||||
return (
|
||||
<Link href={pagesPath} as={as}>
|
||||
<a href={as} {...rest} />
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user