Reputation: 55
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?
Upvotes: 0
Views: 507
Reputation: 11
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
Upvotes: 1
Reputation: 21
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.
Upvotes: 2
Reputation: 55
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.)
Upvotes: 0