Blog de Landing Pages ✈️

Working, but no longer maintained [July 2022]

You can now use the Landing Pages Plugin to run a blog with Discourse :tada:. Set a category to be your blog, and the first post of every topic in that category will have its own blog page, and appear on a blog post list page.

Screen Shot 2021-05-13 at 5.04.18 PM

This project has been a joint effort between @meghna and myself. All of the nice design work is hers. If you like the design of this blog make sure to check our her Discourse Themes. Any bugs you find in the functionality are mine :slight_smile:

Get the code

GitHub-Mark-64px Landing Pages Plugin
GitHub-Mark-64px Blog Landing Pages
GitHub-Mark-64px Blog Landing Theme

See it in action

try.thepavilion.io/blog

Please note that all content on the blog and displayed in screenshots in this post is from The Conversation, and used under the Creative Commons License used by that site. All content belongs to its original authors and is used for demonstration purposes only.

How to set it up

Follow these steps in order

  1. Install the Landing Pages Plugin (how to install a plugin in Discourse).
  2. Install the Blog Landing Theme, (how to install a theme in Discourse).
  3. Set up the Blog Landing Pages as your landing pages repository.
  4. In the Landing Pages Administration UI change the category of the “Blog” page to whatever category you want to use to run your blog.

That’s it! The first post of every topic in that category will now be posts on your blog :slight_smile:

Restrict posting to contributors

You’ll probably want to restrict posting in that category to a group of blog contributors. If you’re not sure how to do that, here’s a quick guide

  1. Create a user group, e.g. “Contributors”, by going to /groups and clicking “New Group”
  2. Add users to the group (“Add Members” in the top right)
  3. In the blog category “Security” settings remove the “Create” permission from “Everyone”, and add your Contributors group

Now only your contributors can post on your blog, but everyone can comment on posts.

What makes this different from other blog solutions?

There’s some great existing solutions to running a blog inside or alongside Discourse, including

This is a bit different as it’s an entirely seperate set of pages that are not part of the Discourse client app, but it still uses the same server. This gives you a few advantages over running a seperate blog (e.g. on Wordpress), or using a Discourse category directly (e.g. with a theme component), including

  • You can create content and let users reply in Discourse, but have a dedicated blog environment for reading and sharing. Readers of your blog will feel like they’re reading a blog instead of a forum post.
  • You have a single user account system (Discourse’s)
  • You can use Discourse groups to restrict access to the blog
  • You can make Discourse posts appear as comments on your blog with no additional setup
  • You get nice responsive blog theme out of the box
  • You only have to set up, and pay for, one server
  • The blog doesn’t need to load your forum to work, so it can load quickly
  • You can easily keep your blog pages (and theme) in version control
  • You get a nicely formatted New Blog Post notification email (see below)
  • You can easily manage it alongside any other landing pages you need using the Landing Pages Plugin.

However, while the Blog Landing Pages have some clear advantages, they aren’t going to be the best community blog solution for everyone. You should test out the different solutions and see which one works for you.

What does it mean to “Subscribe” to the blog?

If you’re logged in and click the “Subscribe” button you’ll see a modal (if you’re logged out you’ll be redirected to Discourse login)

If you’ve checked the box next to “Subscribe to [site name]'s posts” and submitted the form, you’ll automatically be set to “Watching First Post” for the blog category. That means you’ll get an email notification every time there’s a new post in that category, like you would if you were subscribed to a blog!

You can also set your notifications for the blog category to “Watching First Post” in the normal way (in Discourse) and that will have the same effect. “Watching” the category (were you get an email for every post, including replies), also counts as being subscribed.

The email notifications for a blog category are a bit special. Firstly, unless you made the post yourself, you’ll always get an email notification if you’re subscribed, even if you visited the site recently. Secondly, they’re designed to look like a blog post email

We plan to allow a site admin to edit the blog post email html in the Landing Pages Administration UI in the near future. Note that if you’re “Watching” the blog category, only the email notification for the first post in each topic will be different. Notifications for replies will look like normal Discourse notifications.

Beyond blogging

You can use the functionality described above to create a set of landing pages for any content, like how Wordpress is a blogging engine that you can use for displaying other (non-blog) types of content. You could use a category to manage a set of products, places or people, and automatically get both a landing page and a discussion topic for the content, just by making a single post in Discourse.

Any developer who knows a bit of Ruby on Rails could achieve any of those additional use cases using this system. You don’t need to know how Discourse works. As these blog pages are part of the landing pages plugin, you also get access to all the existing templates in that plugin, including contact forms, header, footer, topic lists and user profiles. You can read more about these templates, and others, in the plugin documentation.

41 curtidas

Looks great, good job! Is the Blog Landing Theme a requirement? Would it be possibel in that case to have it as a component (since those who already have another/customized theme might want to stick with it)?

2 curtidas

The Blog Landing Pages, and the functionality in the Landing Pages Plugin they rely on, are both designed to work with any theme :slight_smile: You can customise this however you like.

It doesn’t need to be active on your Discourse site to work, it just needs to be installed, then selected in the relevant page in the Landing Pages Admin UI. This is what the theme settings look like on try.thepavilion.io (you can see the page settings in the OP)

3 curtidas

Epic! Excited to try this out. Thanks for this :slight_smile:

2 curtidas

:exploding_head:

This is really cool. Got me rethinking my entire approach. Thanks! :laughing:

