It lets you select a category to display with different styles than the rest of your forum. It defaults to the ‘blog’ category, but that can be changed in the settings. It selects an image that has the added class header-image and creates a full-width splash image out of it. The styles are quite basic. They mostly involve removing things. At the moment it’s removing the reply controls. That could be changed. It adds the class blog-post to the body tag for topics of the chosen category. Custom styles can be added by beginning them with the .blog-post selector.
This isn’t quite ready for production. The styles need a few tweaks. Pull requests and suggestions are welcome.
is it possible to copy a post to post to your blog category? I mean, could i simply add a post from other categories to this post category. I want to use this as a place to show the best posts.
The way it works now you would have to change the category of your post to whatever you have set as the blog-post category. Maybe it could be setup to work with tags instead, so that if you tagged a post as ‘featured’ it would get this view.
I’ve rewritten this so that it integrates with the Discourse plugin system, instead of just overwriting things with a bunch of jquery. I think it should be safe to use it now.
A data-max-height attribute can be added to the background image to set the image’s max height. The image and the layout scale for mobile.
I’m not going to be maintaining the curated-home-plugin. I really like it and think that something similar to it would be useful for creating a user-friendly homepage, but I think it will be too difficult and time-consuming for me to maintain. If anyone is interested in using the code, I have a version of it up on github. It is working, but has a few issues.
The blog-post plugin is much simpler. It really just adds a body-class for topics in a chosen category so that that category can be styled separately from the other topics. If it breaks with a Discourse update I should be able to easily fix it.
You then need to create that category in Discourse. Go to ‘Categories>New Category’ and create your chosen blog category. In my case I created the category ‘discover nanaimo’. Don’t use an old category where you have posts with replies - at the moment blog posts can’t handle replies.
To create a header image, upload an image (ideally at the start of your post) and give it the class header-image you can also set the image’s max height by giving it a data-max-height attribute. Here’s an example of how to create a header image:
It’s hard to find the time to update it. I think it’s a lot more straightforward to use WordPress for this kind of thing, with the wp-discourse plugin.
Thanks to @smartwatchme for funding it, I’ve rewritten this plugin to work with recent versions of Discourse. It now allows you to configure which groups should be allowed to create ‘blog-posts’ (admins and moderators by default), and which categories blog posts should be allowed to be created in. Members of allowed groups can convert the first post in a topic from a regular post into a blog post by clicking on the ‘book’ icon that’s found in the hidden (’…’) post menu buttons.
The plugin converts the first image in a post into a header image. It also adds the css class blog-post to the body tag, and the css class blog-post-content to the cooked content of the first post. It comes with some default styles that are used to style the first post in a topic separately from the replies.
The default styles can be disabled by deselecting the plugin setting the blog post use default styles setting. This could be useful if you only wish to use the header-image functionality of the plugin. See the plugin’s README for more details.
Pull requests, especially for improving the default styles, are welcome.