@@ -49,6 +49,28 @@ export function getContentFileBySlug(type: string, slug: string) {
4949 // Check if file exists
5050 if ( ! fs . existsSync ( filePath ) ) {
5151 console . log ( `File exists: false` ) ;
52+
53+ // Special case for quick-start-with-golang-modules
54+ if ( type === 'courses/quick-start-with-golang-modules' ) {
55+ const directPath = path . join ( contentDirectory , 'courses/quick-start-with-golang-modules' , `${ slug } .mdx` ) ;
56+ console . log ( `Trying quick-start-with-golang-modules direct path: ${ directPath } ` ) ;
57+
58+ if ( fs . existsSync ( directPath ) ) {
59+ console . log ( `Found file at direct path: ${ directPath } ` ) ;
60+ const fileContents = fs . readFileSync ( directPath , 'utf8' ) ;
61+ const { data, content } = matter ( fileContents ) ;
62+
63+ console . log ( `File exists: true` ) ;
64+ console . log ( `File size: ${ fileContents . length } bytes` ) ;
65+
66+ return {
67+ frontmatter : data as Frontmatter ,
68+ slug,
69+ content,
70+ } ;
71+ }
72+ }
73+
5274 // If direct path doesn't exist, try course-specific directory for modules
5375 if ( type . includes ( 'courses/' ) ) {
5476 const courseSlug = type . split ( '/' ) [ 1 ] ;
@@ -199,6 +221,12 @@ export function getModuleFiles(courseSlug: string) {
199221 if ( ! fs . existsSync ( moduleDirectory ) ) {
200222 console . log ( `Module directory not found: ${ moduleDirectory } ` ) ;
201223
224+ // Special case for quick-start-with-golang-modules
225+ if ( courseSlug === 'quick-start-with-golang-modules' ) {
226+ console . log ( `Using special case for quick-start-with-golang-modules` ) ;
227+ return getModuleFiles ( 'quick-start-with-golang-modules' ) ;
228+ }
229+
202230 // Last resort - if the courseSlug is 'quick-start-with-golang', try 'quick-start-with-golang-modules'
203231 if ( courseSlug === 'quick-start-with-golang' ) {
204232 return getModuleFiles ( 'quick-start-with-golang-modules' ) ;
0 commit comments