New tutorial on building a CMS-powered blog with Meteor

Hello everyone-

I wrote a tutorial on how to build a SEO-friendly CMS-powered bog with Meteor. It uses ButterCMS (headless CMS), Galaxy (w/ Prerender service), IronRouter, and the MS-SEO package.

I’d love your thoughts and questions. I’m also interested in knowing if there’s a way to refactor main.js.

Also feel free to contact me at roger@buttercms.com.

2 Likes

Yes - you should use arrow functions and stop using that!

Router.route('/blog', function () {
  butter.post.list({page: 1, page_size: 10}).then((response) => {
    this.render('Blog', {data: {posts: response.data.data}});
  });
});

And you can stop using then and use await, but that might be too cutting-edge depending on your audience:

Router.route('/blog', async function () {
  const response = await butter.post.list({page: 1, page_size: 10});
  this.render('Blog', {data: {posts: response.data.data}});
});
2 Likes

This is excellent feedback, thank you!

2 Likes