Sam's Blog Plugin

(Sam Saffron) #1

Location: GitHub - SamSaffron/blog: blog plugin for Discourse

Author: @sam

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

See also:

Transfer WordPress to Discourse
Help! wordpress to discourse
Transfer WordPress to Discourse
(Eero Heikkinen) #2

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 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.

(Sam Saffron) #3

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 Embedding Discourse in Static Sites - Evil Trout's Blog and our blog is WordPress. Discourse is rainbows all the way down, more than one way to do everything.

(Caue Rego) #4

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 - 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:

(Jens Maier) #5

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.

(Alec Joy) #6

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:

(Kane York) #7

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

(Jeff Atwood) #8

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

(Mike Mayer) #9


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, per the advice here: Rails subdomains for localhost/development - Manuel van Rijn

and thus adjusted the line in your plugin like this:

::BLOG_HOST = Rails.env.development? ? “” : “
::BLOG_DISCOURSE = Rails.env.development? ? “” : “

but no dice.

thanks for sharing this plugin. it is quite helpful.

(Sam Saffron) #10

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']

(Caue Rego) #11

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

(Erlend Sogge Heggen) #12

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