mirror of
https://github.com/LaconicNetwork/laconic.com.git
synced 2026-03-06 12:34:07 +00:00
lint
Signed-off-by: Traxus <shyidx@gmail.com>
This commit is contained in:
parent
d13f57a7e2
commit
84ade64766
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
import tiny from 'tiny-json-http'
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
import {
|
||||
datocmsQueryIntercept
|
||||
} from 'lib/datocms-bypass'
|
||||
datocmsQueryIntercept
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -15,10 +15,10 @@ interface props {
|
||||
}
|
||||
|
||||
export async function request({ query, variables, preview }: props) {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
/*
|
||||
let endpoint = 'https://graphql.datocms.com'
|
||||
|
||||
if (preview) {
|
||||
@ -42,19 +42,18 @@ export async function request({ query, variables, preview }: props) {
|
||||
}
|
||||
|
||||
return body.data
|
||||
*/
|
||||
*/
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === "local_json") {
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
let interceptData : any = await datocmsQueryIntercept(query);
|
||||
|
||||
if (interceptData.error) {
|
||||
console.error(interceptData.error);
|
||||
interceptData = {};
|
||||
return interceptData;
|
||||
console.error(interceptData.error);
|
||||
interceptData = {};
|
||||
return interceptData;
|
||||
} else {
|
||||
return interceptData;
|
||||
return interceptData;
|
||||
}
|
||||
|
||||
} else {
|
||||
let endpoint = 'https://graphql.datocms.com'
|
||||
|
||||
@ -79,8 +78,8 @@ export async function request({ query, variables, preview }: props) {
|
||||
}
|
||||
|
||||
return body.data
|
||||
}
|
||||
}
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
import {
|
||||
getBlogPosts as serverGetBlogPosts,
|
||||
@ -12,7 +12,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
|
||||
@ -37,21 +37,21 @@ import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
getBlogPosts as serverGetBlogPosts
|
||||
} from 'lib/blog'
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
import {
|
||||
getAllBlogPostsSlugsFromSource,
|
||||
@ -14,7 +14,7 @@ import {
|
||||
|
||||
//import cms from 'lib/cms'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
|
||||
import {
|
||||
@ -63,34 +63,34 @@ const BlogPost = ({
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//const posts = await getAllBlogPostsSlugs()
|
||||
|
||||
async function postsSlugsJsonFromSource() : Promise<any> {
|
||||
let postsSlugsJson : any = {};
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === "local_json") {
|
||||
postsSlugsJson = await getAllBlogPostsSlugsFromSource();
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
postsSlugsJson = await getAllBlogPostsSlugsFromSource();
|
||||
} else {
|
||||
postsSlugsJson = await getAllBlogPostsSlugs();
|
||||
}
|
||||
|
||||
return postsSlugsJson;
|
||||
}
|
||||
|
||||
return postsSlugsJson;
|
||||
}
|
||||
|
||||
const posts = await postsSlugsJsonFromSource();
|
||||
|
||||
/*
|
||||
/*
|
||||
const paths = posts?.map((post) => ({
|
||||
params: { slug: post.slug as string }
|
||||
}))
|
||||
*/
|
||||
*/
|
||||
|
||||
const paths = posts?.map((post : any) => ({
|
||||
params: { slug: post.slug as string }
|
||||
}))
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
return { paths, fallback: 'blocking' }
|
||||
}
|
||||
@ -100,31 +100,31 @@ export const getStaticProps: GetStaticProps = async (
|
||||
) => {
|
||||
try {
|
||||
const slug = ctx.params?.slug as string
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//const post = await (await cms().SingleBlogPost({ slug })).blogPost
|
||||
const post : any = await getSingleBlogPostBySlugFromSource(slug);
|
||||
|
||||
/*
|
||||
/*
|
||||
const allBlogPosts = await serverGetBlogPosts({
|
||||
filterSlugs: [slug],
|
||||
step: 100
|
||||
})
|
||||
|
||||
|
||||
const relatedPosts = allBlogPosts.data.filter((p) =>
|
||||
p.category.some((c) =>
|
||||
post?.category.some((postCategory) => c.slug === postCategory.slug)
|
||||
)
|
||||
)
|
||||
*/
|
||||
|
||||
)
|
||||
*/
|
||||
|
||||
async function getRelatedBlogPostsFromSource() : Promise<any> {
|
||||
|
||||
let relatedBlogPosts = {};
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === "local_json") {
|
||||
|
||||
|
||||
let relatedBlogPosts = {};
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
|
||||
try {
|
||||
relatedBlogPosts = await getRelatedBlogPosts(post, 3);
|
||||
} catch (e) {
|
||||
@ -147,14 +147,14 @@ export const getStaticProps: GetStaticProps = async (
|
||||
)
|
||||
|
||||
relatedBlogPosts = relatedPosts;
|
||||
}
|
||||
|
||||
return relatedBlogPosts;
|
||||
}
|
||||
|
||||
return relatedBlogPosts;
|
||||
}
|
||||
|
||||
const relatedPosts = await getRelatedBlogPostsFromSource();
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const [footerData, headerData] = await Promise.all([
|
||||
request(FooterQuery),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { PageLayout } from 'components/layout/page'
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
import {
|
||||
@ -19,7 +19,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
import { useRouter } from 'next/router'
|
||||
@ -40,7 +40,7 @@ import { FooterQuery } from '~/lib/cms/queries/footer'
|
||||
import { HeaderQuery } from '~/lib/cms/queries/header'
|
||||
import { getHrefWithQuery, makeQuery } from '~/lib/utils/router'
|
||||
|
||||
import { request } from '../../lib/datocms'
|
||||
import { request } from '../../lib/datocms'
|
||||
|
||||
const getMatchingCategory = (categories: CategoryFragment[], c?: string) =>
|
||||
categories.find((cat) => cat.slug === c)
|
||||
@ -52,11 +52,10 @@ const BlogIndexPage = ({
|
||||
headerData,
|
||||
page: { heroBlogPost }
|
||||
}: InferGetStaticPropsType<typeof getStaticProps>) => {
|
||||
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === "local_json") {
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//-----remove all pagnation, search, sorting etc... as a lot of this was already broken and breaking further with the bypass
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//-----remove all pagnation, search, sorting etc... as a lot of this was already broken and breaking further with the bypass
|
||||
return (
|
||||
<PageLayout footerData={footerData} headerData={headerData}>
|
||||
<Meta title="Blog | Laconic Network" />
|
||||
@ -70,13 +69,13 @@ const BlogIndexPage = ({
|
||||
</PostsGrid>
|
||||
</PageLayout>
|
||||
)
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
} else {
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
} else {
|
||||
//===== \/ START ORIGINAL PRE NEXT_PUBLIC_DATOCMS_BYPASS CODE \/ ===================================
|
||||
//-----everything in this ELSE block was the original code
|
||||
//-----naturally the wrapping conditonal WAS not in the original code
|
||||
//-----typically the pattern has been copy and comment out the orignial code at its current block level, then modify it as needed...
|
||||
//-----however this was huge block, so easier to do this and explain the variation from the norm.
|
||||
//-----typically the pattern has been copy and comment out the orignial code at its current block level, then modify it as needed...
|
||||
//-----however this was huge block, so easier to do this and explain the variation from the norm.
|
||||
const router = useRouter()
|
||||
const { c, s } = router.query
|
||||
const activeCategory = useMemo(
|
||||
@ -127,21 +126,17 @@ const BlogIndexPage = ({
|
||||
if ('total' in queriedPosts.pages[0].pagination) {
|
||||
if (queriedPosts.pages[0].pagination.total > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//const hasResults = !!queriedPosts?.pages[0]?.data?.length
|
||||
const hasResults = queriedPostsHasResults(queriedPosts);
|
||||
|
||||
//console.log(queriedPosts);
|
||||
//console.log(queriedPosts.pages[0]);
|
||||
//console.log(queriedPosts.pages[0].data);
|
||||
|
||||
return (
|
||||
<PageLayout footerData={footerData} headerData={headerData}>
|
||||
@ -206,7 +201,7 @@ const BlogIndexPage = ({
|
||||
)}
|
||||
</PageLayout>
|
||||
)
|
||||
//===== /\ FINISH ORIGINAL PRE NEXT_PUBLIC_DATOCMS_BYPASS CODE /\ ===================================
|
||||
//===== /\ FINISH ORIGINAL PRE NEXT_PUBLIC_DATOCMS_BYPASS CODE /\ ===================================
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,39 +237,39 @@ const clientGetBlogPosts = async ({
|
||||
|
||||
return allBlogPosts
|
||||
}
|
||||
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
function getInitialBlogPostsDataProp(allBlogPosts : any) {
|
||||
|
||||
let initialBlogPostsDataProp : any[] = [];
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === "local_json") {
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
//-----no pagination
|
||||
initialBlogPostsDataProp = allBlogPosts.data;
|
||||
} else {
|
||||
//-----old setup had pagination but it wasn't working...
|
||||
initialBlogPostsDataProp = allBlogPosts.data.slice(0, 9);
|
||||
}
|
||||
|
||||
|
||||
return initialBlogPostsDataProp;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
@ -287,12 +282,12 @@ export const getStaticProps = async () => {
|
||||
props: {
|
||||
initialBlogPosts: {
|
||||
pagination: allBlogPosts.pagination,
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//data: allBlogPosts.data.slice(0, 9)
|
||||
data: getInitialBlogPostsDataProp(allBlogPosts)
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
},
|
||||
footerData: footerData?.footer,
|
||||
headerData: headerData?.header,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
import {
|
||||
getBlogPosts as serverGetBlogPosts,
|
||||
@ -12,7 +12,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
|
||||
@ -37,21 +37,21 @@ import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
import {
|
||||
getBlogPosts as serverGetBlogPosts,
|
||||
@ -12,7 +12,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
|
||||
@ -36,21 +36,21 @@ import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
import {
|
||||
getBlogPosts as serverGetBlogPosts,
|
||||
@ -12,7 +12,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
|
||||
@ -35,21 +35,21 @@ import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
import {
|
||||
getBlogPosts as serverGetBlogPosts,
|
||||
@ -12,7 +12,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
|
||||
@ -32,21 +32,21 @@ import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
import {
|
||||
getBlogPosts as serverGetBlogPosts,
|
||||
@ -12,7 +12,7 @@ import {
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
import { InferGetStaticPropsType } from 'next'
|
||||
|
||||
@ -40,21 +40,21 @@ import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
const heroBlogPost = allBlogPosts.data[0]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user