0

I wanna write a website utilizing the JAMstack architecture and include a blog page (dynamic content that's updated in slow intervals). I'm a bit confused about how I should implement that in a JAMstack-conform way.

I've taken a look into the React Static templates, which are built on JAMstack and they suggest storing the blog posts on a web service and accessing them via an API at build time. That makes sense to me (since the JAMstack docs promote the use of APIs) but that would mean I'd have to write my own web service that's only ever used by my own website and only at build time so that seems like a waste of resources and time.

The other idea I had is to just store the blog posts somewhere relative to my website and directly import them. That way I don't do anything unnecessary.

Which approach would you recommend and why? Also, if I store my data statically, should I include it in my Git repository? And how would I go about implementing extensions like an RSS interface without totally cluttering my project?

feeela
  • 29,399
  • 7
  • 59
  • 71
T0astBread
  • 55
  • 6
  • 2
    “seems like a waste of resources and time” Yep, not every method is suited for each project. You – the developer – has to decide, whether an approach is useful to the currently given project. If you only want to create a blog page, probably the JAMstack does not make much sense. On the other hand, modern CMS like Wordpress or TYPO3 provide you with an API, thus you can build your website according to the JAMstack and use e.g. Wordpress as backend/API. – feeela Jun 14 '18 at 10:59
  • Thanks for your comment! After some googling I've found out about headless CMSs ([headlesscms.org](https://headlesscms.org)) which seem to be a better solution for this problem (since they come without a frontend by default) – T0astBread Jun 14 '18 at 13:56
  • Also, yeah JAMstack might be overkill for my purpose but I just wanted to try it – T0astBread Jun 14 '18 at 13:59
  • 1
    See also: [WordPress as a Headless CMS](https://blog.daftcode.pl/wordpress-as-a-headless-cms-b4144c626695) – feeela Jun 14 '18 at 14:50

3 Answers3

2

It depends on what kind of website you want: information site, e-commerce, SPA with a dashboard and user login or social colaboration etc..

It's fun to build an SPA with React that fetches content from a dynamic api such as WordPress, contently etc but it will be overkill for an information/blog site if you don't want to show of your skills or have time and money to waste.

For an information /blog site you still have to use the JAMStack if you want a static website, beacuse you need functionality that you don't have such as form post, search, comments etc and that you get from the J and A. M will be there beacuse you want to write content efficently and use a WSG such as Hugo, Jekyll etc and have a framework for the structure and logic and the build process.

If you use a WSG then you have lots of options to deploy the generated content at github, gitlabs, S3 or your own server (not recommended).

Then if you don't want to learn the innerworkings of a server, OS, WSG, git, deploy pipelines and everything else that is interesting and just watch football and have a beer you can use appernetic.io (I am the founder) , netlify or similar solutions for building and deploying a website with custom domain name and free hosting.

1

A few months on and lots of people are moving towards GatsbyJS when they have React skills and want a static site generator.

Those who don't know / don't have time to learn React + GraphQL are still (as of early 2019) focused on the long-standing generators like Hugo, Jekyll, Middleman and so on.

Hosting can be anywhere, but straight S3 is a good option, or Netlify for an easy life.

There's a reasonable blog post here with further info: https://trolley.link/2019/02/03/static-site-generators-and-the-jamstack.html

0

Another possible solution that seems very appropriate are headless CMS. (That is a CMS that just takes care of storing your dynamic data and providing an API for it. It's totally decoupled from your frontend.)

Some of the most popular ones can be found on headlesscms.org.

(See the first and second comment on the question.)

T0astBread
  • 55
  • 6