diff --git a/src/components/common/header/index.tsx b/src/components/common/header/index.tsx
index 9b9a5bf..467e7cf 100644
--- a/src/components/common/header/index.tsx
+++ b/src/components/common/header/index.tsx
@@ -21,7 +21,14 @@ const HeaderMobile = React.forwardRef<
>(({ className, ...props }, ref) => {
const router = useRouter()
- const isActive = (href: string) => router.pathname === href
+ const isActive = (href: string) => {
+ const slug = router.query.slug as string
+ if (slug) {
+ return router.pathname.replace('/[slug]', '') === href
+ } else {
+ return router.pathname === href
+ }
+ }
return (
@@ -69,7 +76,14 @@ export const Header = () => {
const router = useRouter()
const [ref, bounds] = useMeasure()
- const isActive = (href: string) => router.pathname === href
+ const isActive = (href: string) => {
+ const slug = router.query.slug as string
+ if (slug) {
+ return router.pathname.replace('/[slug]', '') === href
+ } else {
+ return router.pathname === href
+ }
+ }
React.useEffect(() => {
const handleRouteChange = () => {
diff --git a/src/components/sections/blog/post-hero/index.tsx b/src/components/sections/blog/post-hero/index.tsx
index 5b74186..1d8a399 100644
--- a/src/components/sections/blog/post-hero/index.tsx
+++ b/src/components/sections/blog/post-hero/index.tsx
@@ -14,7 +14,7 @@ interface HeroProps {
const Hero = ({ data }: HeroProps) => {
return (
-
+
{formatDate(data.date)}
{data.title}
diff --git a/src/pages/about.tsx b/src/pages/about.tsx
index 6fd6fe8..ea63d35 100644
--- a/src/pages/about.tsx
+++ b/src/pages/about.tsx
@@ -30,7 +30,7 @@ export const getStaticProps = async () => {
heroBlogPost
} ?? null
},
- revalidate: 1
+ revalidate: 60
}
}
diff --git a/src/pages/blog/[slug].tsx b/src/pages/blog/[slug].tsx
index b1eb7c1..c229598 100644
--- a/src/pages/blog/[slug].tsx
+++ b/src/pages/blog/[slug].tsx
@@ -18,34 +18,26 @@ import Related from '~/components/sections/about/related'
import Content from '~/components/sections/blog/post-content'
import Hero from '~/components/sections/blog/post-hero'
import Shares from '~/components/sections/blog/shares'
+import { siteOrigin } from '~/lib/constants'
const BlogPost = ({
latestPosts,
post
}: InferGetStaticPropsType) => {
+ const router = useRouter()
+
+ const completeUrl = `${siteOrigin}${router.asPath}`
+
if (!post) {
return
}
- const router = useRouter()
- // `${location.origin}${router.asPath}`
- const completeUrl = `https://laconic.com${router.asPath}`
-
return (
- {/*
- {latestPosts.map((relatedPost: BlogPostFragment, index: Key) => {
- return (
-
-
-
- )
- })}
- */}
)
@@ -83,7 +75,7 @@ export const getStaticProps: GetStaticProps = async (
latestPosts: relatedPosts.slice(0, 3),
post: post
},
- revalidate: 1
+ revalidate: 60
}
} catch (error) {
return { notFound: true }
diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx
index cd278cd..67eec7a 100644
--- a/src/pages/blog/index.tsx
+++ b/src/pages/blog/index.tsx
@@ -192,7 +192,7 @@ export const getStaticProps = async () => {
heroBlogPost
} ?? null
},
- revalidate: 1
+ revalidate: 60
}
}
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 88563ef..cf7704f 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -31,7 +31,7 @@ export const getStaticProps = async () => {
heroBlogPost
} ?? null
},
- revalidate: 1
+ revalidate: 60
}
}
diff --git a/src/pages/products.tsx b/src/pages/products.tsx
index 35004d0..2038b21 100644
--- a/src/pages/products.tsx
+++ b/src/pages/products.tsx
@@ -12,7 +12,6 @@ import Hero from '~/components/sections/products/hero'
import Network from '~/components/sections/products/network'
import Stack from '~/components/sections/products/stack'
import Token from '~/components/sections/products/token'
-// import Partners from '~/components/sections/products/partners'
import Watchers from '~/components/sections/products/watchers'
export const getStaticProps = async () => {
@@ -35,7 +34,7 @@ export const getStaticProps = async () => {
heroBlogPost
} ?? null
},
- revalidate: 1
+ revalidate: 60
}
}
@@ -52,7 +51,6 @@ const Products = ({
- {/* */}
)
}