-
-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Labels
Status: ProposalRequest for commentsRequest for comments
Description
Hi, all. When I tried to generate the articles which are in the child hierarchy of the current page, I found there is no such articles attribute in the page object. But page.next and page.previous has. So I turned to the inelegant solution which is to get the articles by something similar to page.next.previous.articles.
I wonder if I could add the articles attribute to the page in encodePage.ts and create a PR for that. Like:
function encodePage(page: Page, summary: Summary): EncodedPage {
...
if (article) {
...
const prevArticle = summary.getPrevArticle(article);
if (prevArticle) {
result.previous = encodeSummaryArticle(prevArticle);
}
// add articles to result
const articles = article
.getArticles()
.map((article) => encodeSummaryArticle(article))
.toJS();
if (articles.length > 0) {
result.articles = articles;
}
}
...
return result;
}And what is the reason of the articles property is in the page.next but not in the page? When will page.next.articles be used?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: ProposalRequest for commentsRequest for comments