@zeropress/build-core 0.2.0 → 0.2.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
|
@@ -2,6 +2,8 @@ import { SlotResolver } from './slot-resolver.js';
|
|
|
2
2
|
import { VariableResolver } from './variable-resolver.js';
|
|
3
3
|
import { ControlFlowRenderer } from './control-flow-renderer.js';
|
|
4
4
|
|
|
5
|
+
const CONTENT_SLOT_PLACEHOLDER = '__ZEROPRESS_CONTENT_SLOT_4F30E5A44C1D__';
|
|
6
|
+
|
|
5
7
|
export class ZeroPressEngine {
|
|
6
8
|
constructor() {
|
|
7
9
|
this.slotResolver = new SlotResolver();
|
|
@@ -34,8 +36,8 @@ export class ZeroPressEngine {
|
|
|
34
36
|
|
|
35
37
|
const renderData = this.combineRenderData(data, context);
|
|
36
38
|
const renderedContent = this.renderTemplate(template, renderData);
|
|
37
|
-
const layoutWithSlots = this.slotResolver.resolve(layout, this.themePackage.partials,
|
|
38
|
-
return this.renderTemplate(layoutWithSlots, renderData);
|
|
39
|
+
const layoutWithSlots = this.slotResolver.resolve(layout, this.themePackage.partials, CONTENT_SLOT_PLACEHOLDER);
|
|
40
|
+
return this.renderTemplate(layoutWithSlots, renderData).replaceAll(CONTENT_SLOT_PLACEHOLDER, renderedContent);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
combineRenderData(data, context) {
|