Skip to content

Commit

Permalink
fix(jsonify): default to empty string on empty content (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke-zhang-04 authored Jan 17, 2023
1 parent e3ddd1e commit 63dca03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(faviconPlugin, { destination: 'dist' });
eleventyConfig.addPlugin(tocPlugin, {ul:true, tags: ['h1','h2', 'h3', 'h4', 'h5', 'h6']});
eleventyConfig.addFilter('jsonify', function (variable) {
return JSON.stringify(variable);
return JSON.stringify(variable) || '""';
});

return {
Expand Down

0 comments on commit 63dca03

Please sign in to comment.