From 6a1ca9a7cf1528f8c70113e86d1bfd05590a3938 Mon Sep 17 00:00:00 2001 From: Jonny Gerig Meyer Date: Mon, 22 Apr 2024 13:53:24 -0400 Subject: [PATCH] Do not overwrite ctx.emit method --- CHANGELOG.md | 5 +++++ lib/prepareContext.js | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b938d0a0..ccbad265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Herman Changelog +## 6.0.1: 2024-04-22 + +- 🐛 BUGFIX: Do not overwrite `ctx.emit` method - + [#423](https://github.com/oddbird/sassdoc-theme-herman/issues/423) + ## 6.0.0: 2024-03-01 ### 🚀 New Features diff --git a/lib/prepareContext.js b/lib/prepareContext.js index 5d0c8716..d7339327 100644 --- a/lib/prepareContext.js +++ b/lib/prepareContext.js @@ -35,15 +35,19 @@ module.exports = (ctx) => { ctx.groups = ctx.groups || { undefined: 'General' }; - // Apply default values for display. + // Apply default values. ctx.display = Object.assign({}, def.display, ctx.display); - - if (!ctx.description) { - def.descriptionPath = './README.md'; + /* istanbul ignore else */ + if (!ctx.sort) { + ctx.sort = def.sort; + } + if (!ctx.herman) { + ctx.herman = def.herman; + } + if (!ctx.description && !ctx.descriptionPath) { + ctx.descriptionPath = './README.md'; } - // Extend top-level context keys. - ctx = Object.assign({}, def, ctx); // eslint-disable-line no-param-reassign /* istanbul ignore else */ if (!ctx.herman.sass?.sassOptions) { ctx.herman.sass = {