Sam's Blog Plugin

Location: GitHub - SamSaffron/blog: samsaffron.com blog plugin for Discourse

Author: @sam

A Rails engine implemented as a Discourse plugin, provides a completely different front end to Discourse.

See also: http://samsaffron.com

11 Likes

This is great! Both as a provider of blog functionality and as a comprehensive sample plugin to learn from. Are you planning to use this eventually on discourse.org as well or sticking to WordPress?


When precompiling assets I got this error:

undefined method `recurrence' for Blog::UpdateStackOverflow:Class (NoMethodError)

I’m new to rails, but it seems related to sidekiq. Maybe I need to fix my installation somehow? Don’t need twitter or stackoverflow integration on my blog though, so removed the jobs for now and everything seems to work fine.

1 Like

Ooops I forgot to push my latest fix :frowning: pushed now.

We are still going to keep WordPress for our blog, WordPress integration is strategic for us, we want to make sure it keeps working, to do so we need to dogfood.

I use this mechanism, @eviltrout uses static embedding http://eviltrout.com/2014/01/22/embedding-discourse.html and our blog is WordPress. Discourse is rainbows all the way down, more than one way to do everything.

5 Likes

Does this means the plugin could actually replace wordpress? I’m already using discourse as a blog even without this, and I can see how a plugin could bring some benefits, but I’d prefer if it would “completely change the front end” of a category only. Or make it a subpage “/blog” and associate it with a category, to make it even better!

PS: Right now I can’t go to http://samsaffron.com/ - says ERR_NAME_NOT_RESOLVED and it looks down for everyone! :open_mouth:

What does this even means?! :confused:

Although, with a few more tweaks, I could eventually even drop my squarespace as a main site in favor of discourse (even without a community) if that’s what you meant! :stuck_out_tongue:

Mostly it means that there’s no static documentation and you must sleuth through the codebase to figure out for yourself how to get things done. :wink: Luckily, there are way more rainbows than leprechauns, so it’s quite easy to maneuver through the existing code, derive samples from it and adapt them to suit your needs.

1 Like

Heh, I thought this was more of a generic “turn your discourse install in to a blog” plugin.

Turns out this particular plugin is pretty specific to Sam’s blog.

Guess I better get coding before someone comes to my site and starts asking questions about Stack Overflow :wink:

5 Likes

“Of the various possibilities I was expecting… … … …that was not one of them.”

1 Like

Two Sams… well that could make for interesting possibilities… some fascinating arguments… :wink:

3 Likes

@sam,

this may be a boneheaded question, but what was your workflow for developing this plugin? do you run it in your local environment?

since the blog engine routes to a subdomain different from the discourse app, i’m unclear how to replicate this in a local environment. i tried using http://lvh.me/, per the advice here: http://manuel.manuelles.nl/blog/2015/05/19/rails-subdomains-for-localhost-development/

and thus adjusted the line in your plugin like this:

::BLOG_HOST = Rails.env.development? ? “blog.lvh.me” : “blog.xxxx.com”
::BLOG_DISCOURSE = Rails.env.development? ? “intercourse.lvh.me” : “intercourse.xxxxx.com”

but no dice.

thanks for sharing this plugin. it is quite helpful.

definitely lots of dice here :slight_smile: key to getting this working is placing NGINX in front, works perfect for me. If you must you can alway launch it with ENV and then avoid this … eg:

BLOG=1 bin/thin start

And then amend internals to allow for a check against ENV['BLOG']

1 Like

This is probably nothing new for most folks there, but just wanted to point out to a very similar plugin:

https://meta.discourse.org/t/curated-home-plugin/23474?u=cawas

That plugin has not been working for a very long time now. I updated the topic accordingly.

3 Likes