if I want to access the contents property of a page in another page, I get the whole rendered html output. I couldn't find a way to get just the parsed (markdown) content of the related content file because the convert function of this plugin overrides the data.contents property (:144).
Is there a possibility to backup the original content? For example by adding a line above like this:
data.contentsOrig = new Buffer(data.contents);
data.contents = new Buffer(str);
use case
template (handlebars with a little helper function to get the first item of a collection):
Another use case is that I need all contents of this collection inside a specific json structure to make it available as an "api endpoint".
...
obj.forEach((item) => {
const current = {
title: item.title,
contents: item.contents // Buffer including the complete page
contents: item.contentsOrig // Buffer including just the content of the parsed md file
};
...
});
Maybe there is another way to solve this issue or maybe I overlooked something...
Hi,
if I want to access the
contents
property of a page in another page, I get the whole rendered html output. I couldn't find a way to get just the parsed (markdown) content of the related content file because theconvert
function of this plugin overrides thedata.contents
property (:144).Is there a possibility to backup the original content? For example by adding a line above like this:
use case
template (handlebars with a little helper function to get the first item of a collection):
partial:
This sometimes renders the page inside the page because
{{{item.contents}}}
returns something like this:instead of
Another use case is that I need all contents of this collection inside a specific json structure to make it available as an "api endpoint".
Maybe there is another way to solve this issue or maybe I overlooked something...
Thanks in advance!