This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dns from 'dns'; | |
import { NextApiRequest, NextApiResponse } from 'next'; | |
import { getGatedContentItem } from '../../lib/getGatedContentItem'; | |
export default async function exit(req: NextApiRequest, res: NextApiResponse) { | |
// Handle potential Googlebot request. | |
const isGoogleAgent = req.headers?.['user-agent']?.toLowerCase()?.includes('googlebot') ?? false; | |
if (isGoogleAgent) { | |
let verified = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GetStaticProps } from 'next'; | |
import { useRouter } from 'next/router'; | |
import Head from 'next/head'; | |
import React, { useEffect, useState } from 'react'; | |
import { getGatedContentItem } from '../lib/getGatedContentItem'; | |
export type ContentItemModel = { | |
date: string; | |
freeContent: string; | |
gatedContent: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import KontentSmartLink from '@kentico/kontent-smart-link'; | |
import '@kentico/kontent-smart-link/dist/kontent-smart-link.styles.css'; | |
export default function Layout({ children }) { | |
useEffect(() => { | |
const kontentSmartLink = KontentSmartLink.initialize({ | |
queryParam: 'preview-mode' | |
}); | |
return () => { | |
kontentSmartLink.destroy(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unhandled native exception occurred at 0x7FF6CEBE72DF (SkyrimSE.exe+C072DF) on thread 6716! | |
FrameworkName: NetScriptFramework | |
FrameworkVersion: 9 | |
FrameworkArchitecture: x64 | |
GameLibrary: SkyrimSE | |
GameLibraryVersion: 13 | |
ApplicationName: SkyrimSE.exe | |
ApplicationVersion: 1.5.97.0 | |
VersionInfo: Successfully loaded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextApiRequest, NextApiResponse } from 'next'; | |
import ArticleService from '../../services/ArticleService'; | |
export default async (req: NextApiRequest, res: NextApiResponse) => { | |
// Validate the incoming request. | |
if (req.query.secret !== process.env.PREVIEW_TOKEN) { | |
return res.status(401).json({ message: 'Invalid token' }); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Execute server-side data fetching. | |
*/ | |
export const getStaticProps: GetStaticProps = async ({ params, preview }) => { | |
console.log(`Loading article content, preview mode is ${!!preview}`); | |
const slug = params?.slug as string; | |
const service = new ArticleService(preview ?? false); | |
const article = await service.getArticle(slug); |