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
I have a large collection of heterogenous content that has properties (or the lack thereof) that I wish to display in a manner similar to any other subpage (think: custom collections, tag pages).
As a concrete example, one use case is to collect and paginate blog posts which do not have tags.
Actual behaviour
I've tried a number of different routes to get a collection defined by a subset of resources. While I can't remember them all, I'll highlight a few.
By clearing the partial path of any page using the template local paginate, I got to a situation where when trying to render my page navigation, it couldn't find the paging "methods":
undefined local variable or method `prev_page' ...
This predates middleman-blog 4, is highly manual, and doesn't work.
I also tried creating a subset of articles that were untagged and feeding them as a local into a template located at <blog_root>/tags/untagged.html.erb, but while the local was set, the Extension's determination of what the current articles were (i.e. all articles) overrode my local setting, and so I could see the first page_size untagged articles, for the num_pages determined by the blog as a whole.
In my case, what I finally got to work was monkey-patching the tags method as follows:
But there are a lot of additional subsets of data that I'd like to mess around with (short posts, posts with no explicit title, posts with no category data) that I'd also like to generate views for.
A workaround I considered is to have an explicit "untagged" tag, but that screws with my display logic and would require going back and retroactively curating a large amount of content. Further, it doesn't address the general case, where for instance I might desire a category 'short' determined by the subset of all blog posts under 140 characters. (This is actually something I plan to do.)
My feature suggestion, since it seems to be a theme for a lot of the requests/bugs I've noticed in the past three hours of reading issues, is to allow the generation of arbitrary collections of blog resources via either string or proc, contrasted with the current method of string only.
Additional information
Ruby version: 2.4.1
Middleman version: 4.2.1
Middleman Blog version: 4.0.2
OS version: macOS 10.13.1
The text was updated successfully, but these errors were encountered:
ℹ️ This issue is stale because it has been open for more than 90 days with no activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
~Feature request
Expected behaviour
I have a large collection of heterogenous content that has properties (or the lack thereof) that I wish to display in a manner similar to any other subpage (think: custom collections, tag pages).
As a concrete example, one use case is to collect and paginate blog posts which do not have tags.
Actual behaviour
I've tried a number of different routes to get a collection defined by a subset of resources. While I can't remember them all, I'll highlight a few.
#233 (comment)
Attempting this method ended up very hackish (duplication of parameters between the blog definition and the subsequent block). Notably, though, I couldn't even get this to compile - when
middleman build
got to my proxy, it would gripe about me trying to provide a localpaginate
variable (see: https://github.com/middleman/middleman/blob/master/middleman-core/lib/middleman-core/template_renderer.rb#L137).By clearing the partial path of any page using the template local
paginate
, I got to a situation where when trying to render my page navigation, it couldn't find the paging "methods":undefined local variable or method `prev_page'
...I saw this as well: #177 (comment)
This predates middleman-blog 4, is highly manual, and doesn't work.
I also tried creating a subset of articles that were untagged and feeding them as a local into a template located at
<blog_root>/tags/untagged.html.erb
, but while the local was set, the Extension's determination of what the current articles were (i.e. all articles) overrode my local setting, and so I could see the firstpage_size
untagged articles, for thenum_pages
determined by the blog as a whole.In my case, what I finally got to work was monkey-patching the
tags
method as follows:But there are a lot of additional subsets of data that I'd like to mess around with (short posts, posts with no explicit title, posts with no category data) that I'd also like to generate views for.
A workaround I considered is to have an explicit "untagged" tag, but that screws with my display logic and would require going back and retroactively curating a large amount of content. Further, it doesn't address the general case, where for instance I might desire a category 'short' determined by the subset of all blog posts under 140 characters. (This is actually something I plan to do.)
My feature suggestion, since it seems to be a theme for a lot of the requests/bugs I've noticed in the past three hours of reading issues, is to allow the generation of arbitrary collections of blog resources via either string or proc, contrasted with the current method of string only.
Additional information
The text was updated successfully, but these errors were encountered: