mirror of
https://github.com/LaconicNetwork/laconic.com.git
synced 2026-01-17 04:14:09 +00:00
Signed-off-by: Traxus <shyidx@gmail.com>
This commit is contained in:
parent
cece4ae745
commit
03b1696d8a
@ -8,11 +8,10 @@ import path from 'path'
|
||||
import { promises as fs } from 'fs'
|
||||
|
||||
//-----misc helpers
|
||||
function datocmsDateToIng(date : string) : number {
|
||||
|
||||
function datocmsDateToIng(date: string): number {
|
||||
let dateInt = 0
|
||||
|
||||
date = date.replace(/\D/g,'')
|
||||
date = date.replace(/\D/g, '')
|
||||
dateInt = parseInt(date)
|
||||
|
||||
if (Number.isInteger(dateInt) !== true) {
|
||||
@ -23,30 +22,29 @@ function datocmsDateToIng(date : string) : number {
|
||||
}
|
||||
|
||||
//-----graphql query interception
|
||||
export async function datocmsQueryIntercept(query : any) {
|
||||
let parent = pluckFirstParentFromQuery(query)
|
||||
let pageQueryWhitelist = getPageQueryBypassWhitelist()
|
||||
let listingQueryWhitelist = getListingQueryDirectories()
|
||||
export async function datocmsQueryIntercept(query: any) {
|
||||
const parent = pluckFirstParentFromQuery(query)
|
||||
const pageQueryWhitelist = getPageQueryBypassWhitelist()
|
||||
const listingQueryWhitelist = getListingQueryDirectories()
|
||||
let interceptData = {}
|
||||
|
||||
|
||||
if (listingQueryWhitelist.includes(parent)) {
|
||||
interceptData = await datocmsListingQueryIntercept(query)
|
||||
interceptData = await datocmsListingQueryIntercept(query)
|
||||
} else if (pageQueryWhitelist.includes(parent)) {
|
||||
interceptData = await datocmsPageQueryIntercept(query)
|
||||
} else {
|
||||
let errorText = 'Unable to intercept datocms query. No viable JSON alternative was defined.'
|
||||
interceptData = {error: errorText}
|
||||
interceptData = {error: 'Unable to intercept datocms query. No viable JSON alternative was defined.'}
|
||||
}
|
||||
|
||||
return interceptData
|
||||
}
|
||||
|
||||
function getPageQueryBypassWhitelist() : string[] {
|
||||
function getPageQueryBypassWhitelist(): string[] {
|
||||
//-----stuff that has been (to the best of my knowledge) completley pulled over into JSON
|
||||
//-----does not include iterative stuff like blog posts or events etc...
|
||||
//-----this may only end up being scaffolding.
|
||||
|
||||
let whitelist : string [] = []
|
||||
let whitelist: string [] = []
|
||||
|
||||
whitelist.push('aboutPage')
|
||||
whitelist.push('careersPage')
|
||||
@ -65,10 +63,10 @@ function getPageQueryBypassWhitelist() : string[] {
|
||||
return whitelist
|
||||
}
|
||||
|
||||
function getListingQueryDirectories() : string[] {
|
||||
function getListingQueryDirectories(): string[] {
|
||||
//-----whitelist the listying types of content...
|
||||
|
||||
let directories : string[] = []
|
||||
let directories: string[] = []
|
||||
|
||||
directories.push('allEvents')
|
||||
directories.push('allPositions')
|
||||
@ -79,21 +77,19 @@ function getListingQueryDirectories() : string[] {
|
||||
return directories
|
||||
}
|
||||
|
||||
function pluckFirstParentFromQuery(query : any) : string {
|
||||
|
||||
function pluckFirstParentFromQuery(query: any): string {
|
||||
//-----only plucks the FIRST parent, if there are multiple parents in the query they will be ignored.
|
||||
let parent : string = ((query.replace(/[\W_]+/g," ")).trim()).split(" ")[0]
|
||||
let parent: string = ((query.replace(/[\W_]+/g," ")).trim()).split(" ")[0]
|
||||
return parent
|
||||
}
|
||||
|
||||
async function datocmsPageQueryIntercept(query : any) : Promise<any> {
|
||||
|
||||
let parent : string = pluckFirstParentFromQuery(query)
|
||||
let jsonDirectory : string = path.join(process.cwd(), 'json/site_content')
|
||||
let jsonPath : string = jsonDirectory + '/' + parent + '.json'
|
||||
let fileRawContents : string = ''
|
||||
let fileJson : any = {}
|
||||
let jsonData : any = {}
|
||||
async function datocmsPageQueryIntercept(query: any): Promise<any> {
|
||||
let parent: string = pluckFirstParentFromQuery(query)
|
||||
let jsonDirectory: string = path.join(process.cwd(), 'json/site_content')
|
||||
let jsonPath: string = jsonDirectory + '/' + parent + '.json'
|
||||
let fileRawContents: string = ''
|
||||
let fileJson: any = {}
|
||||
let jsonData: any = {}
|
||||
|
||||
try {
|
||||
fileRawContents = await fs.readFile(jsonPath, 'utf8')
|
||||
@ -108,10 +104,9 @@ async function datocmsPageQueryIntercept(query : any) : Promise<any> {
|
||||
return jsonData
|
||||
}
|
||||
|
||||
async function datocmsListingQueryIntercept(query : any) : Promise<any> {
|
||||
|
||||
let parent : string = pluckFirstParentFromQuery(query)
|
||||
let jsonData : any = {}
|
||||
async function datocmsListingQueryIntercept(query: any): Promise<any> {
|
||||
let parent: string = pluckFirstParentFromQuery(query)
|
||||
let jsonData: any = {}
|
||||
|
||||
switch(parent) {
|
||||
case 'allBlogPosts':
|
||||
@ -152,8 +147,7 @@ async function datocmsListingQueryIntercept(query : any) : Promise<any> {
|
||||
}
|
||||
|
||||
//-----json traversal
|
||||
function jsonFilePathIsValid(filePath : string) {
|
||||
|
||||
function jsonFilePathIsValid(filePath: string) {
|
||||
if (filePath.startsWith("_")) {
|
||||
return false
|
||||
}
|
||||
@ -165,8 +159,7 @@ function jsonFilePathIsValid(filePath : string) {
|
||||
return true
|
||||
}
|
||||
|
||||
function jsonNodeExists(jsonData : any, node : string) {
|
||||
|
||||
function jsonNodeExists(jsonData: any, node: string) {
|
||||
if (node in jsonData === true) {
|
||||
return true
|
||||
}
|
||||
@ -174,11 +167,11 @@ function jsonNodeExists(jsonData : any, node : string) {
|
||||
return false
|
||||
}
|
||||
|
||||
function jsonNodesExist(jsonData : any, nodes : any) {
|
||||
function jsonNodesExist(jsonData: any, nodes: any) {
|
||||
//-----permit basic validation of the json we are trying to spit out by checking for existence of first order nodes
|
||||
|
||||
let node = ''
|
||||
let nodeGroup : any = []
|
||||
let nodeGroup: any = []
|
||||
let nodeGroupNode = ''
|
||||
let nodeGroupValid = false
|
||||
|
||||
@ -212,9 +205,9 @@ function jsonNodesExist(jsonData : any, nodes : any) {
|
||||
return true
|
||||
}
|
||||
|
||||
export async function getJsonItemsFromDirectory(jsonDirectory : string, pluckerFunction : any, validationNodes : any[]) : Promise<any> {
|
||||
export async function getJsonItemsFromDirectory(jsonDirectory: string, pluckerFunction: any, validationNodes: any[]): Promise<any> {
|
||||
let jsonFiles = await fs.readdir(jsonDirectory)
|
||||
let returnJson : any[] = []
|
||||
let returnJson: any[] = []
|
||||
|
||||
for (let i = 0; i < jsonFiles.length; i++) {
|
||||
let jsonFile = jsonFiles[i]
|
||||
@ -254,10 +247,9 @@ function getBlogJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/blogPost')
|
||||
}
|
||||
|
||||
function pluckBlogPostData(json : any) {
|
||||
|
||||
//let plucked : BlogPostRecord = {}
|
||||
let plucked : any = {}
|
||||
function pluckBlogPostData(json: any) {
|
||||
//let plucked: BlogPostRecord = {}
|
||||
let plucked: any = {}
|
||||
|
||||
if('data' in json){
|
||||
if('blogPost' in json.data) {
|
||||
@ -268,8 +260,7 @@ function pluckBlogPostData(json : any) {
|
||||
return plucked
|
||||
}
|
||||
|
||||
function getRequiedBlogPostNodes() : any[] {
|
||||
|
||||
function getRequiedBlogPostNodes(): any[] {
|
||||
let nodes = []
|
||||
let contentNodes = []
|
||||
|
||||
@ -285,10 +276,10 @@ function getRequiedBlogPostNodes() : any[] {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function forceBlogPostsJsonSlugIntegrity(json : any[]) {
|
||||
function forceBlogPostsJsonSlugIntegrity(json: any[]) {
|
||||
//-----this is used to force the blog post slug to match that of its parent file name.
|
||||
|
||||
let returnJson : any[] = []
|
||||
let returnJson: any[] = []
|
||||
|
||||
for (let i = 0; i < json.length; i++) {
|
||||
let blogPost = json[i]
|
||||
@ -301,16 +292,14 @@ function forceBlogPostsJsonSlugIntegrity(json : any[]) {
|
||||
return returnJson
|
||||
}
|
||||
|
||||
function sortBlogPostsJsonByDate(json : any[]) {
|
||||
|
||||
let sortedJson : any[] = json.slice().sort((a : any, b: any) => datocmsDateToIng(b.date) - datocmsDateToIng(a.date))
|
||||
function sortBlogPostsJsonByDate(json: any[]) {
|
||||
let sortedJson: any[] = json.slice().sort((a: any, b: any) => datocmsDateToIng(b.date) - datocmsDateToIng(a.date))
|
||||
|
||||
return sortedJson
|
||||
}
|
||||
|
||||
function getFakePaginationData(json : any) {
|
||||
|
||||
let pagination : any = {}
|
||||
function getFakePaginationData(json: any) {
|
||||
let pagination: any = {}
|
||||
let totalPosts = json.length
|
||||
|
||||
pagination.nextPage = null
|
||||
@ -328,14 +317,13 @@ async function getAllBlogPostsJson() {
|
||||
let blogPosts = await getJsonItemsFromDirectory(jsonDirectory, pluckBlogPostData, validationNodes)
|
||||
let pagination = getFakePaginationData(blogPosts)
|
||||
let processedBlogPosts = forceBlogPostsJsonSlugIntegrity(blogPosts)
|
||||
let sortedBlogPosts : any[] = sortBlogPostsJsonByDate(processedBlogPosts)
|
||||
let sortedBlogPosts: any[] = sortBlogPostsJsonByDate(processedBlogPosts)
|
||||
let allBlogPostsJson = {pagination: pagination, data: sortedBlogPosts}
|
||||
|
||||
return allBlogPostsJson
|
||||
}
|
||||
|
||||
export async function getAllBlogPostsSlugsFromSource() {
|
||||
|
||||
let jsonDirectory = getBlogJsonDirectoryPath()
|
||||
let jsonFiles = await fs.readdir(jsonDirectory)
|
||||
let slugs = []
|
||||
@ -344,7 +332,7 @@ export async function getAllBlogPostsSlugsFromSource() {
|
||||
let jsonFile = jsonFiles[i]
|
||||
if (jsonFilePathIsValid(jsonFile) === true) {
|
||||
let slug = path.parse(jsonFile).name
|
||||
let node = {slug : slug}
|
||||
let node = {slug: slug}
|
||||
slugs.push(node)
|
||||
}
|
||||
}
|
||||
@ -352,8 +340,8 @@ export async function getAllBlogPostsSlugsFromSource() {
|
||||
return slugs
|
||||
}
|
||||
|
||||
export async function getAllBlogPostsFromSource(datocmsFilters : any) : Promise<any> {
|
||||
let allBlogPostsFromSource : any = {}
|
||||
export async function getAllBlogPostsFromSource(datocmsFilters: any): Promise<any> {
|
||||
let allBlogPostsFromSource: any = {}
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
allBlogPostsFromSource = await getAllBlogPostsJson()
|
||||
@ -364,12 +352,11 @@ export async function getAllBlogPostsFromSource(datocmsFilters : any) : Promise<
|
||||
return allBlogPostsFromSource
|
||||
}
|
||||
|
||||
async function getSingleBlogPostJsonBySlug(slug : string) : Promise<any> {
|
||||
|
||||
async function getSingleBlogPostJsonBySlug(slug: string): Promise<any> {
|
||||
let jsonDirectory = getBlogJsonDirectoryPath()
|
||||
let jsonFile = slug + '.json'
|
||||
let jsonPath = path.join(jsonDirectory, jsonFile)
|
||||
let blogPost : any = {}
|
||||
let blogPost: any = {}
|
||||
|
||||
try {
|
||||
let fileRawContents = await fs.readFile(jsonPath, 'utf8')
|
||||
@ -386,8 +373,8 @@ async function getSingleBlogPostJsonBySlug(slug : string) : Promise<any> {
|
||||
return blogPost
|
||||
}
|
||||
|
||||
export async function getSingleBlogPostBySlugFromSource(slug : string) : Promise<any> {
|
||||
let blogPostJson : any = {}
|
||||
export async function getSingleBlogPostBySlugFromSource(slug: string): Promise<any> {
|
||||
let blogPostJson: any = {}
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
try {
|
||||
@ -404,8 +391,7 @@ export async function getSingleBlogPostBySlugFromSource(slug : string) : Promise
|
||||
return blogPostJson
|
||||
}
|
||||
|
||||
function getBlogPostCategorySlugs(blogPostJson : any) {
|
||||
|
||||
function getBlogPostCategorySlugs(blogPostJson: any) {
|
||||
let categories = []
|
||||
|
||||
try {
|
||||
@ -423,15 +409,14 @@ function getBlogPostCategorySlugs(blogPostJson : any) {
|
||||
return categories
|
||||
}
|
||||
|
||||
export async function getRelatedBlogPosts(blogPostJson : any, matchCount : number) : Promise<any> {
|
||||
|
||||
export async function getRelatedBlogPosts(blogPostJson: any, matchCount: number): Promise<any> {
|
||||
let relatedBlogPosts = []
|
||||
let reservedSlugs = []
|
||||
let matchedCount = 0
|
||||
let matchCategories = getBlogPostCategorySlugs(blogPostJson)
|
||||
let blogPosts = await getAllBlogPostsJson()
|
||||
let blogPostsData = blogPosts.data
|
||||
let candidateBlogPost : any = {}
|
||||
let candidateBlogPost: any = {}
|
||||
let candidateBlogPostSlug = ''
|
||||
let slug = blogPostJson.slug
|
||||
|
||||
@ -482,8 +467,7 @@ function getBlogCategoriesJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/category')
|
||||
}
|
||||
|
||||
function pluckBlogCategoriesData(json : any) {
|
||||
|
||||
function pluckBlogCategoriesData(json: any) {
|
||||
let plucked = {}
|
||||
|
||||
if('data' in json){
|
||||
@ -496,7 +480,6 @@ function pluckBlogCategoriesData(json : any) {
|
||||
}
|
||||
|
||||
function getRequiedBlogBlogCategoryNodes() {
|
||||
|
||||
let nodes = []
|
||||
|
||||
nodes.push('slug')
|
||||
@ -505,16 +488,16 @@ function getRequiedBlogBlogCategoryNodes() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
export async function getAllBlogCategoriesJson() : Promise<any[]> {
|
||||
export async function getAllBlogCategoriesJson(): Promise<any[]> {
|
||||
let jsonDirectory = getBlogCategoriesJsonDirectoryPath()
|
||||
let validationNodes = getRequiedBlogBlogCategoryNodes()
|
||||
let allBlogCategoriesJson : any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckBlogCategoriesData, validationNodes)
|
||||
let allBlogCategoriesJson: any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckBlogCategoriesData, validationNodes)
|
||||
|
||||
return allBlogCategoriesJson
|
||||
}
|
||||
|
||||
export async function getAllBlogPostsCategoriesFromSource() : Promise<any> {
|
||||
let allBlogPostsCategoriesFromSource : any[] = []
|
||||
export async function getAllBlogPostsCategoriesFromSource(): Promise<any> {
|
||||
let allBlogPostsCategoriesFromSource: any[] = []
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
allBlogPostsCategoriesFromSource = await getAllBlogCategoriesJson()
|
||||
@ -532,8 +515,7 @@ function getEventsJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/event')
|
||||
}
|
||||
|
||||
function pluckEventData(json : any) {
|
||||
|
||||
function pluckEventData(json: any) {
|
||||
let plucked = {}
|
||||
|
||||
if('data' in json){
|
||||
@ -546,7 +528,6 @@ function pluckEventData(json : any) {
|
||||
}
|
||||
|
||||
function getRequiedEventNodes() {
|
||||
|
||||
let nodes = []
|
||||
|
||||
nodes.push('title')
|
||||
@ -557,18 +538,17 @@ function getRequiedEventNodes() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function sortEventsJsonByStartDate(json : any[]) {
|
||||
|
||||
let sortedJson : any[] = json.slice().sort((a : any, b: any) => datocmsDateToIng(b.eventStartdate) - datocmsDateToIng(a.eventStartdate))
|
||||
function sortEventsJsonByStartDate(json: any[]) {
|
||||
let sortedJson: any[] = json.slice().sort((a: any, b: any) => datocmsDateToIng(b.eventStartdate) - datocmsDateToIng(a.eventStartdate))
|
||||
|
||||
return sortedJson
|
||||
}
|
||||
|
||||
async function getAllEventsJson() : Promise<any> {
|
||||
async function getAllEventsJson(): Promise<any> {
|
||||
let jsonDirectory = getEventsJsonDirectoryPath()
|
||||
let validationNodes = getRequiedEventNodes()
|
||||
let events : any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckEventData, validationNodes)
|
||||
let sortedEvents : any[] = sortEventsJsonByStartDate(events)
|
||||
let events: any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckEventData, validationNodes)
|
||||
let sortedEvents: any[] = sortEventsJsonByStartDate(events)
|
||||
let allEventsJson = {allEvents: sortedEvents}
|
||||
|
||||
return allEventsJson
|
||||
@ -579,8 +559,7 @@ function getPositionsJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/position')
|
||||
}
|
||||
|
||||
function pluckPositionData(json : any) {
|
||||
|
||||
function pluckPositionData(json: any) {
|
||||
let plucked = {}
|
||||
|
||||
if('data' in json){
|
||||
@ -593,7 +572,6 @@ function pluckPositionData(json : any) {
|
||||
}
|
||||
|
||||
function getRequiedPositionNodes() {
|
||||
|
||||
let nodes = []
|
||||
|
||||
nodes.push('id')
|
||||
@ -603,18 +581,17 @@ function getRequiedPositionNodes() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function sortPositionsJsonById(json : any[]) {
|
||||
|
||||
let sortedJson : any[] = json.slice().sort((a : any, b: any) => parseInt(a.id) - parseInt(b.id))
|
||||
function sortPositionsJsonById(json: any[]) {
|
||||
let sortedJson: any[] = json.slice().sort((a: any, b: any) => parseInt(a.id) - parseInt(b.id))
|
||||
|
||||
return sortedJson
|
||||
}
|
||||
|
||||
async function getAllPositionsJson() : Promise<any> {
|
||||
async function getAllPositionsJson(): Promise<any> {
|
||||
let jsonDirectory = getPositionsJsonDirectoryPath()
|
||||
let validationNodes = getRequiedPositionNodes()
|
||||
let positions : any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckPositionData, validationNodes)
|
||||
let sortedPositions : any[] = sortPositionsJsonById(positions)
|
||||
let positions: any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckPositionData, validationNodes)
|
||||
let sortedPositions: any[] = sortPositionsJsonById(positions)
|
||||
let allPositionsJson = {allPositions: sortedPositions}
|
||||
|
||||
return allPositionsJson
|
||||
@ -625,8 +602,7 @@ function getPressReleasesJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/pressRelease')
|
||||
}
|
||||
|
||||
function pluckPressReleaseData(json : any) {
|
||||
|
||||
function pluckPressReleaseData(json: any) {
|
||||
let plucked = {}
|
||||
|
||||
if('data' in json){
|
||||
@ -639,7 +615,6 @@ function pluckPressReleaseData(json : any) {
|
||||
}
|
||||
|
||||
function getRequiedPressReleaseNodes() {
|
||||
|
||||
let nodes = []
|
||||
|
||||
nodes.push('id')
|
||||
@ -650,18 +625,17 @@ function getRequiedPressReleaseNodes() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function sortPressReleasesJsonByDate(json : any[]) {
|
||||
|
||||
let sortedJson : any[] = json.slice().sort((a : any, b: any) => datocmsDateToIng(b.date) - datocmsDateToIng(a.date))
|
||||
function sortPressReleasesJsonByDate(json: any[]) {
|
||||
let sortedJson: any[] = json.slice().sort((a: any, b: any) => datocmsDateToIng(b.date) - datocmsDateToIng(a.date))
|
||||
|
||||
return sortedJson
|
||||
}
|
||||
|
||||
async function getAllPressReleasesJson() : Promise<any> {
|
||||
async function getAllPressReleasesJson(): Promise<any> {
|
||||
let jsonDirectory = getPressReleasesJsonDirectoryPath()
|
||||
let validationNodes = getRequiedPressReleaseNodes()
|
||||
let pressReleases : any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckPressReleaseData, validationNodes)
|
||||
let sortedPressReleases : any[] = sortPressReleasesJsonByDate(pressReleases)
|
||||
let pressReleases: any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckPressReleaseData, validationNodes)
|
||||
let sortedPressReleases: any[] = sortPressReleasesJsonByDate(pressReleases)
|
||||
let allPressReleasesJson = {allPressReleases: sortedPressReleases}
|
||||
|
||||
return allPressReleasesJson
|
||||
@ -672,8 +646,7 @@ function getTeamsJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/team')
|
||||
}
|
||||
|
||||
function pluckTeamData(json : any) {
|
||||
|
||||
function pluckTeamData(json: any) {
|
||||
let plucked = {}
|
||||
|
||||
if('data' in json){
|
||||
@ -686,7 +659,6 @@ function pluckTeamData(json : any) {
|
||||
}
|
||||
|
||||
function getRequiedTeamNodes() {
|
||||
|
||||
let nodes = []
|
||||
|
||||
nodes.push('id')
|
||||
@ -695,18 +667,17 @@ function getRequiedTeamNodes() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function sortTeamsJsonById(json : any[]) {
|
||||
|
||||
let sortedJson : any[] = json.slice().sort((a : any, b: any) => parseInt(a.id) - parseInt(b.id))
|
||||
function sortTeamsJsonById(json: any[]) {
|
||||
let sortedJson: any[] = json.slice().sort((a: any, b: any) => parseInt(a.id) - parseInt(b.id))
|
||||
|
||||
return sortedJson
|
||||
}
|
||||
|
||||
async function getAllTeamsJson() : Promise<any> {
|
||||
async function getAllTeamsJson(): Promise<any> {
|
||||
let jsonDirectory = getTeamsJsonDirectoryPath()
|
||||
let validationNodes = getRequiedTeamNodes()
|
||||
let teams : any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckTeamData, validationNodes)
|
||||
let sortedTeams : any[] = sortTeamsJsonById(teams)
|
||||
let teams: any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckTeamData, validationNodes)
|
||||
let sortedTeams: any[] = sortTeamsJsonById(teams)
|
||||
let allTeamsJson = {allTeams: sortedTeams}
|
||||
|
||||
return allTeamsJson
|
||||
@ -717,8 +688,7 @@ function getTestimonialsJsonDirectoryPath() {
|
||||
return path.join(process.cwd(), 'json/site_content/testimonial')
|
||||
}
|
||||
|
||||
function pluckTestimonialData(json : any) {
|
||||
|
||||
function pluckTestimonialData(json: any) {
|
||||
let plucked = {}
|
||||
|
||||
if('data' in json){
|
||||
@ -731,7 +701,6 @@ function pluckTestimonialData(json : any) {
|
||||
}
|
||||
|
||||
function getRequiedTestimonialNodes() {
|
||||
|
||||
let nodes = []
|
||||
|
||||
nodes.push('id')
|
||||
@ -742,18 +711,17 @@ function getRequiedTestimonialNodes() {
|
||||
return nodes
|
||||
}
|
||||
|
||||
function sortTestimonialsJsonById(json : any[]) {
|
||||
|
||||
let sortedJson : any[] = json.slice().sort((a : any, b: any) => parseInt(a.id) - parseInt(b.id))
|
||||
function sortTestimonialsJsonById(json: any[]) {
|
||||
let sortedJson: any[] = json.slice().sort((a: any, b: any) => parseInt(a.id) - parseInt(b.id))
|
||||
|
||||
return sortedJson
|
||||
}
|
||||
|
||||
async function getAllTestimonialsJson() : Promise<any> {
|
||||
async function getAllTestimonialsJson(): Promise<any> {
|
||||
let jsonDirectory = getTestimonialsJsonDirectoryPath()
|
||||
let validationNodes = getRequiedTestimonialNodes()
|
||||
let testimonials : any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckTestimonialData, validationNodes)
|
||||
let sortedTestimonals : any[] = sortTestimonialsJsonById(testimonials)
|
||||
let testimonials: any[] = await getJsonItemsFromDirectory(jsonDirectory, pluckTestimonialData, validationNodes)
|
||||
let sortedTestimonals: any[] = sortTestimonialsJsonById(testimonials)
|
||||
let allTestimonialsJson = {allTestimonials: sortedTestimonals}
|
||||
|
||||
return allTestimonialsJson
|
||||
|
||||
@ -13,7 +13,6 @@ interface props {
|
||||
}
|
||||
|
||||
export async function request({ query, variables, preview }: props) {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
@ -43,14 +42,14 @@ export async function request({ query, variables, preview }: props) {
|
||||
*/
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
let interceptData : any = await datocmsQueryIntercept(query)
|
||||
let interceptData: any = await datocmsQueryIntercept(query)
|
||||
|
||||
if (interceptData.error) {
|
||||
console.error(interceptData.error)
|
||||
interceptData = {}
|
||||
return interceptData
|
||||
} else {
|
||||
return interceptData
|
||||
return interceptData
|
||||
}
|
||||
} else {
|
||||
let endpoint = 'https://graphql.datocms.com'
|
||||
@ -78,4 +77,4 @@ export async function request({ query, variables, preview }: props) {
|
||||
return body.data
|
||||
}
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -36,7 +36,6 @@ import { HeaderQuery } from '~/lib/cms/queries/header'
|
||||
import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
@ -48,7 +47,7 @@ export const getStaticProps = async () => {
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -10,13 +10,12 @@ import {
|
||||
getAllBlogPostsSlugsFromSource,
|
||||
getSingleBlogPostBySlugFromSource,
|
||||
getRelatedBlogPosts
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//import cms from 'lib/cms'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
|
||||
import {
|
||||
GetStaticPaths,
|
||||
GetStaticProps,
|
||||
@ -62,13 +61,12 @@ const BlogPost = ({
|
||||
}
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//const posts = await getAllBlogPostsSlugs()
|
||||
|
||||
async function postsSlugsJsonFromSource() : Promise<any> {
|
||||
let postsSlugsJson : any = {}
|
||||
async function postsSlugsJsonFromSource(): Promise<any> {
|
||||
let postsSlugsJson: any = {}
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
postsSlugsJson = await getAllBlogPostsSlugsFromSource()
|
||||
} else {
|
||||
@ -76,8 +74,8 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
}
|
||||
|
||||
return postsSlugsJson
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const posts = await postsSlugsJsonFromSource()
|
||||
|
||||
/*
|
||||
@ -86,7 +84,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
||||
}))
|
||||
*/
|
||||
|
||||
const paths = posts?.map((post : any) => ({
|
||||
const paths = posts?.map((post: any) => ({
|
||||
params: { slug: post.slug as string }
|
||||
}))
|
||||
|
||||
@ -104,7 +102,7 @@ export const getStaticProps: GetStaticProps = async (
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
//const post = await (await cms().SingleBlogPost({ slug })).blogPost
|
||||
const post : any = await getSingleBlogPostBySlugFromSource(slug)
|
||||
const post: any = await getSingleBlogPostBySlugFromSource(slug)
|
||||
|
||||
/*
|
||||
const allBlogPosts = await serverGetBlogPosts({
|
||||
@ -119,37 +117,34 @@ export const getStaticProps: GetStaticProps = async (
|
||||
)
|
||||
*/
|
||||
|
||||
async function getRelatedBlogPostsFromSource() : Promise<any> {
|
||||
async function getRelatedBlogPostsFromSource(): Promise<any> {
|
||||
|
||||
let relatedBlogPosts = {}
|
||||
let relatedBlogPosts = {}
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
|
||||
try {
|
||||
relatedBlogPosts = await getRelatedBlogPosts(post, 3)
|
||||
} catch (e) {
|
||||
console.log('Failed pull related blog posts.')
|
||||
console.log('The attempt resulted in the following error:')
|
||||
console.log(e)
|
||||
//console.log('Failed pull related blog posts.')
|
||||
//console.log('The attempt resulted in the following error:')
|
||||
//console.log(e)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
let allBlogPosts = await serverGetBlogPosts({
|
||||
const allBlogPosts = await serverGetBlogPosts({
|
||||
filterSlugs: [slug],
|
||||
step: 100
|
||||
})
|
||||
|
||||
let relatedPosts = allBlogPosts.data.filter((p) =>
|
||||
const relatedPosts = allBlogPosts.data.filter((p) =>
|
||||
p.category.some((c) =>
|
||||
post?.category.some((postCategory : any) => c.slug === postCategory.slug)
|
||||
post?.category.some((postCategory: any) => c.slug === postCategory.slug)
|
||||
)
|
||||
)
|
||||
|
||||
relatedBlogPosts = relatedPosts
|
||||
}
|
||||
}
|
||||
|
||||
return relatedBlogPosts
|
||||
return relatedBlogPosts
|
||||
}
|
||||
|
||||
const relatedPosts = await getRelatedBlogPostsFromSource()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { PageLayout } from 'components/layout/page'
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
/*
|
||||
import {
|
||||
@ -10,16 +10,14 @@ import {
|
||||
} from 'lib/blog'
|
||||
*/
|
||||
|
||||
import {
|
||||
getBlogPosts
|
||||
} from 'lib/blog'
|
||||
import { getBlogPosts } from 'lib/blog'
|
||||
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} 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 +38,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,7 +50,6 @@ 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
|
||||
@ -67,10 +64,10 @@ const BlogIndexPage = ({
|
||||
))}
|
||||
</Fragment>
|
||||
</PostsGrid>
|
||||
</PageLayout>
|
||||
</PageLayout>
|
||||
)
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
} else {
|
||||
} 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
|
||||
@ -99,7 +96,10 @@ const BlogIndexPage = ({
|
||||
} = useInfiniteQuery(
|
||||
['posts', router.locale, c, s],
|
||||
({ pageParam, queryKey }) => {
|
||||
const matchingCat = getMatchingCategory(categories, queryKey[2] as string)
|
||||
const matchingCat = getMatchingCategory(
|
||||
categories,
|
||||
queryKey[2] as string
|
||||
)
|
||||
return clientGetBlogPosts({
|
||||
page: pageParam,
|
||||
category: matchingCat?.id ?? undefined,
|
||||
@ -118,25 +118,23 @@ const BlogIndexPage = ({
|
||||
}
|
||||
)
|
||||
|
||||
function queriedPostsHasResults(queriedPosts : any) {
|
||||
|
||||
function queriedPostsHasResults(queriedPosts: any) {
|
||||
if ('pages' in queriedPosts === true) {
|
||||
if (0 in queriedPosts.pages === true) {
|
||||
if ('pagination' in queriedPosts.pages[0]) {
|
||||
if ('total' in queriedPosts.pages[0].pagination) {
|
||||
if (queriedPosts.pages[0].pagination.total > 0) {
|
||||
return true;
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
//const hasResults = !!queriedPosts?.pages[0]?.data?.length
|
||||
const hasResults = queriedPostsHasResults(queriedPosts);
|
||||
const hasResults = queriedPostsHasResults(queriedPosts)
|
||||
|
||||
return (
|
||||
<PageLayout footerData={footerData} headerData={headerData}>
|
||||
@ -170,7 +168,7 @@ const BlogIndexPage = ({
|
||||
</nav>
|
||||
|
||||
<SearchBar
|
||||
search={!Array.isArray(s) ? s : ''}
|
||||
search={!Array.isArray(s) ? s: ''}
|
||||
onChange={handleSearch}
|
||||
key={'search'}
|
||||
/>
|
||||
@ -185,10 +183,10 @@ const BlogIndexPage = ({
|
||||
))}
|
||||
</Fragment>
|
||||
))
|
||||
) : (
|
||||
): (
|
||||
<p>No results.</p>
|
||||
)
|
||||
) : (
|
||||
): (
|
||||
<p>Loading...</p>
|
||||
)}
|
||||
</PostsGrid>
|
||||
@ -202,7 +200,7 @@ const BlogIndexPage = ({
|
||||
</PageLayout>
|
||||
)
|
||||
//===== /\ FINISH ORIGINAL PRE NEXT_PUBLIC_DATOCMS_BYPASS CODE /\ ===================================
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const clientGetBlogPosts = async ({
|
||||
@ -239,22 +237,21 @@ const clientGetBlogPosts = async ({
|
||||
}
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
function getInitialBlogPostsDataProp(allBlogPosts : any) {
|
||||
|
||||
let initialBlogPostsDataProp : any[] = [];
|
||||
function getInitialBlogPostsDataProp(allBlogPosts: any) {
|
||||
|
||||
let initialBlogPostsDataProp: any[] = []
|
||||
|
||||
if (process.env.NEXT_PUBLIC_DATOCMS_BYPASS_TYPE === 'local_json') {
|
||||
//-----no pagination
|
||||
initialBlogPostsDataProp = allBlogPosts.data;
|
||||
initialBlogPostsDataProp = allBlogPosts.data
|
||||
} else {
|
||||
//-----old setup had pagination but it wasn't working...
|
||||
initialBlogPostsDataProp = allBlogPosts.data.slice(0, 9);
|
||||
initialBlogPostsDataProp = allBlogPosts.data.slice(0, 9)
|
||||
}
|
||||
|
||||
return initialBlogPostsDataProp;
|
||||
return initialBlogPostsDataProp
|
||||
}
|
||||
|
||||
/*
|
||||
@ -262,12 +259,12 @@ export const getStaticProps = async () => {
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
serverGetBlogPostsCategories()
|
||||
])
|
||||
*/
|
||||
*/
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
])
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -36,9 +36,8 @@ import { HeaderQuery } from '~/lib/cms/queries/header'
|
||||
import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
@ -48,7 +47,7 @@ export const getStaticProps = async () => {
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -35,9 +35,8 @@ import {
|
||||
import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
@ -47,7 +46,7 @@ export const getStaticProps = async () => {
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -34,9 +34,8 @@ import {
|
||||
import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
@ -46,7 +45,7 @@ export const getStaticProps = async () => {
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -31,9 +31,8 @@ import {
|
||||
import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
@ -43,7 +42,7 @@ export const getStaticProps = async () => {
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
import {
|
||||
getAllBlogPostsFromSource,
|
||||
getAllBlogPostsCategoriesFromSource
|
||||
} from 'lib/datocms-bypass'
|
||||
} from 'lib/datocms-bypass'
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
@ -39,9 +39,8 @@ import {
|
||||
import { request } from '../lib/datocms'
|
||||
|
||||
export const getStaticProps = async () => {
|
||||
|
||||
//===== \/ START NEXT_PUBLIC_DATOCMS_BYPASS \/ ====================================================
|
||||
|
||||
|
||||
/*
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
serverGetBlogPosts({ page: 1 }),
|
||||
@ -51,7 +50,7 @@ export const getStaticProps = async () => {
|
||||
|
||||
const [allBlogPosts, categories] = await Promise.all([
|
||||
getAllBlogPostsFromSource({ page: 1 }),
|
||||
getAllBlogPostsCategoriesFromSource(),
|
||||
getAllBlogPostsCategoriesFromSource()
|
||||
])
|
||||
|
||||
//===== /\ FINISH NEXT_PUBLIC_DATOCMS_BYPASS /\ ====================================================
|
||||
|
||||
Loading…
Reference in New Issue
Block a user