2 curtidas

This is great!

For customizing, should I fork the repo to input my site’s info? Or is there a better way to do that?

2 curtidas

Thanks @sethm, yes the Blog Landing Theme and Blog Landing Pages are intended as templates, so you could:

  • import them directly into your instance as described above;
  • fork them; or
  • download them and modify them like you would with a template for Wordpress, Ghost etc.
3 curtidas

Existe alguma maneira de ter um subconjunto do conteúdo do Discourse visível publicamente (como o conteúdo deste blog) em vez de exigir registro/login? Obrigado.

–Peter

1 curtida

Olá Peter, sim, por padrão o conteúdo no Discourse é publicamente visível. Se não for, significa que você tem a configuração do site login obrigatório habilitada. Você pode então controlar a visibilidade de categorias específicas usando permissões específicas da categoria (nas configurações da categoria). Você pode ver uma captura de tela das configurações de acesso específicas da categoria acima.

1 curtida

Obrigado, mas não vejo a captura de tela das configurações de acesso específicas da categoria?

1 curtida

Alguma ajuda?
Talvez as configurações específicas da categoria não apareçam a menos que eu remova a opção “login required”?
Mas eu não quero remover isso até que eu tenha as categorias definidas como “public” ou “login required”…
Obrigado.

–Peter

1 curtida

Você deve conseguir visualizar as permissões da categoria na aba Segurança da chave inglesa de administrador na página da categoria:

Espero que ajude. :slightly_smiling_face:

2 curtidas

Ah! Obrigado.
Então, definir todas as categorias e usuários atuais para o nível de confiança 2, e a nova categoria que quero que seja pública para o nível de confiança 0, e alterar o login necessário, deve resolver? Ou essa lógica está errada?

–Peter

1 curtida

Se você quiser que a categoria do blog seja visível para pessoas anônimas e também para detentores de contas, você desejará que o grupo Todos tenha pelo menos ‘Ver’.

E então defina as outras categorias para serem pelo menos trust_level_0, para que as pessoas precisem ter uma conta para visualizar e interagir com os tópicos nelas.

1 curtida

Obrigado, funcionou. Agradeço a ajuda.

2 curtidas

Preciso de um pouco de ajuda para entender este plugin. Por um lado, você diz que pode

Definir uma categoria como seu blog, e a primeira postagem de cada tópico nessa categoria terá sua própria página de blog e aparecerá em uma página de lista de postagens do blog.

e por outro lado

  1. Configure as Páginas de Destino do Blog como seu repositório de páginas de destino.

Estou confuso. Posso executar um blog com minhas postagens do Discourse sem um repositório git e quaisquer arquivos *html.erb?

1 curtida

O conteúdo do blog é extraído de posts do Discourse. O layout do blog é gerenciado pelos arquivos HTML, que podem estar no repositório Páginas de Destino do Blog.

Este plugin não é como o Hugo, onde você cria posts de blog em markup. Embora integrar isso com o Hugo seria legal, poderíamos tentar isso em algum momento (cc @jumagura)

3 curtidas

Estou executando um fórum com o Discourse há alguns meses, então ainda sou bem novo nisso. Já instalei um plugin antes, mas quando tentei instalar o Landing Pages Plugin hoje à noite, recebi um erro quando o aplicativo foi reconstruído e ele não inicializou. Talvez haja um problema de compatibilidade ou versão com algo, mas não tenho certeza por onde começar. Alguém pode me dar uma dica? Eu olhei o log, mas não consigo identificar qual pode ser o problema.

Esta é a última parte dos resultados da reconstrução:

Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' falhou com retorno #<Process::Status: pid 364 exit 1>
Localização da falha: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec falhou com os parâmetros {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap falhou com código de saída 1
** FALHA AO INICIALIZAR ** por favor, role para cima e procure por mensagens de erro anteriores, pode haver mais de uma.
./discourse-doctor pode ajudar a diagnosticar o problema.
fb680c9c3b46dcd068abe877ed4187c730351c10139cc3eda2a8b7202822bf07
saul@discourseonubuntu2004-s-1vcpu-2gb-intel-lon1-01:/var/discourse$
saul@discourseonubuntu2004-s-1vcpu-2gb-intel-lon1-01:/var/discourse$

Obrigado por qualquer ajuda.

1 curtida

Alguém pode, por favor, verificar este plugin. Tenho o mesmo problema que o usuário acima. Recebo alguns erros ao tentar compilá-lo, aparentemente ele está quebrado desde a versão 2.9.0 beta 4 e superiores.

Eu poderia fornecer alguns logs, mas seria melhor se o criador verificasse uma instalação limpa do Discourse e então tentasse compilá-lo, porque testei isso em uma instalação existente do Discourse, bem como em uma nova, e sempre falha ao compilar.

Segui exatamente os passos fornecidos na postagem inicial.

  1. Instale o Plugin de Páginas de Destino (como instalar um plugin no Discourse) .
  2. Instale o Tema de Página de Destino de Blog , (como instalar um tema no Discourse) .
  3. Configure as Páginas de Destino de Blog como seu repositório de páginas de destino .
  4. Na UI de Administração de Páginas de Destino, altere a categoria da página “Blog” para qualquer categoria que você queira usar para executar seu blog.
1 curtida

Atualizarei este plugin para ser compatível com o Discourse mais recente na próxima semana

4 curtidas