@o2vend/theme-cli 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o2vend/theme-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "O2VEND Theme Development CLI - Standalone tool for local theme development",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -132,7 +132,7 @@ async function renderWithLayout(liquid, templatePath, context, themePath) {
132
132
  const layoutMatch = templateContent.match(/\{%\s*layout\s+['"](.+?)['"]\s*%\}/);
133
133
 
134
134
  if (layoutMatch) {
135
- const layoutPath = layoutMatch[1]; // e.g., 'theme'
135
+ const layoutPath = layoutMatch[1]; // e.g., 'layout/theme' or 'theme'
136
136
 
137
137
  // Remove layout directive from template
138
138
  const contentWithoutLayout = templateContent.replace(/\{%\s*layout\s+['"](.+?)['"]\s*%\}/, '').trim();
@@ -146,7 +146,9 @@ async function renderWithLayout(liquid, templatePath, context, themePath) {
146
146
  content: renderedContent
147
147
  };
148
148
 
149
- const layoutFile = path.join(themePath, 'layout', `${layoutPath}.liquid`);
149
+ // layoutPath already includes the full path from theme root (e.g., 'layout/theme')
150
+ // So we just need to add .liquid extension
151
+ const layoutFile = path.join(themePath, `${layoutPath}.liquid`);
150
152
  if (fs.existsSync(layoutFile)) {
151
153
  const layoutContent = fs.readFileSync(layoutFile, 'utf-8');
152
154
  return await liquid.parseAndRender(layoutContent, layoutContext);