You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for writing this great plugin. It is one of my core components in my build chain for a while.
Do you think it is worth to generate a pagination even when the collection is empty? Currently, this plugin does not add any new pages when there are no files inside the specified collection.
This is useful when the collection is generated dynamically. Suppose 3 collections (a, b, c) are prepared in advance, then we scan through all files and add them into one of them, We expect this plugin to generate 'a/page/1.html', 'b/page/1.html', 'c/page/1.html'. This plugin currently does not generate pages for empty collection, so the file existence becomes inconsistent.
I am currently modifying(add) your code like below in my project. I'm not sure about the potential demerits, but it would be nice if this feature is officially supported.
...
if(collection.length==0&&pageOptions.emptyPage){varparams={name: '0',index: 0,num: 1}// Generate the page data.varpage=extend(pageOptions.pageMetadata,{template: pageOptions.emptyPage.template,layout: pageOptions.emptyPage.layout,contents: pageOptions.emptyPage.pageContents||Buffer.from(''),path: interpolate(pageOptions.path,params),})if(!pageOptions.noPageOne){files[page.path]=page}if(pageOptions.first){// Extend the "first page" over the top of "page one".page=extend(page,{path: interpolate(pageOptions.first,params)})files[page.path]=page}}
...
In addition, solving issue #25 makes this feature even more useful, I guess.
The text was updated successfully, but these errors were encountered:
@yamavol Happy to accept a PR supporting "empty/missing collections". I expect it should be a flag, when enabled, would render the first page with no entries.
Thank you for writing this great plugin. It is one of my core components in my build chain for a while.
Do you think it is worth to generate a pagination even when the collection is empty? Currently, this plugin does not add any new pages when there are no files inside the specified collection.
This is useful when the collection is generated dynamically. Suppose 3 collections (a, b, c) are prepared in advance, then we scan through all files and add them into one of them, We expect this plugin to generate 'a/page/1.html', 'b/page/1.html', 'c/page/1.html'. This plugin currently does not generate pages for empty collection, so the file existence becomes inconsistent.
I am currently modifying(add) your code like below in my project. I'm not sure about the potential demerits, but it would be nice if this feature is officially supported.
In addition, solving issue #25 makes this feature even more useful, I guess.
The text was updated successfully, but these errors were encountered: