amphora-html 6.0.0-8 → 6.0.1-dev.0
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/lib/media.js +1 -7
- package/lib/render.js +3 -3
- package/package.json +1 -1
package/lib/media.js
CHANGED
|
@@ -274,19 +274,13 @@ function getStyleFiles(state) {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
// check for clay linked font files
|
|
277
|
+
// check for clay compile linked? clay compile font files?
|
|
278
278
|
const defaultFontPath = path.join(assetDir, 'css', '_linked-fonts._default.css');
|
|
279
279
|
const siteFontPath = path.join(assetDir, 'css', `_linked-fonts.${siteStyleguide}.css`);
|
|
280
280
|
|
|
281
|
-
// check for inlined font files
|
|
282
|
-
const defaultInlinedFontPath = path.join(assetDir, 'css', '_inlined-fonts._default.css');
|
|
283
|
-
const siteInlinedFontPath = path.join(assetDir, 'css', `_inlined-fonts.${siteStyleguide}.css`);
|
|
284
|
-
|
|
285
281
|
// add any default and site font css
|
|
286
282
|
cssFilePaths.push(defaultFontPath);
|
|
287
283
|
cssFilePaths.push(siteFontPath);
|
|
288
|
-
cssFilePaths.push(defaultInlinedFontPath);
|
|
289
|
-
cssFilePaths.push(siteInlinedFontPath);
|
|
290
284
|
|
|
291
285
|
return cssFilePaths
|
|
292
286
|
.filter(files.fileExists)
|
package/lib/render.js
CHANGED
|
@@ -40,7 +40,7 @@ function applyRenderHooks(ref, data, locals) {
|
|
|
40
40
|
* @param {Object} locals
|
|
41
41
|
* @returns {Function}
|
|
42
42
|
*/
|
|
43
|
-
function applyPostRenderHooks(ref, locals) {
|
|
43
|
+
function applyPostRenderHooks(ref, locals, res, self) {
|
|
44
44
|
return (html) => {
|
|
45
45
|
|
|
46
46
|
// skip postRender hooks in edit mode
|
|
@@ -50,7 +50,7 @@ function applyPostRenderHooks(ref, locals) {
|
|
|
50
50
|
|
|
51
51
|
return setup.plugins.filter((plugin) => plugin.postRender)
|
|
52
52
|
.reduce((val, plugin) => {
|
|
53
|
-
return plugin.postRender(ref, html, locals);
|
|
53
|
+
return plugin.postRender(ref, html, locals, res, self);
|
|
54
54
|
}, html);
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -148,7 +148,7 @@ function render(data, meta, res) {
|
|
|
148
148
|
return applyRenderHooks(state._layoutRef || state.self, data, state.locals)
|
|
149
149
|
.then(makeHtml(state))
|
|
150
150
|
.then(mediaService.injectScriptsAndStyles(state))
|
|
151
|
-
.then(applyPostRenderHooks(state._layoutRef || state.self, state.locals))
|
|
151
|
+
.then(applyPostRenderHooks(state._layoutRef || state.self, state.locals, res, meta._ref))
|
|
152
152
|
.then(result => {
|
|
153
153
|
res.type('text/html');
|
|
154
154
|
res.send(result);
|