make content type available in all views

85 views
Skip to first unread message

Remo

unread,
Feb 10, 2015, 4:17:49 AM2/10/15
to sculpi...@googlegroups.com
Didn't get any feedback on IRC and thought that I could try to revive this google group ;-)

I'm trying to add a list of all post categories in a sidebar on all pages of my sculpin site.

Using the skeleton as a base, I'd like to embed a list of all categories in this spot:
https://github.com/sculpin/sculpin-blog-skeleton/blob/master/source/_views/default.html#L82

I can easily do that in index.html by adding "use posts post_categories", but how am I supposed to do the same in my posts? Is there a way to make that list of categories available everywhere?

Thanks!

Beau Simensen

unread,
Feb 10, 2015, 9:23:30 AM2/10/15
to sculpi...@googlegroups.com
On Tuesday, February 10, 2015 at 3:17:49 AM UTC-6, Remo wrote:
Didn't get any feedback on IRC and thought that I could try to revive this google group ;-)

Indeed, only one other person has ever bothered to post here. :) Welcome!

Also, the IRC channel is usually somewhat quick to respond but it must be a timezone thing. I've come back after you've left twice now. :) 

 
I'm trying to add a list of all post categories in a sidebar on all pages of my sculpin site.

Using the skeleton as a base, I'd like to embed a list of all categories in this spot:
https://github.com/sculpin/sculpin-blog-skeleton/blob/master/source/_views/default.html#L82

I can easily do that in index.html by adding "use posts post_categories", but how am I supposed to do the same in my posts? Is there a way to make that list of categories available everywhere?

I've been kicking around the idea of default/site-wide data providers but it has not yet been implemented. The downside of these would be that if you make a change to any post it would cause the entire site to rebuild. Right now I'm going to great lengths to try and be more efficient with the rebuild process (for --watch) and only rebuild things that actually changed.

Even as-is, updating any one post requires rebuilding any of the post pages that "use posts". If you were to use posts globally (or anything that depends on them them like the taxonomy data providers) it would require building the entire site.

There is no easy way to do this now. As a short-term fix you could consider creating a tag or category index page (in addition to the one already there) but have it output JSON instead of HTML/XML. You could then include it via javascript in your layout and load it dynamically that way. Maybe not the best solution but it would hopefully get you a little closer to your ideal layout.

Remo

unread,
Feb 15, 2015, 9:09:46 AM2/15/15
to sculpi...@googlegroups.com
Didn't get any feedback on IRC and thought that I could try to revive this google group ;-)

Indeed, only one other person has ever bothered to post here. :) Welcome!

Also, the IRC channel is usually somewhat quick to respond but it must be a timezone thing. I've come back after you've left twice now. :) 

Yeah, never liked time zones very much.. Who came up with the idea that earth should rotate.. Anyway, thanks for checking the google group ;-)
 

I'm trying to add a list of all post categories in a sidebar on all pages of my sculpin site.

Using the skeleton as a base, I'd like to embed a list of all categories in this spot:
https://github.com/sculpin/sculpin-blog-skeleton/blob/master/source/_views/default.html#L82

I can easily do that in index.html by adding "use posts post_categories", but how am I supposed to do the same in my posts? Is there a way to make that list of categories available everywhere?

I've been kicking around the idea of default/site-wide data providers but it has not yet been implemented. The downside of these would be that if you make a change to any post it would cause the entire site to rebuild. Right now I'm going to great lengths to try and be more efficient with the rebuild process (for --watch) and only rebuild things that actually changed.

Even as-is, updating any one post requires rebuilding any of the post pages that "use posts". If you were to use posts globally (or anything that depends on them them like the taxonomy data providers) it would require building the entire site.

There is no easy way to do this now. As a short-term fix you could consider creating a tag or category index page (in addition to the one already there) but have it output JSON instead of HTML/XML. You could then include it via javascript in your layout and load it dynamically that way. Maybe not the best solution but it would hopefully get you a little closer to your ideal layout.

I see your point about the incremental rebuilding. It wouldn't be a big problem for me as the ability to create the layout I want is more important than waiting a tad little bit longer.

What if you'd build each page on demand instead of regenerating the whole site on each change?

I'm not really a big fan of embedded such links using JavaScript. I think I'd rather hard-code those categories. I'll fiddle around a bit and see where I get!

NdK

unread,
Feb 23, 2016, 5:05:02 AM2/23/16
to Sculpin Users

Indeed, only one other person has ever bothered to post here. :) Welcome!
Well, I tried to open a new thread, but failed twice...
Reply all
Reply to author
Forward
0 new messages