File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,11 +233,11 @@ export async function getStaticProps({
233233 const { content } = matter ( c ) ;
234234
235235 if ( post . urlContent . includes ( 'next.js' ) && content ) {
236- allContent = content . replaceAll (
237- ' <a href=" /docs' ,
236+ allContent = content . replace (
237+ new RegExp ( / < a h r e f \= " \ /d o c s / g ) ,
238238 '<a href="https://nextjs.org/docs'
239239 ) ;
240- allContent = allContent . replaceAll ( ' .md' , '' ) ;
240+ allContent = allContent . replace ( new RegExp ( / .m d / g ) , '' ) ;
241241 } else {
242242 if ( ! content ) {
243243 console . log ( 'missing content after matter' ) ;
Original file line number Diff line number Diff line change @@ -494,13 +494,11 @@ export async function getServerSideProps({
494494 const { content } = matter ( c ) ;
495495
496496 if ( post . urlContent . includes ( 'next.js' ) && content ) {
497- console . log ( 'TYPE:' , typeof content ) ;
498- console . log ( content ) ;
499- allContent = content . replaceAll (
500- '<a href="/docs' ,
497+ allContent = content . replace (
498+ new RegExp ( / < a h r e f \= " \/ d o c s / g) ,
501499 '<a href="https://nextjs.org/docs'
502500 ) ;
503- allContent = allContent . replaceAll ( ' .md' , '' ) ;
501+ allContent = allContent . replace ( new RegExp ( / .m d / g ) , '' ) ;
504502 } else {
505503 if ( ! content ) {
506504 console . log ( 'missing content after matter' ) ;
@@ -525,6 +523,7 @@ export async function getServerSideProps({
525523 } else {
526524 source = null ;
527525 }
526+
528527 return {
529528 props : {
530529 site,
Original file line number Diff line number Diff line change @@ -149,11 +149,11 @@ export async function getServerSideProps({
149149 const { content } = matter ( c ) ;
150150
151151 if ( post . urlContent . includes ( 'next.js' ) && content ) {
152- allContent = content . replaceAll (
153- ' <a href=" /docs' ,
152+ allContent = content . replace (
153+ new RegExp ( / < a h r e f \= " \ /d o c s / g ) ,
154154 '<a href="https://nextjs.org/docs'
155155 ) ;
156- allContent = allContent . replaceAll ( ' .md' , '' ) ;
156+ allContent = allContent . replace ( new RegExp ( / .m d / g ) , '' ) ;
157157 } else {
158158 if ( ! content ) {
159159 console . log ( 'missing content after matter' ) ;
@@ -178,6 +178,7 @@ export async function getServerSideProps({
178178 } else {
179179 source = null ;
180180 }
181+
181182 return {
182183 props : {
183184 site,
You can’t perform that action at this time.
0 commit comments