File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ import { ArrowDownCircle } from 'lucide-react';
1616import { Tabs , Tab } from "../../components/Tabs" ;
1717import { serialize } from "next-mdx-remote/serialize" ;
1818
19+ declare global {
20+ interface Window {
21+ adsbygoogle : unknown [ ] ;
22+ }
23+ }
24+
1925type PostData = {
2026 id : string ;
2127 title : string ;
@@ -63,6 +69,14 @@ export default function Post({ postData, relatedPosts }: InferGetStaticPropsType
6369 const visibleRelatedPosts = relatedPosts . slice ( 0 , visibleRelatedCount ) ;
6470 const hasMoreRelated = visibleRelatedCount < relatedPosts . length ;
6571
72+ useEffect ( ( ) => {
73+ try {
74+ ( window . adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
75+ } catch ( e ) {
76+ console . error ( "Adsbygoogle push error:" , e ) ;
77+ }
78+ } , [ ] ) ;
79+
6680 useEffect ( ( ) => {
6781 const el = scrollRef . current ;
6882 if ( el && el . scrollHeight > el . clientHeight ) {
You can’t perform that action at this time.
0 commit comments