News for hackers. Stuff that matters.
Re:No CMS? Writing Our Blog in React by dewey on Tuesday February 13, 2024 @01:03AM (#39354965)
My first reaction was to think that someone is re-inventing the wheel again for not good reason, but as usual "it depends".

If you are trying to have your blog as your main website and not just one sub-category it makes sense to use a blogging framework (Hugo, Ghost, Wordpress etc.), but I realized that having a blog integrated in a product isn't so straight forward if you want to keep your existing footer, header, CSS and share it.

I tried to use Hugo to integrate a blog in my Rails app but it was a bigger amount of pain than just doing it quickly in your existing code base with all the tools and styles already available.

Re:No CMS? Writing Our Blog in React by politelemon on Tuesday February 13, 2024 @01:19AM (#39355066)
> if you want to keep your existing footer, header, CSS

That's actually pretty simple, and is what CSS is meant to be helping with - there will be a pain of having to wrangle the framework's HTML to fit what you need, but it's doable, and a small price to pay for the benefits the tried-and-tested framework brings.

Re:No CMS? Writing Our Blog in React by dewey on Tuesday February 13, 2024 @01:28AM (#39355110)
Yes, but in reality it's not that easy if you want to have a shared footer / header / navbar component.

If you want to use for example Tailwind CSS classes in your blog you also need to integrate it with your build pipeline to add/remove unused classes from the final stylesheet.

Re:No CMS? Writing Our Blog in React by lelanthran on Tuesday February 13, 2024 @03:37AM (#39355751)
I have client side includes using a custom element, that I can add to any HTML page and get the shared footer, header, etc.
Re:No CMS? Writing Our Blog in React by hschne on Tuesday February 13, 2024 @01:37AM (#39355166)
I'm currently facing the same problem - adding a blog to a Rails app.

I thought Sitepress looks interesting, as its supposed to integrate with Rails. Have you given that one a try?

https://sitepress.cc/

Re:No CMS? Writing Our Blog in React by dewey on Tuesday February 13, 2024 @01:41AM (#39355190)
I haven't seen that one yet but it looks good and kinda what I was looking for. Thanks for sharing!

I expected there to be many solutions for this problem but wasn't able to find a simple one.

In the end I just generated a simple "post" model and have some ugly admin interface that allows me to paste some markdown into a small box and publish it. Then I'm just using some gems for RSS feed / sitemap handling.

Re:No CMS? Writing Our Blog in React by nicbou on Tuesday February 13, 2024 @01:52AM (#39355246)
If you natively work with Markdown, consider the static site generation approach. It also means that your content is also source-controlled.

Basically, just convert your markdown to HTML, and dump that into your existing templates.

Re:No CMS? Writing Our Blog in React by KingOfCoders on Tuesday February 13, 2024 @01:58AM (#39355278)
I use Hugo to generate HTML without header and footer etc. and serve the HTML parts from my app.