@icarusmx/creta 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/creta.js +5 -1
- package/package.json +1 -1
package/bin/creta.js
CHANGED
|
@@ -279,6 +279,9 @@ async function unstuckProject(level) {
|
|
|
279
279
|
if (fs.existsSync(layoutPath)) {
|
|
280
280
|
let layoutContent = fs.readFileSync(layoutPath, 'utf8')
|
|
281
281
|
layoutContent = applyLayoutModifications(layoutContent, level)
|
|
282
|
+
// Replace placeholders in layout
|
|
283
|
+
layoutContent = layoutContent.replace(/\{\{STUDENT_NAME\}\}/g, studentName)
|
|
284
|
+
layoutContent = layoutContent.replace(/\{\{PROJECT_NAME\}\}/g, `${studentName.toLowerCase().replace(/\s+/g, '-')}-portafolio`)
|
|
282
285
|
fs.writeFileSync(layoutPath, layoutContent)
|
|
283
286
|
console.log(`✅ Actualizado: src/routes/+layout.svelte`)
|
|
284
287
|
}
|
|
@@ -286,8 +289,9 @@ async function unstuckProject(level) {
|
|
|
286
289
|
if (fs.existsSync(pagePath)) {
|
|
287
290
|
let pageContent = fs.readFileSync(pagePath, 'utf8')
|
|
288
291
|
pageContent = applyPageModifications(pageContent, level)
|
|
289
|
-
// Replace
|
|
292
|
+
// Replace placeholders in page
|
|
290
293
|
pageContent = pageContent.replace(/\{\{STUDENT_NAME\}\}/g, studentName)
|
|
294
|
+
pageContent = pageContent.replace(/\{\{PROJECT_NAME\}\}/g, `${studentName.toLowerCase().replace(/\s+/g, '-')}-portafolio`)
|
|
291
295
|
fs.writeFileSync(pagePath, pageContent)
|
|
292
296
|
console.log(`✅ Actualizado: src/routes/+page.svelte`)
|
|
293
297
|
}
|