@@ -49,6 +49,28 @@ export function getContentFileBySlug(type: string, slug: string) {
49
49
// Check if file exists
50
50
if ( ! fs . existsSync ( filePath ) ) {
51
51
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
+
52
74
// If direct path doesn't exist, try course-specific directory for modules
53
75
if ( type . includes ( 'courses/' ) ) {
54
76
const courseSlug = type . split ( '/' ) [ 1 ] ;
@@ -199,6 +221,12 @@ export function getModuleFiles(courseSlug: string) {
199
221
if ( ! fs . existsSync ( moduleDirectory ) ) {
200
222
console . log ( `Module directory not found: ${ moduleDirectory } ` ) ;
201
223
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
+
202
230
// Last resort - if the courseSlug is 'quick-start-with-golang', try 'quick-start-with-golang-modules'
203
231
if ( courseSlug === 'quick-start-with-golang' ) {
204
232
return getModuleFiles ( 'quick-start-with-golang-modules' ) ;
0 commit comments